diff --git a/.phpstorm.meta.php b/.phpstorm.meta.php new file mode 100644 index 00000000..a13790d5 --- /dev/null +++ b/.phpstorm.meta.php @@ -0,0 +1,2080 @@ + + * @see https://github.com/barryvdh/laravel-ide-helper + */ + override(new \Illuminate\Contracts\Container\Container, map([ + '' => '@', + 'Facade\FlareClient\Flare' => \Facade\FlareClient\Flare::class, + 'Facade\IgnitionContracts\SolutionProviderRepository' => \Facade\Ignition\SolutionProviders\SolutionProviderRepository::class, + 'Facade\Ignition\DumpRecorder\DumpRecorder' => \Facade\Ignition\DumpRecorder\DumpRecorder::class, + 'Facade\Ignition\DumpRecorder\MultiDumpHandler' => \Facade\Ignition\DumpRecorder\MultiDumpHandler::class, + 'Facade\Ignition\ErrorPage\Renderer' => \Facade\Ignition\ErrorPage\Renderer::class, + 'Facade\Ignition\IgnitionConfig' => \Facade\Ignition\IgnitionConfig::class, + 'Facade\Ignition\JobRecorder\JobRecorder' => \Facade\Ignition\JobRecorder\JobRecorder::class, + 'Facade\Ignition\LogRecorder\LogRecorder' => \Facade\Ignition\LogRecorder\LogRecorder::class, + 'Facade\Ignition\QueryRecorder\QueryRecorder' => \Facade\Ignition\QueryRecorder\QueryRecorder::class, + 'Facade\Ignition\Support\SentReports' => \Facade\Ignition\Support\SentReports::class, + 'Illuminate\Auth\Middleware\RequirePassword' => \Illuminate\Auth\Middleware\RequirePassword::class, + 'Illuminate\Broadcasting\BroadcastManager' => \Illuminate\Broadcasting\BroadcastManager::class, + 'Illuminate\Bus\BatchRepository' => \Illuminate\Bus\DatabaseBatchRepository::class, + 'Illuminate\Bus\DatabaseBatchRepository' => \Illuminate\Bus\DatabaseBatchRepository::class, + 'Illuminate\Bus\Dispatcher' => \Illuminate\Bus\Dispatcher::class, + 'Illuminate\Cache\RateLimiter' => \Illuminate\Cache\RateLimiter::class, + 'Illuminate\Console\Scheduling\Schedule' => \Illuminate\Console\Scheduling\Schedule::class, + 'Illuminate\Console\Scheduling\ScheduleClearCacheCommand' => \Illuminate\Console\Scheduling\ScheduleClearCacheCommand::class, + 'Illuminate\Console\Scheduling\ScheduleFinishCommand' => \Illuminate\Console\Scheduling\ScheduleFinishCommand::class, + 'Illuminate\Console\Scheduling\ScheduleListCommand' => \Illuminate\Console\Scheduling\ScheduleListCommand::class, + 'Illuminate\Console\Scheduling\ScheduleRunCommand' => \Illuminate\Console\Scheduling\ScheduleRunCommand::class, + 'Illuminate\Console\Scheduling\ScheduleTestCommand' => \Illuminate\Console\Scheduling\ScheduleTestCommand::class, + 'Illuminate\Console\Scheduling\ScheduleWorkCommand' => \Illuminate\Console\Scheduling\ScheduleWorkCommand::class, + 'Illuminate\Contracts\Auth\Access\Gate' => \Illuminate\Auth\Access\Gate::class, + 'Illuminate\Contracts\Broadcasting\Broadcaster' => \Illuminate\Broadcasting\Broadcasters\LogBroadcaster::class, + 'Illuminate\Contracts\Console\Kernel' => \App\Console\Kernel::class, + 'Illuminate\Contracts\Debug\ExceptionHandler' => \NunoMaduro\Collision\Adapters\Laravel\ExceptionHandler::class, + 'Illuminate\Contracts\Http\Kernel' => \App\Http\Kernel::class, + 'Illuminate\Contracts\Pipeline\Hub' => \Illuminate\Pipeline\Hub::class, + 'Illuminate\Contracts\Queue\EntityResolver' => \Illuminate\Database\Eloquent\QueueEntityResolver::class, + 'Illuminate\Contracts\Routing\ResponseFactory' => \Illuminate\Routing\ResponseFactory::class, + 'Illuminate\Contracts\Validation\UncompromisedVerifier' => \Illuminate\Validation\NotPwnedVerifier::class, + 'Illuminate\Database\Console\DbCommand' => \Illuminate\Database\Console\DbCommand::class, + 'Illuminate\Foundation\Mix' => \Illuminate\Foundation\Mix::class, + 'Illuminate\Foundation\PackageManifest' => \Illuminate\Foundation\PackageManifest::class, + 'Illuminate\Mail\Markdown' => \Illuminate\Mail\Markdown::class, + 'Illuminate\Notifications\ChannelManager' => \Illuminate\Notifications\ChannelManager::class, + 'Illuminate\Routing\Contracts\ControllerDispatcher' => \Illuminate\Routing\ControllerDispatcher::class, + 'Illuminate\Session\Middleware\StartSession' => \Illuminate\Session\Middleware\StartSession::class, + 'Illuminate\Testing\ParallelTesting' => \Illuminate\Testing\ParallelTesting::class, + 'NunoMaduro\Collision\Contracts\Provider' => \NunoMaduro\Collision\Provider::class, + 'Whoops\Handler\HandlerInterface' => \Facade\Ignition\ErrorPage\IgnitionWhoopsHandler::class, + 'auth' => \Illuminate\Auth\AuthManager::class, + 'auth.driver' => \Illuminate\Auth\SessionGuard::class, + 'auth.password' => \Illuminate\Auth\Passwords\PasswordBrokerManager::class, + 'auth.password.broker' => \Illuminate\Auth\Passwords\PasswordBroker::class, + 'blade.compiler' => \Illuminate\View\Compilers\BladeCompiler::class, + 'cache' => \Illuminate\Cache\CacheManager::class, + 'cache.psr6' => \Symfony\Component\Cache\Adapter\Psr16Adapter::class, + 'cache.store' => \Illuminate\Cache\Repository::class, + 'command.auth.resets.clear' => \Illuminate\Auth\Console\ClearResetsCommand::class, + 'command.cache.clear' => \Illuminate\Cache\Console\ClearCommand::class, + 'command.cache.forget' => \Illuminate\Cache\Console\ForgetCommand::class, + 'command.cache.table' => \Illuminate\Cache\Console\CacheTableCommand::class, + 'command.cast.make' => \Illuminate\Foundation\Console\CastMakeCommand::class, + 'command.channel.make' => \Illuminate\Foundation\Console\ChannelMakeCommand::class, + 'command.clear-compiled' => \Illuminate\Foundation\Console\ClearCompiledCommand::class, + 'command.component.make' => \Illuminate\Foundation\Console\ComponentMakeCommand::class, + 'command.config.cache' => \Illuminate\Foundation\Console\ConfigCacheCommand::class, + 'command.config.clear' => \Illuminate\Foundation\Console\ConfigClearCommand::class, + 'command.console.make' => \Illuminate\Foundation\Console\ConsoleMakeCommand::class, + 'command.controller.make' => \Illuminate\Routing\Console\ControllerMakeCommand::class, + 'command.db.prune' => \Illuminate\Database\Console\PruneCommand::class, + 'command.db.wipe' => \Illuminate\Database\Console\WipeCommand::class, + 'command.down' => \Illuminate\Foundation\Console\DownCommand::class, + 'command.environment' => \Illuminate\Foundation\Console\EnvironmentCommand::class, + 'command.event.cache' => \Illuminate\Foundation\Console\EventCacheCommand::class, + 'command.event.clear' => \Illuminate\Foundation\Console\EventClearCommand::class, + 'command.event.generate' => \Illuminate\Foundation\Console\EventGenerateCommand::class, + 'command.event.list' => \Illuminate\Foundation\Console\EventListCommand::class, + 'command.event.make' => \Illuminate\Foundation\Console\EventMakeCommand::class, + 'command.exception.make' => \Illuminate\Foundation\Console\ExceptionMakeCommand::class, + 'command.factory.make' => \Illuminate\Database\Console\Factories\FactoryMakeCommand::class, + 'command.flare:test' => \Facade\Ignition\Commands\TestCommand::class, + 'command.ide-helper.eloquent' => \Barryvdh\LaravelIdeHelper\Console\EloquentCommand::class, + 'command.ide-helper.generate' => \Barryvdh\LaravelIdeHelper\Console\GeneratorCommand::class, + 'command.ide-helper.meta' => \Barryvdh\LaravelIdeHelper\Console\MetaCommand::class, + 'command.ide-helper.models' => \Barryvdh\LaravelIdeHelper\Console\ModelsCommand::class, + 'command.job.make' => \Illuminate\Foundation\Console\JobMakeCommand::class, + 'command.key.generate' => \Illuminate\Foundation\Console\KeyGenerateCommand::class, + 'command.listener.make' => \Illuminate\Foundation\Console\ListenerMakeCommand::class, + 'command.mail.make' => \Illuminate\Foundation\Console\MailMakeCommand::class, + 'command.make:solution' => \Facade\Ignition\Commands\SolutionMakeCommand::class, + 'command.make:solution-provider' => \Facade\Ignition\Commands\SolutionProviderMakeCommand::class, + 'command.middleware.make' => \Illuminate\Routing\Console\MiddlewareMakeCommand::class, + 'command.migrate' => \Illuminate\Database\Console\Migrations\MigrateCommand::class, + 'command.migrate.fresh' => \Illuminate\Database\Console\Migrations\FreshCommand::class, + 'command.migrate.install' => \Illuminate\Database\Console\Migrations\InstallCommand::class, + 'command.migrate.make' => \Illuminate\Database\Console\Migrations\MigrateMakeCommand::class, + 'command.migrate.refresh' => \Illuminate\Database\Console\Migrations\RefreshCommand::class, + 'command.migrate.reset' => \Illuminate\Database\Console\Migrations\ResetCommand::class, + 'command.migrate.rollback' => \Illuminate\Database\Console\Migrations\RollbackCommand::class, + 'command.migrate.status' => \Illuminate\Database\Console\Migrations\StatusCommand::class, + 'command.model.make' => \Illuminate\Foundation\Console\ModelMakeCommand::class, + 'command.notification.make' => \Illuminate\Foundation\Console\NotificationMakeCommand::class, + 'command.notification.table' => \Illuminate\Notifications\Console\NotificationTableCommand::class, + 'command.observer.make' => \Illuminate\Foundation\Console\ObserverMakeCommand::class, + 'command.optimize' => \Illuminate\Foundation\Console\OptimizeCommand::class, + 'command.optimize.clear' => \Illuminate\Foundation\Console\OptimizeClearCommand::class, + 'command.package.discover' => \Illuminate\Foundation\Console\PackageDiscoverCommand::class, + 'command.policy.make' => \Illuminate\Foundation\Console\PolicyMakeCommand::class, + 'command.provider.make' => \Illuminate\Foundation\Console\ProviderMakeCommand::class, + 'command.queue.batches-table' => \Illuminate\Queue\Console\BatchesTableCommand::class, + 'command.queue.clear' => \Illuminate\Queue\Console\ClearCommand::class, + 'command.queue.failed' => \Illuminate\Queue\Console\ListFailedCommand::class, + 'command.queue.failed-table' => \Illuminate\Queue\Console\FailedTableCommand::class, + 'command.queue.flush' => \Illuminate\Queue\Console\FlushFailedCommand::class, + 'command.queue.forget' => \Illuminate\Queue\Console\ForgetFailedCommand::class, + 'command.queue.listen' => \Illuminate\Queue\Console\ListenCommand::class, + 'command.queue.monitor' => \Illuminate\Queue\Console\MonitorCommand::class, + 'command.queue.prune-batches' => \Illuminate\Queue\Console\PruneBatchesCommand::class, + 'command.queue.prune-failed-jobs' => \Illuminate\Queue\Console\PruneFailedJobsCommand::class, + 'command.queue.restart' => \Illuminate\Queue\Console\RestartCommand::class, + 'command.queue.retry' => \Illuminate\Queue\Console\RetryCommand::class, + 'command.queue.retry-batch' => \Illuminate\Queue\Console\RetryBatchCommand::class, + 'command.queue.table' => \Illuminate\Queue\Console\TableCommand::class, + 'command.queue.work' => \Illuminate\Queue\Console\WorkCommand::class, + 'command.request.make' => \Illuminate\Foundation\Console\RequestMakeCommand::class, + 'command.resource.make' => \Illuminate\Foundation\Console\ResourceMakeCommand::class, + 'command.route.cache' => \Illuminate\Foundation\Console\RouteCacheCommand::class, + 'command.route.clear' => \Illuminate\Foundation\Console\RouteClearCommand::class, + 'command.route.list' => \Illuminate\Foundation\Console\RouteListCommand::class, + 'command.rule.make' => \Illuminate\Foundation\Console\RuleMakeCommand::class, + 'command.schema.dump' => \Illuminate\Database\Console\DumpCommand::class, + 'command.seed' => \Illuminate\Database\Console\Seeds\SeedCommand::class, + 'command.seeder.make' => \Illuminate\Database\Console\Seeds\SeederMakeCommand::class, + 'command.serve' => \Illuminate\Foundation\Console\ServeCommand::class, + 'command.session.table' => \Illuminate\Session\Console\SessionTableCommand::class, + 'command.storage.link' => \Illuminate\Foundation\Console\StorageLinkCommand::class, + 'command.stub.publish' => \Illuminate\Foundation\Console\StubPublishCommand::class, + 'command.test.make' => \Illuminate\Foundation\Console\TestMakeCommand::class, + 'command.tinker' => \Laravel\Tinker\Console\TinkerCommand::class, + 'command.up' => \Illuminate\Foundation\Console\UpCommand::class, + 'command.vendor.publish' => \Illuminate\Foundation\Console\VendorPublishCommand::class, + 'command.view.cache' => \Illuminate\Foundation\Console\ViewCacheCommand::class, + 'command.view.clear' => \Illuminate\Foundation\Console\ViewClearCommand::class, + 'composer' => \Illuminate\Support\Composer::class, + 'cookie' => \Illuminate\Cookie\CookieJar::class, + 'db' => \Illuminate\Database\DatabaseManager::class, + 'db.connection' => \Illuminate\Database\SQLiteConnection::class, + 'db.factory' => \Illuminate\Database\Connectors\ConnectionFactory::class, + 'db.transactions' => \Illuminate\Database\DatabaseTransactionsManager::class, + 'encrypter' => \Illuminate\Encryption\Encrypter::class, + 'events' => \Illuminate\Events\Dispatcher::class, + 'files' => \Illuminate\Filesystem\Filesystem::class, + 'filesystem' => \Illuminate\Filesystem\FilesystemManager::class, + 'filesystem.disk' => \Illuminate\Filesystem\FilesystemAdapter::class, + 'flare.http' => \Facade\FlareClient\Http\Client::class, + 'flare.logger' => \Monolog\Logger::class, + 'form' => \Collective\Html\FormBuilder::class, + 'github' => \GrahamCampbell\GitHub\GitHubManager::class, + 'github.authfactory' => \GrahamCampbell\GitHub\Auth\AuthenticatorFactory::class, + 'github.cachefactory' => \GrahamCampbell\GitHub\Cache\ConnectionFactory::class, + 'github.factory' => \GrahamCampbell\GitHub\GitHubFactory::class, + 'hash' => \Illuminate\Hashing\HashManager::class, + 'hash.driver' => \Illuminate\Hashing\BcryptHasher::class, + 'html' => \Collective\Html\HtmlBuilder::class, + 'log' => \Illuminate\Log\LogManager::class, + 'mail.manager' => \Illuminate\Mail\MailManager::class, + 'mailer' => \Illuminate\Mail\Mailer::class, + 'memcached.connector' => \Illuminate\Cache\MemcachedConnector::class, + 'migration.creator' => \Illuminate\Database\Migrations\MigrationCreator::class, + 'migration.repository' => \Illuminate\Database\Migrations\DatabaseMigrationRepository::class, + 'migrator' => \Illuminate\Database\Migrations\Migrator::class, + 'queue' => \Illuminate\Queue\QueueManager::class, + 'queue.connection' => \Illuminate\Queue\SyncQueue::class, + 'queue.failer' => \Illuminate\Queue\Failed\DatabaseFailedJobProvider::class, + 'queue.listener' => \Illuminate\Queue\Listener::class, + 'queue.worker' => \Illuminate\Queue\Worker::class, + 'redirect' => \Illuminate\Routing\Redirector::class, + 'redis' => \Illuminate\Redis\RedisManager::class, + 'router' => \Illuminate\Routing\Router::class, + 'session' => \Illuminate\Session\SessionManager::class, + 'session.store' => \Illuminate\Session\Store::class, + 'settings' => \App\Setting::class, + 'translation.loader' => \Illuminate\Translation\FileLoader::class, + 'translator' => \Illuminate\Translation\Translator::class, + 'url' => \Illuminate\Routing\UrlGenerator::class, + 'validation.presence' => \Illuminate\Validation\DatabasePresenceVerifier::class, + 'view' => \Illuminate\View\Factory::class, + 'view.engine.resolver' => \Illuminate\View\Engines\EngineResolver::class, + 'view.finder' => \Illuminate\View\FileViewFinder::class, + ])); + override(\Illuminate\Container\Container::makeWith(0), map([ + '' => '@', + 'Facade\FlareClient\Flare' => \Facade\FlareClient\Flare::class, + 'Facade\IgnitionContracts\SolutionProviderRepository' => \Facade\Ignition\SolutionProviders\SolutionProviderRepository::class, + 'Facade\Ignition\DumpRecorder\DumpRecorder' => \Facade\Ignition\DumpRecorder\DumpRecorder::class, + 'Facade\Ignition\DumpRecorder\MultiDumpHandler' => \Facade\Ignition\DumpRecorder\MultiDumpHandler::class, + 'Facade\Ignition\ErrorPage\Renderer' => \Facade\Ignition\ErrorPage\Renderer::class, + 'Facade\Ignition\IgnitionConfig' => \Facade\Ignition\IgnitionConfig::class, + 'Facade\Ignition\JobRecorder\JobRecorder' => \Facade\Ignition\JobRecorder\JobRecorder::class, + 'Facade\Ignition\LogRecorder\LogRecorder' => \Facade\Ignition\LogRecorder\LogRecorder::class, + 'Facade\Ignition\QueryRecorder\QueryRecorder' => \Facade\Ignition\QueryRecorder\QueryRecorder::class, + 'Facade\Ignition\Support\SentReports' => \Facade\Ignition\Support\SentReports::class, + 'Illuminate\Auth\Middleware\RequirePassword' => \Illuminate\Auth\Middleware\RequirePassword::class, + 'Illuminate\Broadcasting\BroadcastManager' => \Illuminate\Broadcasting\BroadcastManager::class, + 'Illuminate\Bus\BatchRepository' => \Illuminate\Bus\DatabaseBatchRepository::class, + 'Illuminate\Bus\DatabaseBatchRepository' => \Illuminate\Bus\DatabaseBatchRepository::class, + 'Illuminate\Bus\Dispatcher' => \Illuminate\Bus\Dispatcher::class, + 'Illuminate\Cache\RateLimiter' => \Illuminate\Cache\RateLimiter::class, + 'Illuminate\Console\Scheduling\Schedule' => \Illuminate\Console\Scheduling\Schedule::class, + 'Illuminate\Console\Scheduling\ScheduleClearCacheCommand' => \Illuminate\Console\Scheduling\ScheduleClearCacheCommand::class, + 'Illuminate\Console\Scheduling\ScheduleFinishCommand' => \Illuminate\Console\Scheduling\ScheduleFinishCommand::class, + 'Illuminate\Console\Scheduling\ScheduleListCommand' => \Illuminate\Console\Scheduling\ScheduleListCommand::class, + 'Illuminate\Console\Scheduling\ScheduleRunCommand' => \Illuminate\Console\Scheduling\ScheduleRunCommand::class, + 'Illuminate\Console\Scheduling\ScheduleTestCommand' => \Illuminate\Console\Scheduling\ScheduleTestCommand::class, + 'Illuminate\Console\Scheduling\ScheduleWorkCommand' => \Illuminate\Console\Scheduling\ScheduleWorkCommand::class, + 'Illuminate\Contracts\Auth\Access\Gate' => \Illuminate\Auth\Access\Gate::class, + 'Illuminate\Contracts\Broadcasting\Broadcaster' => \Illuminate\Broadcasting\Broadcasters\LogBroadcaster::class, + 'Illuminate\Contracts\Console\Kernel' => \App\Console\Kernel::class, + 'Illuminate\Contracts\Debug\ExceptionHandler' => \NunoMaduro\Collision\Adapters\Laravel\ExceptionHandler::class, + 'Illuminate\Contracts\Http\Kernel' => \App\Http\Kernel::class, + 'Illuminate\Contracts\Pipeline\Hub' => \Illuminate\Pipeline\Hub::class, + 'Illuminate\Contracts\Queue\EntityResolver' => \Illuminate\Database\Eloquent\QueueEntityResolver::class, + 'Illuminate\Contracts\Routing\ResponseFactory' => \Illuminate\Routing\ResponseFactory::class, + 'Illuminate\Contracts\Validation\UncompromisedVerifier' => \Illuminate\Validation\NotPwnedVerifier::class, + 'Illuminate\Database\Console\DbCommand' => \Illuminate\Database\Console\DbCommand::class, + 'Illuminate\Foundation\Mix' => \Illuminate\Foundation\Mix::class, + 'Illuminate\Foundation\PackageManifest' => \Illuminate\Foundation\PackageManifest::class, + 'Illuminate\Mail\Markdown' => \Illuminate\Mail\Markdown::class, + 'Illuminate\Notifications\ChannelManager' => \Illuminate\Notifications\ChannelManager::class, + 'Illuminate\Routing\Contracts\ControllerDispatcher' => \Illuminate\Routing\ControllerDispatcher::class, + 'Illuminate\Session\Middleware\StartSession' => \Illuminate\Session\Middleware\StartSession::class, + 'Illuminate\Testing\ParallelTesting' => \Illuminate\Testing\ParallelTesting::class, + 'NunoMaduro\Collision\Contracts\Provider' => \NunoMaduro\Collision\Provider::class, + 'Whoops\Handler\HandlerInterface' => \Facade\Ignition\ErrorPage\IgnitionWhoopsHandler::class, + 'auth' => \Illuminate\Auth\AuthManager::class, + 'auth.driver' => \Illuminate\Auth\SessionGuard::class, + 'auth.password' => \Illuminate\Auth\Passwords\PasswordBrokerManager::class, + 'auth.password.broker' => \Illuminate\Auth\Passwords\PasswordBroker::class, + 'blade.compiler' => \Illuminate\View\Compilers\BladeCompiler::class, + 'cache' => \Illuminate\Cache\CacheManager::class, + 'cache.psr6' => \Symfony\Component\Cache\Adapter\Psr16Adapter::class, + 'cache.store' => \Illuminate\Cache\Repository::class, + 'command.auth.resets.clear' => \Illuminate\Auth\Console\ClearResetsCommand::class, + 'command.cache.clear' => \Illuminate\Cache\Console\ClearCommand::class, + 'command.cache.forget' => \Illuminate\Cache\Console\ForgetCommand::class, + 'command.cache.table' => \Illuminate\Cache\Console\CacheTableCommand::class, + 'command.cast.make' => \Illuminate\Foundation\Console\CastMakeCommand::class, + 'command.channel.make' => \Illuminate\Foundation\Console\ChannelMakeCommand::class, + 'command.clear-compiled' => \Illuminate\Foundation\Console\ClearCompiledCommand::class, + 'command.component.make' => \Illuminate\Foundation\Console\ComponentMakeCommand::class, + 'command.config.cache' => \Illuminate\Foundation\Console\ConfigCacheCommand::class, + 'command.config.clear' => \Illuminate\Foundation\Console\ConfigClearCommand::class, + 'command.console.make' => \Illuminate\Foundation\Console\ConsoleMakeCommand::class, + 'command.controller.make' => \Illuminate\Routing\Console\ControllerMakeCommand::class, + 'command.db.prune' => \Illuminate\Database\Console\PruneCommand::class, + 'command.db.wipe' => \Illuminate\Database\Console\WipeCommand::class, + 'command.down' => \Illuminate\Foundation\Console\DownCommand::class, + 'command.environment' => \Illuminate\Foundation\Console\EnvironmentCommand::class, + 'command.event.cache' => \Illuminate\Foundation\Console\EventCacheCommand::class, + 'command.event.clear' => \Illuminate\Foundation\Console\EventClearCommand::class, + 'command.event.generate' => \Illuminate\Foundation\Console\EventGenerateCommand::class, + 'command.event.list' => \Illuminate\Foundation\Console\EventListCommand::class, + 'command.event.make' => \Illuminate\Foundation\Console\EventMakeCommand::class, + 'command.exception.make' => \Illuminate\Foundation\Console\ExceptionMakeCommand::class, + 'command.factory.make' => \Illuminate\Database\Console\Factories\FactoryMakeCommand::class, + 'command.flare:test' => \Facade\Ignition\Commands\TestCommand::class, + 'command.ide-helper.eloquent' => \Barryvdh\LaravelIdeHelper\Console\EloquentCommand::class, + 'command.ide-helper.generate' => \Barryvdh\LaravelIdeHelper\Console\GeneratorCommand::class, + 'command.ide-helper.meta' => \Barryvdh\LaravelIdeHelper\Console\MetaCommand::class, + 'command.ide-helper.models' => \Barryvdh\LaravelIdeHelper\Console\ModelsCommand::class, + 'command.job.make' => \Illuminate\Foundation\Console\JobMakeCommand::class, + 'command.key.generate' => \Illuminate\Foundation\Console\KeyGenerateCommand::class, + 'command.listener.make' => \Illuminate\Foundation\Console\ListenerMakeCommand::class, + 'command.mail.make' => \Illuminate\Foundation\Console\MailMakeCommand::class, + 'command.make:solution' => \Facade\Ignition\Commands\SolutionMakeCommand::class, + 'command.make:solution-provider' => \Facade\Ignition\Commands\SolutionProviderMakeCommand::class, + 'command.middleware.make' => \Illuminate\Routing\Console\MiddlewareMakeCommand::class, + 'command.migrate' => \Illuminate\Database\Console\Migrations\MigrateCommand::class, + 'command.migrate.fresh' => \Illuminate\Database\Console\Migrations\FreshCommand::class, + 'command.migrate.install' => \Illuminate\Database\Console\Migrations\InstallCommand::class, + 'command.migrate.make' => \Illuminate\Database\Console\Migrations\MigrateMakeCommand::class, + 'command.migrate.refresh' => \Illuminate\Database\Console\Migrations\RefreshCommand::class, + 'command.migrate.reset' => \Illuminate\Database\Console\Migrations\ResetCommand::class, + 'command.migrate.rollback' => \Illuminate\Database\Console\Migrations\RollbackCommand::class, + 'command.migrate.status' => \Illuminate\Database\Console\Migrations\StatusCommand::class, + 'command.model.make' => \Illuminate\Foundation\Console\ModelMakeCommand::class, + 'command.notification.make' => \Illuminate\Foundation\Console\NotificationMakeCommand::class, + 'command.notification.table' => \Illuminate\Notifications\Console\NotificationTableCommand::class, + 'command.observer.make' => \Illuminate\Foundation\Console\ObserverMakeCommand::class, + 'command.optimize' => \Illuminate\Foundation\Console\OptimizeCommand::class, + 'command.optimize.clear' => \Illuminate\Foundation\Console\OptimizeClearCommand::class, + 'command.package.discover' => \Illuminate\Foundation\Console\PackageDiscoverCommand::class, + 'command.policy.make' => \Illuminate\Foundation\Console\PolicyMakeCommand::class, + 'command.provider.make' => \Illuminate\Foundation\Console\ProviderMakeCommand::class, + 'command.queue.batches-table' => \Illuminate\Queue\Console\BatchesTableCommand::class, + 'command.queue.clear' => \Illuminate\Queue\Console\ClearCommand::class, + 'command.queue.failed' => \Illuminate\Queue\Console\ListFailedCommand::class, + 'command.queue.failed-table' => \Illuminate\Queue\Console\FailedTableCommand::class, + 'command.queue.flush' => \Illuminate\Queue\Console\FlushFailedCommand::class, + 'command.queue.forget' => \Illuminate\Queue\Console\ForgetFailedCommand::class, + 'command.queue.listen' => \Illuminate\Queue\Console\ListenCommand::class, + 'command.queue.monitor' => \Illuminate\Queue\Console\MonitorCommand::class, + 'command.queue.prune-batches' => \Illuminate\Queue\Console\PruneBatchesCommand::class, + 'command.queue.prune-failed-jobs' => \Illuminate\Queue\Console\PruneFailedJobsCommand::class, + 'command.queue.restart' => \Illuminate\Queue\Console\RestartCommand::class, + 'command.queue.retry' => \Illuminate\Queue\Console\RetryCommand::class, + 'command.queue.retry-batch' => \Illuminate\Queue\Console\RetryBatchCommand::class, + 'command.queue.table' => \Illuminate\Queue\Console\TableCommand::class, + 'command.queue.work' => \Illuminate\Queue\Console\WorkCommand::class, + 'command.request.make' => \Illuminate\Foundation\Console\RequestMakeCommand::class, + 'command.resource.make' => \Illuminate\Foundation\Console\ResourceMakeCommand::class, + 'command.route.cache' => \Illuminate\Foundation\Console\RouteCacheCommand::class, + 'command.route.clear' => \Illuminate\Foundation\Console\RouteClearCommand::class, + 'command.route.list' => \Illuminate\Foundation\Console\RouteListCommand::class, + 'command.rule.make' => \Illuminate\Foundation\Console\RuleMakeCommand::class, + 'command.schema.dump' => \Illuminate\Database\Console\DumpCommand::class, + 'command.seed' => \Illuminate\Database\Console\Seeds\SeedCommand::class, + 'command.seeder.make' => \Illuminate\Database\Console\Seeds\SeederMakeCommand::class, + 'command.serve' => \Illuminate\Foundation\Console\ServeCommand::class, + 'command.session.table' => \Illuminate\Session\Console\SessionTableCommand::class, + 'command.storage.link' => \Illuminate\Foundation\Console\StorageLinkCommand::class, + 'command.stub.publish' => \Illuminate\Foundation\Console\StubPublishCommand::class, + 'command.test.make' => \Illuminate\Foundation\Console\TestMakeCommand::class, + 'command.tinker' => \Laravel\Tinker\Console\TinkerCommand::class, + 'command.up' => \Illuminate\Foundation\Console\UpCommand::class, + 'command.vendor.publish' => \Illuminate\Foundation\Console\VendorPublishCommand::class, + 'command.view.cache' => \Illuminate\Foundation\Console\ViewCacheCommand::class, + 'command.view.clear' => \Illuminate\Foundation\Console\ViewClearCommand::class, + 'composer' => \Illuminate\Support\Composer::class, + 'cookie' => \Illuminate\Cookie\CookieJar::class, + 'db' => \Illuminate\Database\DatabaseManager::class, + 'db.connection' => \Illuminate\Database\SQLiteConnection::class, + 'db.factory' => \Illuminate\Database\Connectors\ConnectionFactory::class, + 'db.transactions' => \Illuminate\Database\DatabaseTransactionsManager::class, + 'encrypter' => \Illuminate\Encryption\Encrypter::class, + 'events' => \Illuminate\Events\Dispatcher::class, + 'files' => \Illuminate\Filesystem\Filesystem::class, + 'filesystem' => \Illuminate\Filesystem\FilesystemManager::class, + 'filesystem.disk' => \Illuminate\Filesystem\FilesystemAdapter::class, + 'flare.http' => \Facade\FlareClient\Http\Client::class, + 'flare.logger' => \Monolog\Logger::class, + 'form' => \Collective\Html\FormBuilder::class, + 'github' => \GrahamCampbell\GitHub\GitHubManager::class, + 'github.authfactory' => \GrahamCampbell\GitHub\Auth\AuthenticatorFactory::class, + 'github.cachefactory' => \GrahamCampbell\GitHub\Cache\ConnectionFactory::class, + 'github.factory' => \GrahamCampbell\GitHub\GitHubFactory::class, + 'hash' => \Illuminate\Hashing\HashManager::class, + 'hash.driver' => \Illuminate\Hashing\BcryptHasher::class, + 'html' => \Collective\Html\HtmlBuilder::class, + 'log' => \Illuminate\Log\LogManager::class, + 'mail.manager' => \Illuminate\Mail\MailManager::class, + 'mailer' => \Illuminate\Mail\Mailer::class, + 'memcached.connector' => \Illuminate\Cache\MemcachedConnector::class, + 'migration.creator' => \Illuminate\Database\Migrations\MigrationCreator::class, + 'migration.repository' => \Illuminate\Database\Migrations\DatabaseMigrationRepository::class, + 'migrator' => \Illuminate\Database\Migrations\Migrator::class, + 'queue' => \Illuminate\Queue\QueueManager::class, + 'queue.connection' => \Illuminate\Queue\SyncQueue::class, + 'queue.failer' => \Illuminate\Queue\Failed\DatabaseFailedJobProvider::class, + 'queue.listener' => \Illuminate\Queue\Listener::class, + 'queue.worker' => \Illuminate\Queue\Worker::class, + 'redirect' => \Illuminate\Routing\Redirector::class, + 'redis' => \Illuminate\Redis\RedisManager::class, + 'router' => \Illuminate\Routing\Router::class, + 'session' => \Illuminate\Session\SessionManager::class, + 'session.store' => \Illuminate\Session\Store::class, + 'settings' => \App\Setting::class, + 'translation.loader' => \Illuminate\Translation\FileLoader::class, + 'translator' => \Illuminate\Translation\Translator::class, + 'url' => \Illuminate\Routing\UrlGenerator::class, + 'validation.presence' => \Illuminate\Validation\DatabasePresenceVerifier::class, + 'view' => \Illuminate\View\Factory::class, + 'view.engine.resolver' => \Illuminate\View\Engines\EngineResolver::class, + 'view.finder' => \Illuminate\View\FileViewFinder::class, + ])); + override(\Illuminate\Contracts\Container\Container::get(0), map([ + '' => '@', + 'Facade\FlareClient\Flare' => \Facade\FlareClient\Flare::class, + 'Facade\IgnitionContracts\SolutionProviderRepository' => \Facade\Ignition\SolutionProviders\SolutionProviderRepository::class, + 'Facade\Ignition\DumpRecorder\DumpRecorder' => \Facade\Ignition\DumpRecorder\DumpRecorder::class, + 'Facade\Ignition\DumpRecorder\MultiDumpHandler' => \Facade\Ignition\DumpRecorder\MultiDumpHandler::class, + 'Facade\Ignition\ErrorPage\Renderer' => \Facade\Ignition\ErrorPage\Renderer::class, + 'Facade\Ignition\IgnitionConfig' => \Facade\Ignition\IgnitionConfig::class, + 'Facade\Ignition\JobRecorder\JobRecorder' => \Facade\Ignition\JobRecorder\JobRecorder::class, + 'Facade\Ignition\LogRecorder\LogRecorder' => \Facade\Ignition\LogRecorder\LogRecorder::class, + 'Facade\Ignition\QueryRecorder\QueryRecorder' => \Facade\Ignition\QueryRecorder\QueryRecorder::class, + 'Facade\Ignition\Support\SentReports' => \Facade\Ignition\Support\SentReports::class, + 'Illuminate\Auth\Middleware\RequirePassword' => \Illuminate\Auth\Middleware\RequirePassword::class, + 'Illuminate\Broadcasting\BroadcastManager' => \Illuminate\Broadcasting\BroadcastManager::class, + 'Illuminate\Bus\BatchRepository' => \Illuminate\Bus\DatabaseBatchRepository::class, + 'Illuminate\Bus\DatabaseBatchRepository' => \Illuminate\Bus\DatabaseBatchRepository::class, + 'Illuminate\Bus\Dispatcher' => \Illuminate\Bus\Dispatcher::class, + 'Illuminate\Cache\RateLimiter' => \Illuminate\Cache\RateLimiter::class, + 'Illuminate\Console\Scheduling\Schedule' => \Illuminate\Console\Scheduling\Schedule::class, + 'Illuminate\Console\Scheduling\ScheduleClearCacheCommand' => \Illuminate\Console\Scheduling\ScheduleClearCacheCommand::class, + 'Illuminate\Console\Scheduling\ScheduleFinishCommand' => \Illuminate\Console\Scheduling\ScheduleFinishCommand::class, + 'Illuminate\Console\Scheduling\ScheduleListCommand' => \Illuminate\Console\Scheduling\ScheduleListCommand::class, + 'Illuminate\Console\Scheduling\ScheduleRunCommand' => \Illuminate\Console\Scheduling\ScheduleRunCommand::class, + 'Illuminate\Console\Scheduling\ScheduleTestCommand' => \Illuminate\Console\Scheduling\ScheduleTestCommand::class, + 'Illuminate\Console\Scheduling\ScheduleWorkCommand' => \Illuminate\Console\Scheduling\ScheduleWorkCommand::class, + 'Illuminate\Contracts\Auth\Access\Gate' => \Illuminate\Auth\Access\Gate::class, + 'Illuminate\Contracts\Broadcasting\Broadcaster' => \Illuminate\Broadcasting\Broadcasters\LogBroadcaster::class, + 'Illuminate\Contracts\Console\Kernel' => \App\Console\Kernel::class, + 'Illuminate\Contracts\Debug\ExceptionHandler' => \NunoMaduro\Collision\Adapters\Laravel\ExceptionHandler::class, + 'Illuminate\Contracts\Http\Kernel' => \App\Http\Kernel::class, + 'Illuminate\Contracts\Pipeline\Hub' => \Illuminate\Pipeline\Hub::class, + 'Illuminate\Contracts\Queue\EntityResolver' => \Illuminate\Database\Eloquent\QueueEntityResolver::class, + 'Illuminate\Contracts\Routing\ResponseFactory' => \Illuminate\Routing\ResponseFactory::class, + 'Illuminate\Contracts\Validation\UncompromisedVerifier' => \Illuminate\Validation\NotPwnedVerifier::class, + 'Illuminate\Database\Console\DbCommand' => \Illuminate\Database\Console\DbCommand::class, + 'Illuminate\Foundation\Mix' => \Illuminate\Foundation\Mix::class, + 'Illuminate\Foundation\PackageManifest' => \Illuminate\Foundation\PackageManifest::class, + 'Illuminate\Mail\Markdown' => \Illuminate\Mail\Markdown::class, + 'Illuminate\Notifications\ChannelManager' => \Illuminate\Notifications\ChannelManager::class, + 'Illuminate\Routing\Contracts\ControllerDispatcher' => \Illuminate\Routing\ControllerDispatcher::class, + 'Illuminate\Session\Middleware\StartSession' => \Illuminate\Session\Middleware\StartSession::class, + 'Illuminate\Testing\ParallelTesting' => \Illuminate\Testing\ParallelTesting::class, + 'NunoMaduro\Collision\Contracts\Provider' => \NunoMaduro\Collision\Provider::class, + 'Whoops\Handler\HandlerInterface' => \Facade\Ignition\ErrorPage\IgnitionWhoopsHandler::class, + 'auth' => \Illuminate\Auth\AuthManager::class, + 'auth.driver' => \Illuminate\Auth\SessionGuard::class, + 'auth.password' => \Illuminate\Auth\Passwords\PasswordBrokerManager::class, + 'auth.password.broker' => \Illuminate\Auth\Passwords\PasswordBroker::class, + 'blade.compiler' => \Illuminate\View\Compilers\BladeCompiler::class, + 'cache' => \Illuminate\Cache\CacheManager::class, + 'cache.psr6' => \Symfony\Component\Cache\Adapter\Psr16Adapter::class, + 'cache.store' => \Illuminate\Cache\Repository::class, + 'command.auth.resets.clear' => \Illuminate\Auth\Console\ClearResetsCommand::class, + 'command.cache.clear' => \Illuminate\Cache\Console\ClearCommand::class, + 'command.cache.forget' => \Illuminate\Cache\Console\ForgetCommand::class, + 'command.cache.table' => \Illuminate\Cache\Console\CacheTableCommand::class, + 'command.cast.make' => \Illuminate\Foundation\Console\CastMakeCommand::class, + 'command.channel.make' => \Illuminate\Foundation\Console\ChannelMakeCommand::class, + 'command.clear-compiled' => \Illuminate\Foundation\Console\ClearCompiledCommand::class, + 'command.component.make' => \Illuminate\Foundation\Console\ComponentMakeCommand::class, + 'command.config.cache' => \Illuminate\Foundation\Console\ConfigCacheCommand::class, + 'command.config.clear' => \Illuminate\Foundation\Console\ConfigClearCommand::class, + 'command.console.make' => \Illuminate\Foundation\Console\ConsoleMakeCommand::class, + 'command.controller.make' => \Illuminate\Routing\Console\ControllerMakeCommand::class, + 'command.db.prune' => \Illuminate\Database\Console\PruneCommand::class, + 'command.db.wipe' => \Illuminate\Database\Console\WipeCommand::class, + 'command.down' => \Illuminate\Foundation\Console\DownCommand::class, + 'command.environment' => \Illuminate\Foundation\Console\EnvironmentCommand::class, + 'command.event.cache' => \Illuminate\Foundation\Console\EventCacheCommand::class, + 'command.event.clear' => \Illuminate\Foundation\Console\EventClearCommand::class, + 'command.event.generate' => \Illuminate\Foundation\Console\EventGenerateCommand::class, + 'command.event.list' => \Illuminate\Foundation\Console\EventListCommand::class, + 'command.event.make' => \Illuminate\Foundation\Console\EventMakeCommand::class, + 'command.exception.make' => \Illuminate\Foundation\Console\ExceptionMakeCommand::class, + 'command.factory.make' => \Illuminate\Database\Console\Factories\FactoryMakeCommand::class, + 'command.flare:test' => \Facade\Ignition\Commands\TestCommand::class, + 'command.ide-helper.eloquent' => \Barryvdh\LaravelIdeHelper\Console\EloquentCommand::class, + 'command.ide-helper.generate' => \Barryvdh\LaravelIdeHelper\Console\GeneratorCommand::class, + 'command.ide-helper.meta' => \Barryvdh\LaravelIdeHelper\Console\MetaCommand::class, + 'command.ide-helper.models' => \Barryvdh\LaravelIdeHelper\Console\ModelsCommand::class, + 'command.job.make' => \Illuminate\Foundation\Console\JobMakeCommand::class, + 'command.key.generate' => \Illuminate\Foundation\Console\KeyGenerateCommand::class, + 'command.listener.make' => \Illuminate\Foundation\Console\ListenerMakeCommand::class, + 'command.mail.make' => \Illuminate\Foundation\Console\MailMakeCommand::class, + 'command.make:solution' => \Facade\Ignition\Commands\SolutionMakeCommand::class, + 'command.make:solution-provider' => \Facade\Ignition\Commands\SolutionProviderMakeCommand::class, + 'command.middleware.make' => \Illuminate\Routing\Console\MiddlewareMakeCommand::class, + 'command.migrate' => \Illuminate\Database\Console\Migrations\MigrateCommand::class, + 'command.migrate.fresh' => \Illuminate\Database\Console\Migrations\FreshCommand::class, + 'command.migrate.install' => \Illuminate\Database\Console\Migrations\InstallCommand::class, + 'command.migrate.make' => \Illuminate\Database\Console\Migrations\MigrateMakeCommand::class, + 'command.migrate.refresh' => \Illuminate\Database\Console\Migrations\RefreshCommand::class, + 'command.migrate.reset' => \Illuminate\Database\Console\Migrations\ResetCommand::class, + 'command.migrate.rollback' => \Illuminate\Database\Console\Migrations\RollbackCommand::class, + 'command.migrate.status' => \Illuminate\Database\Console\Migrations\StatusCommand::class, + 'command.model.make' => \Illuminate\Foundation\Console\ModelMakeCommand::class, + 'command.notification.make' => \Illuminate\Foundation\Console\NotificationMakeCommand::class, + 'command.notification.table' => \Illuminate\Notifications\Console\NotificationTableCommand::class, + 'command.observer.make' => \Illuminate\Foundation\Console\ObserverMakeCommand::class, + 'command.optimize' => \Illuminate\Foundation\Console\OptimizeCommand::class, + 'command.optimize.clear' => \Illuminate\Foundation\Console\OptimizeClearCommand::class, + 'command.package.discover' => \Illuminate\Foundation\Console\PackageDiscoverCommand::class, + 'command.policy.make' => \Illuminate\Foundation\Console\PolicyMakeCommand::class, + 'command.provider.make' => \Illuminate\Foundation\Console\ProviderMakeCommand::class, + 'command.queue.batches-table' => \Illuminate\Queue\Console\BatchesTableCommand::class, + 'command.queue.clear' => \Illuminate\Queue\Console\ClearCommand::class, + 'command.queue.failed' => \Illuminate\Queue\Console\ListFailedCommand::class, + 'command.queue.failed-table' => \Illuminate\Queue\Console\FailedTableCommand::class, + 'command.queue.flush' => \Illuminate\Queue\Console\FlushFailedCommand::class, + 'command.queue.forget' => \Illuminate\Queue\Console\ForgetFailedCommand::class, + 'command.queue.listen' => \Illuminate\Queue\Console\ListenCommand::class, + 'command.queue.monitor' => \Illuminate\Queue\Console\MonitorCommand::class, + 'command.queue.prune-batches' => \Illuminate\Queue\Console\PruneBatchesCommand::class, + 'command.queue.prune-failed-jobs' => \Illuminate\Queue\Console\PruneFailedJobsCommand::class, + 'command.queue.restart' => \Illuminate\Queue\Console\RestartCommand::class, + 'command.queue.retry' => \Illuminate\Queue\Console\RetryCommand::class, + 'command.queue.retry-batch' => \Illuminate\Queue\Console\RetryBatchCommand::class, + 'command.queue.table' => \Illuminate\Queue\Console\TableCommand::class, + 'command.queue.work' => \Illuminate\Queue\Console\WorkCommand::class, + 'command.request.make' => \Illuminate\Foundation\Console\RequestMakeCommand::class, + 'command.resource.make' => \Illuminate\Foundation\Console\ResourceMakeCommand::class, + 'command.route.cache' => \Illuminate\Foundation\Console\RouteCacheCommand::class, + 'command.route.clear' => \Illuminate\Foundation\Console\RouteClearCommand::class, + 'command.route.list' => \Illuminate\Foundation\Console\RouteListCommand::class, + 'command.rule.make' => \Illuminate\Foundation\Console\RuleMakeCommand::class, + 'command.schema.dump' => \Illuminate\Database\Console\DumpCommand::class, + 'command.seed' => \Illuminate\Database\Console\Seeds\SeedCommand::class, + 'command.seeder.make' => \Illuminate\Database\Console\Seeds\SeederMakeCommand::class, + 'command.serve' => \Illuminate\Foundation\Console\ServeCommand::class, + 'command.session.table' => \Illuminate\Session\Console\SessionTableCommand::class, + 'command.storage.link' => \Illuminate\Foundation\Console\StorageLinkCommand::class, + 'command.stub.publish' => \Illuminate\Foundation\Console\StubPublishCommand::class, + 'command.test.make' => \Illuminate\Foundation\Console\TestMakeCommand::class, + 'command.tinker' => \Laravel\Tinker\Console\TinkerCommand::class, + 'command.up' => \Illuminate\Foundation\Console\UpCommand::class, + 'command.vendor.publish' => \Illuminate\Foundation\Console\VendorPublishCommand::class, + 'command.view.cache' => \Illuminate\Foundation\Console\ViewCacheCommand::class, + 'command.view.clear' => \Illuminate\Foundation\Console\ViewClearCommand::class, + 'composer' => \Illuminate\Support\Composer::class, + 'cookie' => \Illuminate\Cookie\CookieJar::class, + 'db' => \Illuminate\Database\DatabaseManager::class, + 'db.connection' => \Illuminate\Database\SQLiteConnection::class, + 'db.factory' => \Illuminate\Database\Connectors\ConnectionFactory::class, + 'db.transactions' => \Illuminate\Database\DatabaseTransactionsManager::class, + 'encrypter' => \Illuminate\Encryption\Encrypter::class, + 'events' => \Illuminate\Events\Dispatcher::class, + 'files' => \Illuminate\Filesystem\Filesystem::class, + 'filesystem' => \Illuminate\Filesystem\FilesystemManager::class, + 'filesystem.disk' => \Illuminate\Filesystem\FilesystemAdapter::class, + 'flare.http' => \Facade\FlareClient\Http\Client::class, + 'flare.logger' => \Monolog\Logger::class, + 'form' => \Collective\Html\FormBuilder::class, + 'github' => \GrahamCampbell\GitHub\GitHubManager::class, + 'github.authfactory' => \GrahamCampbell\GitHub\Auth\AuthenticatorFactory::class, + 'github.cachefactory' => \GrahamCampbell\GitHub\Cache\ConnectionFactory::class, + 'github.factory' => \GrahamCampbell\GitHub\GitHubFactory::class, + 'hash' => \Illuminate\Hashing\HashManager::class, + 'hash.driver' => \Illuminate\Hashing\BcryptHasher::class, + 'html' => \Collective\Html\HtmlBuilder::class, + 'log' => \Illuminate\Log\LogManager::class, + 'mail.manager' => \Illuminate\Mail\MailManager::class, + 'mailer' => \Illuminate\Mail\Mailer::class, + 'memcached.connector' => \Illuminate\Cache\MemcachedConnector::class, + 'migration.creator' => \Illuminate\Database\Migrations\MigrationCreator::class, + 'migration.repository' => \Illuminate\Database\Migrations\DatabaseMigrationRepository::class, + 'migrator' => \Illuminate\Database\Migrations\Migrator::class, + 'queue' => \Illuminate\Queue\QueueManager::class, + 'queue.connection' => \Illuminate\Queue\SyncQueue::class, + 'queue.failer' => \Illuminate\Queue\Failed\DatabaseFailedJobProvider::class, + 'queue.listener' => \Illuminate\Queue\Listener::class, + 'queue.worker' => \Illuminate\Queue\Worker::class, + 'redirect' => \Illuminate\Routing\Redirector::class, + 'redis' => \Illuminate\Redis\RedisManager::class, + 'router' => \Illuminate\Routing\Router::class, + 'session' => \Illuminate\Session\SessionManager::class, + 'session.store' => \Illuminate\Session\Store::class, + 'settings' => \App\Setting::class, + 'translation.loader' => \Illuminate\Translation\FileLoader::class, + 'translator' => \Illuminate\Translation\Translator::class, + 'url' => \Illuminate\Routing\UrlGenerator::class, + 'validation.presence' => \Illuminate\Validation\DatabasePresenceVerifier::class, + 'view' => \Illuminate\View\Factory::class, + 'view.engine.resolver' => \Illuminate\View\Engines\EngineResolver::class, + 'view.finder' => \Illuminate\View\FileViewFinder::class, + ])); + override(\Illuminate\Contracts\Container\Container::make(0), map([ + '' => '@', + 'Facade\FlareClient\Flare' => \Facade\FlareClient\Flare::class, + 'Facade\IgnitionContracts\SolutionProviderRepository' => \Facade\Ignition\SolutionProviders\SolutionProviderRepository::class, + 'Facade\Ignition\DumpRecorder\DumpRecorder' => \Facade\Ignition\DumpRecorder\DumpRecorder::class, + 'Facade\Ignition\DumpRecorder\MultiDumpHandler' => \Facade\Ignition\DumpRecorder\MultiDumpHandler::class, + 'Facade\Ignition\ErrorPage\Renderer' => \Facade\Ignition\ErrorPage\Renderer::class, + 'Facade\Ignition\IgnitionConfig' => \Facade\Ignition\IgnitionConfig::class, + 'Facade\Ignition\JobRecorder\JobRecorder' => \Facade\Ignition\JobRecorder\JobRecorder::class, + 'Facade\Ignition\LogRecorder\LogRecorder' => \Facade\Ignition\LogRecorder\LogRecorder::class, + 'Facade\Ignition\QueryRecorder\QueryRecorder' => \Facade\Ignition\QueryRecorder\QueryRecorder::class, + 'Facade\Ignition\Support\SentReports' => \Facade\Ignition\Support\SentReports::class, + 'Illuminate\Auth\Middleware\RequirePassword' => \Illuminate\Auth\Middleware\RequirePassword::class, + 'Illuminate\Broadcasting\BroadcastManager' => \Illuminate\Broadcasting\BroadcastManager::class, + 'Illuminate\Bus\BatchRepository' => \Illuminate\Bus\DatabaseBatchRepository::class, + 'Illuminate\Bus\DatabaseBatchRepository' => \Illuminate\Bus\DatabaseBatchRepository::class, + 'Illuminate\Bus\Dispatcher' => \Illuminate\Bus\Dispatcher::class, + 'Illuminate\Cache\RateLimiter' => \Illuminate\Cache\RateLimiter::class, + 'Illuminate\Console\Scheduling\Schedule' => \Illuminate\Console\Scheduling\Schedule::class, + 'Illuminate\Console\Scheduling\ScheduleClearCacheCommand' => \Illuminate\Console\Scheduling\ScheduleClearCacheCommand::class, + 'Illuminate\Console\Scheduling\ScheduleFinishCommand' => \Illuminate\Console\Scheduling\ScheduleFinishCommand::class, + 'Illuminate\Console\Scheduling\ScheduleListCommand' => \Illuminate\Console\Scheduling\ScheduleListCommand::class, + 'Illuminate\Console\Scheduling\ScheduleRunCommand' => \Illuminate\Console\Scheduling\ScheduleRunCommand::class, + 'Illuminate\Console\Scheduling\ScheduleTestCommand' => \Illuminate\Console\Scheduling\ScheduleTestCommand::class, + 'Illuminate\Console\Scheduling\ScheduleWorkCommand' => \Illuminate\Console\Scheduling\ScheduleWorkCommand::class, + 'Illuminate\Contracts\Auth\Access\Gate' => \Illuminate\Auth\Access\Gate::class, + 'Illuminate\Contracts\Broadcasting\Broadcaster' => \Illuminate\Broadcasting\Broadcasters\LogBroadcaster::class, + 'Illuminate\Contracts\Console\Kernel' => \App\Console\Kernel::class, + 'Illuminate\Contracts\Debug\ExceptionHandler' => \NunoMaduro\Collision\Adapters\Laravel\ExceptionHandler::class, + 'Illuminate\Contracts\Http\Kernel' => \App\Http\Kernel::class, + 'Illuminate\Contracts\Pipeline\Hub' => \Illuminate\Pipeline\Hub::class, + 'Illuminate\Contracts\Queue\EntityResolver' => \Illuminate\Database\Eloquent\QueueEntityResolver::class, + 'Illuminate\Contracts\Routing\ResponseFactory' => \Illuminate\Routing\ResponseFactory::class, + 'Illuminate\Contracts\Validation\UncompromisedVerifier' => \Illuminate\Validation\NotPwnedVerifier::class, + 'Illuminate\Database\Console\DbCommand' => \Illuminate\Database\Console\DbCommand::class, + 'Illuminate\Foundation\Mix' => \Illuminate\Foundation\Mix::class, + 'Illuminate\Foundation\PackageManifest' => \Illuminate\Foundation\PackageManifest::class, + 'Illuminate\Mail\Markdown' => \Illuminate\Mail\Markdown::class, + 'Illuminate\Notifications\ChannelManager' => \Illuminate\Notifications\ChannelManager::class, + 'Illuminate\Routing\Contracts\ControllerDispatcher' => \Illuminate\Routing\ControllerDispatcher::class, + 'Illuminate\Session\Middleware\StartSession' => \Illuminate\Session\Middleware\StartSession::class, + 'Illuminate\Testing\ParallelTesting' => \Illuminate\Testing\ParallelTesting::class, + 'NunoMaduro\Collision\Contracts\Provider' => \NunoMaduro\Collision\Provider::class, + 'Whoops\Handler\HandlerInterface' => \Facade\Ignition\ErrorPage\IgnitionWhoopsHandler::class, + 'auth' => \Illuminate\Auth\AuthManager::class, + 'auth.driver' => \Illuminate\Auth\SessionGuard::class, + 'auth.password' => \Illuminate\Auth\Passwords\PasswordBrokerManager::class, + 'auth.password.broker' => \Illuminate\Auth\Passwords\PasswordBroker::class, + 'blade.compiler' => \Illuminate\View\Compilers\BladeCompiler::class, + 'cache' => \Illuminate\Cache\CacheManager::class, + 'cache.psr6' => \Symfony\Component\Cache\Adapter\Psr16Adapter::class, + 'cache.store' => \Illuminate\Cache\Repository::class, + 'command.auth.resets.clear' => \Illuminate\Auth\Console\ClearResetsCommand::class, + 'command.cache.clear' => \Illuminate\Cache\Console\ClearCommand::class, + 'command.cache.forget' => \Illuminate\Cache\Console\ForgetCommand::class, + 'command.cache.table' => \Illuminate\Cache\Console\CacheTableCommand::class, + 'command.cast.make' => \Illuminate\Foundation\Console\CastMakeCommand::class, + 'command.channel.make' => \Illuminate\Foundation\Console\ChannelMakeCommand::class, + 'command.clear-compiled' => \Illuminate\Foundation\Console\ClearCompiledCommand::class, + 'command.component.make' => \Illuminate\Foundation\Console\ComponentMakeCommand::class, + 'command.config.cache' => \Illuminate\Foundation\Console\ConfigCacheCommand::class, + 'command.config.clear' => \Illuminate\Foundation\Console\ConfigClearCommand::class, + 'command.console.make' => \Illuminate\Foundation\Console\ConsoleMakeCommand::class, + 'command.controller.make' => \Illuminate\Routing\Console\ControllerMakeCommand::class, + 'command.db.prune' => \Illuminate\Database\Console\PruneCommand::class, + 'command.db.wipe' => \Illuminate\Database\Console\WipeCommand::class, + 'command.down' => \Illuminate\Foundation\Console\DownCommand::class, + 'command.environment' => \Illuminate\Foundation\Console\EnvironmentCommand::class, + 'command.event.cache' => \Illuminate\Foundation\Console\EventCacheCommand::class, + 'command.event.clear' => \Illuminate\Foundation\Console\EventClearCommand::class, + 'command.event.generate' => \Illuminate\Foundation\Console\EventGenerateCommand::class, + 'command.event.list' => \Illuminate\Foundation\Console\EventListCommand::class, + 'command.event.make' => \Illuminate\Foundation\Console\EventMakeCommand::class, + 'command.exception.make' => \Illuminate\Foundation\Console\ExceptionMakeCommand::class, + 'command.factory.make' => \Illuminate\Database\Console\Factories\FactoryMakeCommand::class, + 'command.flare:test' => \Facade\Ignition\Commands\TestCommand::class, + 'command.ide-helper.eloquent' => \Barryvdh\LaravelIdeHelper\Console\EloquentCommand::class, + 'command.ide-helper.generate' => \Barryvdh\LaravelIdeHelper\Console\GeneratorCommand::class, + 'command.ide-helper.meta' => \Barryvdh\LaravelIdeHelper\Console\MetaCommand::class, + 'command.ide-helper.models' => \Barryvdh\LaravelIdeHelper\Console\ModelsCommand::class, + 'command.job.make' => \Illuminate\Foundation\Console\JobMakeCommand::class, + 'command.key.generate' => \Illuminate\Foundation\Console\KeyGenerateCommand::class, + 'command.listener.make' => \Illuminate\Foundation\Console\ListenerMakeCommand::class, + 'command.mail.make' => \Illuminate\Foundation\Console\MailMakeCommand::class, + 'command.make:solution' => \Facade\Ignition\Commands\SolutionMakeCommand::class, + 'command.make:solution-provider' => \Facade\Ignition\Commands\SolutionProviderMakeCommand::class, + 'command.middleware.make' => \Illuminate\Routing\Console\MiddlewareMakeCommand::class, + 'command.migrate' => \Illuminate\Database\Console\Migrations\MigrateCommand::class, + 'command.migrate.fresh' => \Illuminate\Database\Console\Migrations\FreshCommand::class, + 'command.migrate.install' => \Illuminate\Database\Console\Migrations\InstallCommand::class, + 'command.migrate.make' => \Illuminate\Database\Console\Migrations\MigrateMakeCommand::class, + 'command.migrate.refresh' => \Illuminate\Database\Console\Migrations\RefreshCommand::class, + 'command.migrate.reset' => \Illuminate\Database\Console\Migrations\ResetCommand::class, + 'command.migrate.rollback' => \Illuminate\Database\Console\Migrations\RollbackCommand::class, + 'command.migrate.status' => \Illuminate\Database\Console\Migrations\StatusCommand::class, + 'command.model.make' => \Illuminate\Foundation\Console\ModelMakeCommand::class, + 'command.notification.make' => \Illuminate\Foundation\Console\NotificationMakeCommand::class, + 'command.notification.table' => \Illuminate\Notifications\Console\NotificationTableCommand::class, + 'command.observer.make' => \Illuminate\Foundation\Console\ObserverMakeCommand::class, + 'command.optimize' => \Illuminate\Foundation\Console\OptimizeCommand::class, + 'command.optimize.clear' => \Illuminate\Foundation\Console\OptimizeClearCommand::class, + 'command.package.discover' => \Illuminate\Foundation\Console\PackageDiscoverCommand::class, + 'command.policy.make' => \Illuminate\Foundation\Console\PolicyMakeCommand::class, + 'command.provider.make' => \Illuminate\Foundation\Console\ProviderMakeCommand::class, + 'command.queue.batches-table' => \Illuminate\Queue\Console\BatchesTableCommand::class, + 'command.queue.clear' => \Illuminate\Queue\Console\ClearCommand::class, + 'command.queue.failed' => \Illuminate\Queue\Console\ListFailedCommand::class, + 'command.queue.failed-table' => \Illuminate\Queue\Console\FailedTableCommand::class, + 'command.queue.flush' => \Illuminate\Queue\Console\FlushFailedCommand::class, + 'command.queue.forget' => \Illuminate\Queue\Console\ForgetFailedCommand::class, + 'command.queue.listen' => \Illuminate\Queue\Console\ListenCommand::class, + 'command.queue.monitor' => \Illuminate\Queue\Console\MonitorCommand::class, + 'command.queue.prune-batches' => \Illuminate\Queue\Console\PruneBatchesCommand::class, + 'command.queue.prune-failed-jobs' => \Illuminate\Queue\Console\PruneFailedJobsCommand::class, + 'command.queue.restart' => \Illuminate\Queue\Console\RestartCommand::class, + 'command.queue.retry' => \Illuminate\Queue\Console\RetryCommand::class, + 'command.queue.retry-batch' => \Illuminate\Queue\Console\RetryBatchCommand::class, + 'command.queue.table' => \Illuminate\Queue\Console\TableCommand::class, + 'command.queue.work' => \Illuminate\Queue\Console\WorkCommand::class, + 'command.request.make' => \Illuminate\Foundation\Console\RequestMakeCommand::class, + 'command.resource.make' => \Illuminate\Foundation\Console\ResourceMakeCommand::class, + 'command.route.cache' => \Illuminate\Foundation\Console\RouteCacheCommand::class, + 'command.route.clear' => \Illuminate\Foundation\Console\RouteClearCommand::class, + 'command.route.list' => \Illuminate\Foundation\Console\RouteListCommand::class, + 'command.rule.make' => \Illuminate\Foundation\Console\RuleMakeCommand::class, + 'command.schema.dump' => \Illuminate\Database\Console\DumpCommand::class, + 'command.seed' => \Illuminate\Database\Console\Seeds\SeedCommand::class, + 'command.seeder.make' => \Illuminate\Database\Console\Seeds\SeederMakeCommand::class, + 'command.serve' => \Illuminate\Foundation\Console\ServeCommand::class, + 'command.session.table' => \Illuminate\Session\Console\SessionTableCommand::class, + 'command.storage.link' => \Illuminate\Foundation\Console\StorageLinkCommand::class, + 'command.stub.publish' => \Illuminate\Foundation\Console\StubPublishCommand::class, + 'command.test.make' => \Illuminate\Foundation\Console\TestMakeCommand::class, + 'command.tinker' => \Laravel\Tinker\Console\TinkerCommand::class, + 'command.up' => \Illuminate\Foundation\Console\UpCommand::class, + 'command.vendor.publish' => \Illuminate\Foundation\Console\VendorPublishCommand::class, + 'command.view.cache' => \Illuminate\Foundation\Console\ViewCacheCommand::class, + 'command.view.clear' => \Illuminate\Foundation\Console\ViewClearCommand::class, + 'composer' => \Illuminate\Support\Composer::class, + 'cookie' => \Illuminate\Cookie\CookieJar::class, + 'db' => \Illuminate\Database\DatabaseManager::class, + 'db.connection' => \Illuminate\Database\SQLiteConnection::class, + 'db.factory' => \Illuminate\Database\Connectors\ConnectionFactory::class, + 'db.transactions' => \Illuminate\Database\DatabaseTransactionsManager::class, + 'encrypter' => \Illuminate\Encryption\Encrypter::class, + 'events' => \Illuminate\Events\Dispatcher::class, + 'files' => \Illuminate\Filesystem\Filesystem::class, + 'filesystem' => \Illuminate\Filesystem\FilesystemManager::class, + 'filesystem.disk' => \Illuminate\Filesystem\FilesystemAdapter::class, + 'flare.http' => \Facade\FlareClient\Http\Client::class, + 'flare.logger' => \Monolog\Logger::class, + 'form' => \Collective\Html\FormBuilder::class, + 'github' => \GrahamCampbell\GitHub\GitHubManager::class, + 'github.authfactory' => \GrahamCampbell\GitHub\Auth\AuthenticatorFactory::class, + 'github.cachefactory' => \GrahamCampbell\GitHub\Cache\ConnectionFactory::class, + 'github.factory' => \GrahamCampbell\GitHub\GitHubFactory::class, + 'hash' => \Illuminate\Hashing\HashManager::class, + 'hash.driver' => \Illuminate\Hashing\BcryptHasher::class, + 'html' => \Collective\Html\HtmlBuilder::class, + 'log' => \Illuminate\Log\LogManager::class, + 'mail.manager' => \Illuminate\Mail\MailManager::class, + 'mailer' => \Illuminate\Mail\Mailer::class, + 'memcached.connector' => \Illuminate\Cache\MemcachedConnector::class, + 'migration.creator' => \Illuminate\Database\Migrations\MigrationCreator::class, + 'migration.repository' => \Illuminate\Database\Migrations\DatabaseMigrationRepository::class, + 'migrator' => \Illuminate\Database\Migrations\Migrator::class, + 'queue' => \Illuminate\Queue\QueueManager::class, + 'queue.connection' => \Illuminate\Queue\SyncQueue::class, + 'queue.failer' => \Illuminate\Queue\Failed\DatabaseFailedJobProvider::class, + 'queue.listener' => \Illuminate\Queue\Listener::class, + 'queue.worker' => \Illuminate\Queue\Worker::class, + 'redirect' => \Illuminate\Routing\Redirector::class, + 'redis' => \Illuminate\Redis\RedisManager::class, + 'router' => \Illuminate\Routing\Router::class, + 'session' => \Illuminate\Session\SessionManager::class, + 'session.store' => \Illuminate\Session\Store::class, + 'settings' => \App\Setting::class, + 'translation.loader' => \Illuminate\Translation\FileLoader::class, + 'translator' => \Illuminate\Translation\Translator::class, + 'url' => \Illuminate\Routing\UrlGenerator::class, + 'validation.presence' => \Illuminate\Validation\DatabasePresenceVerifier::class, + 'view' => \Illuminate\View\Factory::class, + 'view.engine.resolver' => \Illuminate\View\Engines\EngineResolver::class, + 'view.finder' => \Illuminate\View\FileViewFinder::class, + ])); + override(\Illuminate\Contracts\Container\Container::makeWith(0), map([ + '' => '@', + 'Facade\FlareClient\Flare' => \Facade\FlareClient\Flare::class, + 'Facade\IgnitionContracts\SolutionProviderRepository' => \Facade\Ignition\SolutionProviders\SolutionProviderRepository::class, + 'Facade\Ignition\DumpRecorder\DumpRecorder' => \Facade\Ignition\DumpRecorder\DumpRecorder::class, + 'Facade\Ignition\DumpRecorder\MultiDumpHandler' => \Facade\Ignition\DumpRecorder\MultiDumpHandler::class, + 'Facade\Ignition\ErrorPage\Renderer' => \Facade\Ignition\ErrorPage\Renderer::class, + 'Facade\Ignition\IgnitionConfig' => \Facade\Ignition\IgnitionConfig::class, + 'Facade\Ignition\JobRecorder\JobRecorder' => \Facade\Ignition\JobRecorder\JobRecorder::class, + 'Facade\Ignition\LogRecorder\LogRecorder' => \Facade\Ignition\LogRecorder\LogRecorder::class, + 'Facade\Ignition\QueryRecorder\QueryRecorder' => \Facade\Ignition\QueryRecorder\QueryRecorder::class, + 'Facade\Ignition\Support\SentReports' => \Facade\Ignition\Support\SentReports::class, + 'Illuminate\Auth\Middleware\RequirePassword' => \Illuminate\Auth\Middleware\RequirePassword::class, + 'Illuminate\Broadcasting\BroadcastManager' => \Illuminate\Broadcasting\BroadcastManager::class, + 'Illuminate\Bus\BatchRepository' => \Illuminate\Bus\DatabaseBatchRepository::class, + 'Illuminate\Bus\DatabaseBatchRepository' => \Illuminate\Bus\DatabaseBatchRepository::class, + 'Illuminate\Bus\Dispatcher' => \Illuminate\Bus\Dispatcher::class, + 'Illuminate\Cache\RateLimiter' => \Illuminate\Cache\RateLimiter::class, + 'Illuminate\Console\Scheduling\Schedule' => \Illuminate\Console\Scheduling\Schedule::class, + 'Illuminate\Console\Scheduling\ScheduleClearCacheCommand' => \Illuminate\Console\Scheduling\ScheduleClearCacheCommand::class, + 'Illuminate\Console\Scheduling\ScheduleFinishCommand' => \Illuminate\Console\Scheduling\ScheduleFinishCommand::class, + 'Illuminate\Console\Scheduling\ScheduleListCommand' => \Illuminate\Console\Scheduling\ScheduleListCommand::class, + 'Illuminate\Console\Scheduling\ScheduleRunCommand' => \Illuminate\Console\Scheduling\ScheduleRunCommand::class, + 'Illuminate\Console\Scheduling\ScheduleTestCommand' => \Illuminate\Console\Scheduling\ScheduleTestCommand::class, + 'Illuminate\Console\Scheduling\ScheduleWorkCommand' => \Illuminate\Console\Scheduling\ScheduleWorkCommand::class, + 'Illuminate\Contracts\Auth\Access\Gate' => \Illuminate\Auth\Access\Gate::class, + 'Illuminate\Contracts\Broadcasting\Broadcaster' => \Illuminate\Broadcasting\Broadcasters\LogBroadcaster::class, + 'Illuminate\Contracts\Console\Kernel' => \App\Console\Kernel::class, + 'Illuminate\Contracts\Debug\ExceptionHandler' => \NunoMaduro\Collision\Adapters\Laravel\ExceptionHandler::class, + 'Illuminate\Contracts\Http\Kernel' => \App\Http\Kernel::class, + 'Illuminate\Contracts\Pipeline\Hub' => \Illuminate\Pipeline\Hub::class, + 'Illuminate\Contracts\Queue\EntityResolver' => \Illuminate\Database\Eloquent\QueueEntityResolver::class, + 'Illuminate\Contracts\Routing\ResponseFactory' => \Illuminate\Routing\ResponseFactory::class, + 'Illuminate\Contracts\Validation\UncompromisedVerifier' => \Illuminate\Validation\NotPwnedVerifier::class, + 'Illuminate\Database\Console\DbCommand' => \Illuminate\Database\Console\DbCommand::class, + 'Illuminate\Foundation\Mix' => \Illuminate\Foundation\Mix::class, + 'Illuminate\Foundation\PackageManifest' => \Illuminate\Foundation\PackageManifest::class, + 'Illuminate\Mail\Markdown' => \Illuminate\Mail\Markdown::class, + 'Illuminate\Notifications\ChannelManager' => \Illuminate\Notifications\ChannelManager::class, + 'Illuminate\Routing\Contracts\ControllerDispatcher' => \Illuminate\Routing\ControllerDispatcher::class, + 'Illuminate\Session\Middleware\StartSession' => \Illuminate\Session\Middleware\StartSession::class, + 'Illuminate\Testing\ParallelTesting' => \Illuminate\Testing\ParallelTesting::class, + 'NunoMaduro\Collision\Contracts\Provider' => \NunoMaduro\Collision\Provider::class, + 'Whoops\Handler\HandlerInterface' => \Facade\Ignition\ErrorPage\IgnitionWhoopsHandler::class, + 'auth' => \Illuminate\Auth\AuthManager::class, + 'auth.driver' => \Illuminate\Auth\SessionGuard::class, + 'auth.password' => \Illuminate\Auth\Passwords\PasswordBrokerManager::class, + 'auth.password.broker' => \Illuminate\Auth\Passwords\PasswordBroker::class, + 'blade.compiler' => \Illuminate\View\Compilers\BladeCompiler::class, + 'cache' => \Illuminate\Cache\CacheManager::class, + 'cache.psr6' => \Symfony\Component\Cache\Adapter\Psr16Adapter::class, + 'cache.store' => \Illuminate\Cache\Repository::class, + 'command.auth.resets.clear' => \Illuminate\Auth\Console\ClearResetsCommand::class, + 'command.cache.clear' => \Illuminate\Cache\Console\ClearCommand::class, + 'command.cache.forget' => \Illuminate\Cache\Console\ForgetCommand::class, + 'command.cache.table' => \Illuminate\Cache\Console\CacheTableCommand::class, + 'command.cast.make' => \Illuminate\Foundation\Console\CastMakeCommand::class, + 'command.channel.make' => \Illuminate\Foundation\Console\ChannelMakeCommand::class, + 'command.clear-compiled' => \Illuminate\Foundation\Console\ClearCompiledCommand::class, + 'command.component.make' => \Illuminate\Foundation\Console\ComponentMakeCommand::class, + 'command.config.cache' => \Illuminate\Foundation\Console\ConfigCacheCommand::class, + 'command.config.clear' => \Illuminate\Foundation\Console\ConfigClearCommand::class, + 'command.console.make' => \Illuminate\Foundation\Console\ConsoleMakeCommand::class, + 'command.controller.make' => \Illuminate\Routing\Console\ControllerMakeCommand::class, + 'command.db.prune' => \Illuminate\Database\Console\PruneCommand::class, + 'command.db.wipe' => \Illuminate\Database\Console\WipeCommand::class, + 'command.down' => \Illuminate\Foundation\Console\DownCommand::class, + 'command.environment' => \Illuminate\Foundation\Console\EnvironmentCommand::class, + 'command.event.cache' => \Illuminate\Foundation\Console\EventCacheCommand::class, + 'command.event.clear' => \Illuminate\Foundation\Console\EventClearCommand::class, + 'command.event.generate' => \Illuminate\Foundation\Console\EventGenerateCommand::class, + 'command.event.list' => \Illuminate\Foundation\Console\EventListCommand::class, + 'command.event.make' => \Illuminate\Foundation\Console\EventMakeCommand::class, + 'command.exception.make' => \Illuminate\Foundation\Console\ExceptionMakeCommand::class, + 'command.factory.make' => \Illuminate\Database\Console\Factories\FactoryMakeCommand::class, + 'command.flare:test' => \Facade\Ignition\Commands\TestCommand::class, + 'command.ide-helper.eloquent' => \Barryvdh\LaravelIdeHelper\Console\EloquentCommand::class, + 'command.ide-helper.generate' => \Barryvdh\LaravelIdeHelper\Console\GeneratorCommand::class, + 'command.ide-helper.meta' => \Barryvdh\LaravelIdeHelper\Console\MetaCommand::class, + 'command.ide-helper.models' => \Barryvdh\LaravelIdeHelper\Console\ModelsCommand::class, + 'command.job.make' => \Illuminate\Foundation\Console\JobMakeCommand::class, + 'command.key.generate' => \Illuminate\Foundation\Console\KeyGenerateCommand::class, + 'command.listener.make' => \Illuminate\Foundation\Console\ListenerMakeCommand::class, + 'command.mail.make' => \Illuminate\Foundation\Console\MailMakeCommand::class, + 'command.make:solution' => \Facade\Ignition\Commands\SolutionMakeCommand::class, + 'command.make:solution-provider' => \Facade\Ignition\Commands\SolutionProviderMakeCommand::class, + 'command.middleware.make' => \Illuminate\Routing\Console\MiddlewareMakeCommand::class, + 'command.migrate' => \Illuminate\Database\Console\Migrations\MigrateCommand::class, + 'command.migrate.fresh' => \Illuminate\Database\Console\Migrations\FreshCommand::class, + 'command.migrate.install' => \Illuminate\Database\Console\Migrations\InstallCommand::class, + 'command.migrate.make' => \Illuminate\Database\Console\Migrations\MigrateMakeCommand::class, + 'command.migrate.refresh' => \Illuminate\Database\Console\Migrations\RefreshCommand::class, + 'command.migrate.reset' => \Illuminate\Database\Console\Migrations\ResetCommand::class, + 'command.migrate.rollback' => \Illuminate\Database\Console\Migrations\RollbackCommand::class, + 'command.migrate.status' => \Illuminate\Database\Console\Migrations\StatusCommand::class, + 'command.model.make' => \Illuminate\Foundation\Console\ModelMakeCommand::class, + 'command.notification.make' => \Illuminate\Foundation\Console\NotificationMakeCommand::class, + 'command.notification.table' => \Illuminate\Notifications\Console\NotificationTableCommand::class, + 'command.observer.make' => \Illuminate\Foundation\Console\ObserverMakeCommand::class, + 'command.optimize' => \Illuminate\Foundation\Console\OptimizeCommand::class, + 'command.optimize.clear' => \Illuminate\Foundation\Console\OptimizeClearCommand::class, + 'command.package.discover' => \Illuminate\Foundation\Console\PackageDiscoverCommand::class, + 'command.policy.make' => \Illuminate\Foundation\Console\PolicyMakeCommand::class, + 'command.provider.make' => \Illuminate\Foundation\Console\ProviderMakeCommand::class, + 'command.queue.batches-table' => \Illuminate\Queue\Console\BatchesTableCommand::class, + 'command.queue.clear' => \Illuminate\Queue\Console\ClearCommand::class, + 'command.queue.failed' => \Illuminate\Queue\Console\ListFailedCommand::class, + 'command.queue.failed-table' => \Illuminate\Queue\Console\FailedTableCommand::class, + 'command.queue.flush' => \Illuminate\Queue\Console\FlushFailedCommand::class, + 'command.queue.forget' => \Illuminate\Queue\Console\ForgetFailedCommand::class, + 'command.queue.listen' => \Illuminate\Queue\Console\ListenCommand::class, + 'command.queue.monitor' => \Illuminate\Queue\Console\MonitorCommand::class, + 'command.queue.prune-batches' => \Illuminate\Queue\Console\PruneBatchesCommand::class, + 'command.queue.prune-failed-jobs' => \Illuminate\Queue\Console\PruneFailedJobsCommand::class, + 'command.queue.restart' => \Illuminate\Queue\Console\RestartCommand::class, + 'command.queue.retry' => \Illuminate\Queue\Console\RetryCommand::class, + 'command.queue.retry-batch' => \Illuminate\Queue\Console\RetryBatchCommand::class, + 'command.queue.table' => \Illuminate\Queue\Console\TableCommand::class, + 'command.queue.work' => \Illuminate\Queue\Console\WorkCommand::class, + 'command.request.make' => \Illuminate\Foundation\Console\RequestMakeCommand::class, + 'command.resource.make' => \Illuminate\Foundation\Console\ResourceMakeCommand::class, + 'command.route.cache' => \Illuminate\Foundation\Console\RouteCacheCommand::class, + 'command.route.clear' => \Illuminate\Foundation\Console\RouteClearCommand::class, + 'command.route.list' => \Illuminate\Foundation\Console\RouteListCommand::class, + 'command.rule.make' => \Illuminate\Foundation\Console\RuleMakeCommand::class, + 'command.schema.dump' => \Illuminate\Database\Console\DumpCommand::class, + 'command.seed' => \Illuminate\Database\Console\Seeds\SeedCommand::class, + 'command.seeder.make' => \Illuminate\Database\Console\Seeds\SeederMakeCommand::class, + 'command.serve' => \Illuminate\Foundation\Console\ServeCommand::class, + 'command.session.table' => \Illuminate\Session\Console\SessionTableCommand::class, + 'command.storage.link' => \Illuminate\Foundation\Console\StorageLinkCommand::class, + 'command.stub.publish' => \Illuminate\Foundation\Console\StubPublishCommand::class, + 'command.test.make' => \Illuminate\Foundation\Console\TestMakeCommand::class, + 'command.tinker' => \Laravel\Tinker\Console\TinkerCommand::class, + 'command.up' => \Illuminate\Foundation\Console\UpCommand::class, + 'command.vendor.publish' => \Illuminate\Foundation\Console\VendorPublishCommand::class, + 'command.view.cache' => \Illuminate\Foundation\Console\ViewCacheCommand::class, + 'command.view.clear' => \Illuminate\Foundation\Console\ViewClearCommand::class, + 'composer' => \Illuminate\Support\Composer::class, + 'cookie' => \Illuminate\Cookie\CookieJar::class, + 'db' => \Illuminate\Database\DatabaseManager::class, + 'db.connection' => \Illuminate\Database\SQLiteConnection::class, + 'db.factory' => \Illuminate\Database\Connectors\ConnectionFactory::class, + 'db.transactions' => \Illuminate\Database\DatabaseTransactionsManager::class, + 'encrypter' => \Illuminate\Encryption\Encrypter::class, + 'events' => \Illuminate\Events\Dispatcher::class, + 'files' => \Illuminate\Filesystem\Filesystem::class, + 'filesystem' => \Illuminate\Filesystem\FilesystemManager::class, + 'filesystem.disk' => \Illuminate\Filesystem\FilesystemAdapter::class, + 'flare.http' => \Facade\FlareClient\Http\Client::class, + 'flare.logger' => \Monolog\Logger::class, + 'form' => \Collective\Html\FormBuilder::class, + 'github' => \GrahamCampbell\GitHub\GitHubManager::class, + 'github.authfactory' => \GrahamCampbell\GitHub\Auth\AuthenticatorFactory::class, + 'github.cachefactory' => \GrahamCampbell\GitHub\Cache\ConnectionFactory::class, + 'github.factory' => \GrahamCampbell\GitHub\GitHubFactory::class, + 'hash' => \Illuminate\Hashing\HashManager::class, + 'hash.driver' => \Illuminate\Hashing\BcryptHasher::class, + 'html' => \Collective\Html\HtmlBuilder::class, + 'log' => \Illuminate\Log\LogManager::class, + 'mail.manager' => \Illuminate\Mail\MailManager::class, + 'mailer' => \Illuminate\Mail\Mailer::class, + 'memcached.connector' => \Illuminate\Cache\MemcachedConnector::class, + 'migration.creator' => \Illuminate\Database\Migrations\MigrationCreator::class, + 'migration.repository' => \Illuminate\Database\Migrations\DatabaseMigrationRepository::class, + 'migrator' => \Illuminate\Database\Migrations\Migrator::class, + 'queue' => \Illuminate\Queue\QueueManager::class, + 'queue.connection' => \Illuminate\Queue\SyncQueue::class, + 'queue.failer' => \Illuminate\Queue\Failed\DatabaseFailedJobProvider::class, + 'queue.listener' => \Illuminate\Queue\Listener::class, + 'queue.worker' => \Illuminate\Queue\Worker::class, + 'redirect' => \Illuminate\Routing\Redirector::class, + 'redis' => \Illuminate\Redis\RedisManager::class, + 'router' => \Illuminate\Routing\Router::class, + 'session' => \Illuminate\Session\SessionManager::class, + 'session.store' => \Illuminate\Session\Store::class, + 'settings' => \App\Setting::class, + 'translation.loader' => \Illuminate\Translation\FileLoader::class, + 'translator' => \Illuminate\Translation\Translator::class, + 'url' => \Illuminate\Routing\UrlGenerator::class, + 'validation.presence' => \Illuminate\Validation\DatabasePresenceVerifier::class, + 'view' => \Illuminate\View\Factory::class, + 'view.engine.resolver' => \Illuminate\View\Engines\EngineResolver::class, + 'view.finder' => \Illuminate\View\FileViewFinder::class, + ])); + override(\App::get(0), map([ + '' => '@', + 'Facade\FlareClient\Flare' => \Facade\FlareClient\Flare::class, + 'Facade\IgnitionContracts\SolutionProviderRepository' => \Facade\Ignition\SolutionProviders\SolutionProviderRepository::class, + 'Facade\Ignition\DumpRecorder\DumpRecorder' => \Facade\Ignition\DumpRecorder\DumpRecorder::class, + 'Facade\Ignition\DumpRecorder\MultiDumpHandler' => \Facade\Ignition\DumpRecorder\MultiDumpHandler::class, + 'Facade\Ignition\ErrorPage\Renderer' => \Facade\Ignition\ErrorPage\Renderer::class, + 'Facade\Ignition\IgnitionConfig' => \Facade\Ignition\IgnitionConfig::class, + 'Facade\Ignition\JobRecorder\JobRecorder' => \Facade\Ignition\JobRecorder\JobRecorder::class, + 'Facade\Ignition\LogRecorder\LogRecorder' => \Facade\Ignition\LogRecorder\LogRecorder::class, + 'Facade\Ignition\QueryRecorder\QueryRecorder' => \Facade\Ignition\QueryRecorder\QueryRecorder::class, + 'Facade\Ignition\Support\SentReports' => \Facade\Ignition\Support\SentReports::class, + 'Illuminate\Auth\Middleware\RequirePassword' => \Illuminate\Auth\Middleware\RequirePassword::class, + 'Illuminate\Broadcasting\BroadcastManager' => \Illuminate\Broadcasting\BroadcastManager::class, + 'Illuminate\Bus\BatchRepository' => \Illuminate\Bus\DatabaseBatchRepository::class, + 'Illuminate\Bus\DatabaseBatchRepository' => \Illuminate\Bus\DatabaseBatchRepository::class, + 'Illuminate\Bus\Dispatcher' => \Illuminate\Bus\Dispatcher::class, + 'Illuminate\Cache\RateLimiter' => \Illuminate\Cache\RateLimiter::class, + 'Illuminate\Console\Scheduling\Schedule' => \Illuminate\Console\Scheduling\Schedule::class, + 'Illuminate\Console\Scheduling\ScheduleClearCacheCommand' => \Illuminate\Console\Scheduling\ScheduleClearCacheCommand::class, + 'Illuminate\Console\Scheduling\ScheduleFinishCommand' => \Illuminate\Console\Scheduling\ScheduleFinishCommand::class, + 'Illuminate\Console\Scheduling\ScheduleListCommand' => \Illuminate\Console\Scheduling\ScheduleListCommand::class, + 'Illuminate\Console\Scheduling\ScheduleRunCommand' => \Illuminate\Console\Scheduling\ScheduleRunCommand::class, + 'Illuminate\Console\Scheduling\ScheduleTestCommand' => \Illuminate\Console\Scheduling\ScheduleTestCommand::class, + 'Illuminate\Console\Scheduling\ScheduleWorkCommand' => \Illuminate\Console\Scheduling\ScheduleWorkCommand::class, + 'Illuminate\Contracts\Auth\Access\Gate' => \Illuminate\Auth\Access\Gate::class, + 'Illuminate\Contracts\Broadcasting\Broadcaster' => \Illuminate\Broadcasting\Broadcasters\LogBroadcaster::class, + 'Illuminate\Contracts\Console\Kernel' => \App\Console\Kernel::class, + 'Illuminate\Contracts\Debug\ExceptionHandler' => \NunoMaduro\Collision\Adapters\Laravel\ExceptionHandler::class, + 'Illuminate\Contracts\Http\Kernel' => \App\Http\Kernel::class, + 'Illuminate\Contracts\Pipeline\Hub' => \Illuminate\Pipeline\Hub::class, + 'Illuminate\Contracts\Queue\EntityResolver' => \Illuminate\Database\Eloquent\QueueEntityResolver::class, + 'Illuminate\Contracts\Routing\ResponseFactory' => \Illuminate\Routing\ResponseFactory::class, + 'Illuminate\Contracts\Validation\UncompromisedVerifier' => \Illuminate\Validation\NotPwnedVerifier::class, + 'Illuminate\Database\Console\DbCommand' => \Illuminate\Database\Console\DbCommand::class, + 'Illuminate\Foundation\Mix' => \Illuminate\Foundation\Mix::class, + 'Illuminate\Foundation\PackageManifest' => \Illuminate\Foundation\PackageManifest::class, + 'Illuminate\Mail\Markdown' => \Illuminate\Mail\Markdown::class, + 'Illuminate\Notifications\ChannelManager' => \Illuminate\Notifications\ChannelManager::class, + 'Illuminate\Routing\Contracts\ControllerDispatcher' => \Illuminate\Routing\ControllerDispatcher::class, + 'Illuminate\Session\Middleware\StartSession' => \Illuminate\Session\Middleware\StartSession::class, + 'Illuminate\Testing\ParallelTesting' => \Illuminate\Testing\ParallelTesting::class, + 'NunoMaduro\Collision\Contracts\Provider' => \NunoMaduro\Collision\Provider::class, + 'Whoops\Handler\HandlerInterface' => \Facade\Ignition\ErrorPage\IgnitionWhoopsHandler::class, + 'auth' => \Illuminate\Auth\AuthManager::class, + 'auth.driver' => \Illuminate\Auth\SessionGuard::class, + 'auth.password' => \Illuminate\Auth\Passwords\PasswordBrokerManager::class, + 'auth.password.broker' => \Illuminate\Auth\Passwords\PasswordBroker::class, + 'blade.compiler' => \Illuminate\View\Compilers\BladeCompiler::class, + 'cache' => \Illuminate\Cache\CacheManager::class, + 'cache.psr6' => \Symfony\Component\Cache\Adapter\Psr16Adapter::class, + 'cache.store' => \Illuminate\Cache\Repository::class, + 'command.auth.resets.clear' => \Illuminate\Auth\Console\ClearResetsCommand::class, + 'command.cache.clear' => \Illuminate\Cache\Console\ClearCommand::class, + 'command.cache.forget' => \Illuminate\Cache\Console\ForgetCommand::class, + 'command.cache.table' => \Illuminate\Cache\Console\CacheTableCommand::class, + 'command.cast.make' => \Illuminate\Foundation\Console\CastMakeCommand::class, + 'command.channel.make' => \Illuminate\Foundation\Console\ChannelMakeCommand::class, + 'command.clear-compiled' => \Illuminate\Foundation\Console\ClearCompiledCommand::class, + 'command.component.make' => \Illuminate\Foundation\Console\ComponentMakeCommand::class, + 'command.config.cache' => \Illuminate\Foundation\Console\ConfigCacheCommand::class, + 'command.config.clear' => \Illuminate\Foundation\Console\ConfigClearCommand::class, + 'command.console.make' => \Illuminate\Foundation\Console\ConsoleMakeCommand::class, + 'command.controller.make' => \Illuminate\Routing\Console\ControllerMakeCommand::class, + 'command.db.prune' => \Illuminate\Database\Console\PruneCommand::class, + 'command.db.wipe' => \Illuminate\Database\Console\WipeCommand::class, + 'command.down' => \Illuminate\Foundation\Console\DownCommand::class, + 'command.environment' => \Illuminate\Foundation\Console\EnvironmentCommand::class, + 'command.event.cache' => \Illuminate\Foundation\Console\EventCacheCommand::class, + 'command.event.clear' => \Illuminate\Foundation\Console\EventClearCommand::class, + 'command.event.generate' => \Illuminate\Foundation\Console\EventGenerateCommand::class, + 'command.event.list' => \Illuminate\Foundation\Console\EventListCommand::class, + 'command.event.make' => \Illuminate\Foundation\Console\EventMakeCommand::class, + 'command.exception.make' => \Illuminate\Foundation\Console\ExceptionMakeCommand::class, + 'command.factory.make' => \Illuminate\Database\Console\Factories\FactoryMakeCommand::class, + 'command.flare:test' => \Facade\Ignition\Commands\TestCommand::class, + 'command.ide-helper.eloquent' => \Barryvdh\LaravelIdeHelper\Console\EloquentCommand::class, + 'command.ide-helper.generate' => \Barryvdh\LaravelIdeHelper\Console\GeneratorCommand::class, + 'command.ide-helper.meta' => \Barryvdh\LaravelIdeHelper\Console\MetaCommand::class, + 'command.ide-helper.models' => \Barryvdh\LaravelIdeHelper\Console\ModelsCommand::class, + 'command.job.make' => \Illuminate\Foundation\Console\JobMakeCommand::class, + 'command.key.generate' => \Illuminate\Foundation\Console\KeyGenerateCommand::class, + 'command.listener.make' => \Illuminate\Foundation\Console\ListenerMakeCommand::class, + 'command.mail.make' => \Illuminate\Foundation\Console\MailMakeCommand::class, + 'command.make:solution' => \Facade\Ignition\Commands\SolutionMakeCommand::class, + 'command.make:solution-provider' => \Facade\Ignition\Commands\SolutionProviderMakeCommand::class, + 'command.middleware.make' => \Illuminate\Routing\Console\MiddlewareMakeCommand::class, + 'command.migrate' => \Illuminate\Database\Console\Migrations\MigrateCommand::class, + 'command.migrate.fresh' => \Illuminate\Database\Console\Migrations\FreshCommand::class, + 'command.migrate.install' => \Illuminate\Database\Console\Migrations\InstallCommand::class, + 'command.migrate.make' => \Illuminate\Database\Console\Migrations\MigrateMakeCommand::class, + 'command.migrate.refresh' => \Illuminate\Database\Console\Migrations\RefreshCommand::class, + 'command.migrate.reset' => \Illuminate\Database\Console\Migrations\ResetCommand::class, + 'command.migrate.rollback' => \Illuminate\Database\Console\Migrations\RollbackCommand::class, + 'command.migrate.status' => \Illuminate\Database\Console\Migrations\StatusCommand::class, + 'command.model.make' => \Illuminate\Foundation\Console\ModelMakeCommand::class, + 'command.notification.make' => \Illuminate\Foundation\Console\NotificationMakeCommand::class, + 'command.notification.table' => \Illuminate\Notifications\Console\NotificationTableCommand::class, + 'command.observer.make' => \Illuminate\Foundation\Console\ObserverMakeCommand::class, + 'command.optimize' => \Illuminate\Foundation\Console\OptimizeCommand::class, + 'command.optimize.clear' => \Illuminate\Foundation\Console\OptimizeClearCommand::class, + 'command.package.discover' => \Illuminate\Foundation\Console\PackageDiscoverCommand::class, + 'command.policy.make' => \Illuminate\Foundation\Console\PolicyMakeCommand::class, + 'command.provider.make' => \Illuminate\Foundation\Console\ProviderMakeCommand::class, + 'command.queue.batches-table' => \Illuminate\Queue\Console\BatchesTableCommand::class, + 'command.queue.clear' => \Illuminate\Queue\Console\ClearCommand::class, + 'command.queue.failed' => \Illuminate\Queue\Console\ListFailedCommand::class, + 'command.queue.failed-table' => \Illuminate\Queue\Console\FailedTableCommand::class, + 'command.queue.flush' => \Illuminate\Queue\Console\FlushFailedCommand::class, + 'command.queue.forget' => \Illuminate\Queue\Console\ForgetFailedCommand::class, + 'command.queue.listen' => \Illuminate\Queue\Console\ListenCommand::class, + 'command.queue.monitor' => \Illuminate\Queue\Console\MonitorCommand::class, + 'command.queue.prune-batches' => \Illuminate\Queue\Console\PruneBatchesCommand::class, + 'command.queue.prune-failed-jobs' => \Illuminate\Queue\Console\PruneFailedJobsCommand::class, + 'command.queue.restart' => \Illuminate\Queue\Console\RestartCommand::class, + 'command.queue.retry' => \Illuminate\Queue\Console\RetryCommand::class, + 'command.queue.retry-batch' => \Illuminate\Queue\Console\RetryBatchCommand::class, + 'command.queue.table' => \Illuminate\Queue\Console\TableCommand::class, + 'command.queue.work' => \Illuminate\Queue\Console\WorkCommand::class, + 'command.request.make' => \Illuminate\Foundation\Console\RequestMakeCommand::class, + 'command.resource.make' => \Illuminate\Foundation\Console\ResourceMakeCommand::class, + 'command.route.cache' => \Illuminate\Foundation\Console\RouteCacheCommand::class, + 'command.route.clear' => \Illuminate\Foundation\Console\RouteClearCommand::class, + 'command.route.list' => \Illuminate\Foundation\Console\RouteListCommand::class, + 'command.rule.make' => \Illuminate\Foundation\Console\RuleMakeCommand::class, + 'command.schema.dump' => \Illuminate\Database\Console\DumpCommand::class, + 'command.seed' => \Illuminate\Database\Console\Seeds\SeedCommand::class, + 'command.seeder.make' => \Illuminate\Database\Console\Seeds\SeederMakeCommand::class, + 'command.serve' => \Illuminate\Foundation\Console\ServeCommand::class, + 'command.session.table' => \Illuminate\Session\Console\SessionTableCommand::class, + 'command.storage.link' => \Illuminate\Foundation\Console\StorageLinkCommand::class, + 'command.stub.publish' => \Illuminate\Foundation\Console\StubPublishCommand::class, + 'command.test.make' => \Illuminate\Foundation\Console\TestMakeCommand::class, + 'command.tinker' => \Laravel\Tinker\Console\TinkerCommand::class, + 'command.up' => \Illuminate\Foundation\Console\UpCommand::class, + 'command.vendor.publish' => \Illuminate\Foundation\Console\VendorPublishCommand::class, + 'command.view.cache' => \Illuminate\Foundation\Console\ViewCacheCommand::class, + 'command.view.clear' => \Illuminate\Foundation\Console\ViewClearCommand::class, + 'composer' => \Illuminate\Support\Composer::class, + 'cookie' => \Illuminate\Cookie\CookieJar::class, + 'db' => \Illuminate\Database\DatabaseManager::class, + 'db.connection' => \Illuminate\Database\SQLiteConnection::class, + 'db.factory' => \Illuminate\Database\Connectors\ConnectionFactory::class, + 'db.transactions' => \Illuminate\Database\DatabaseTransactionsManager::class, + 'encrypter' => \Illuminate\Encryption\Encrypter::class, + 'events' => \Illuminate\Events\Dispatcher::class, + 'files' => \Illuminate\Filesystem\Filesystem::class, + 'filesystem' => \Illuminate\Filesystem\FilesystemManager::class, + 'filesystem.disk' => \Illuminate\Filesystem\FilesystemAdapter::class, + 'flare.http' => \Facade\FlareClient\Http\Client::class, + 'flare.logger' => \Monolog\Logger::class, + 'form' => \Collective\Html\FormBuilder::class, + 'github' => \GrahamCampbell\GitHub\GitHubManager::class, + 'github.authfactory' => \GrahamCampbell\GitHub\Auth\AuthenticatorFactory::class, + 'github.cachefactory' => \GrahamCampbell\GitHub\Cache\ConnectionFactory::class, + 'github.factory' => \GrahamCampbell\GitHub\GitHubFactory::class, + 'hash' => \Illuminate\Hashing\HashManager::class, + 'hash.driver' => \Illuminate\Hashing\BcryptHasher::class, + 'html' => \Collective\Html\HtmlBuilder::class, + 'log' => \Illuminate\Log\LogManager::class, + 'mail.manager' => \Illuminate\Mail\MailManager::class, + 'mailer' => \Illuminate\Mail\Mailer::class, + 'memcached.connector' => \Illuminate\Cache\MemcachedConnector::class, + 'migration.creator' => \Illuminate\Database\Migrations\MigrationCreator::class, + 'migration.repository' => \Illuminate\Database\Migrations\DatabaseMigrationRepository::class, + 'migrator' => \Illuminate\Database\Migrations\Migrator::class, + 'queue' => \Illuminate\Queue\QueueManager::class, + 'queue.connection' => \Illuminate\Queue\SyncQueue::class, + 'queue.failer' => \Illuminate\Queue\Failed\DatabaseFailedJobProvider::class, + 'queue.listener' => \Illuminate\Queue\Listener::class, + 'queue.worker' => \Illuminate\Queue\Worker::class, + 'redirect' => \Illuminate\Routing\Redirector::class, + 'redis' => \Illuminate\Redis\RedisManager::class, + 'router' => \Illuminate\Routing\Router::class, + 'session' => \Illuminate\Session\SessionManager::class, + 'session.store' => \Illuminate\Session\Store::class, + 'settings' => \App\Setting::class, + 'translation.loader' => \Illuminate\Translation\FileLoader::class, + 'translator' => \Illuminate\Translation\Translator::class, + 'url' => \Illuminate\Routing\UrlGenerator::class, + 'validation.presence' => \Illuminate\Validation\DatabasePresenceVerifier::class, + 'view' => \Illuminate\View\Factory::class, + 'view.engine.resolver' => \Illuminate\View\Engines\EngineResolver::class, + 'view.finder' => \Illuminate\View\FileViewFinder::class, + ])); + override(\App::make(0), map([ + '' => '@', + 'Facade\FlareClient\Flare' => \Facade\FlareClient\Flare::class, + 'Facade\IgnitionContracts\SolutionProviderRepository' => \Facade\Ignition\SolutionProviders\SolutionProviderRepository::class, + 'Facade\Ignition\DumpRecorder\DumpRecorder' => \Facade\Ignition\DumpRecorder\DumpRecorder::class, + 'Facade\Ignition\DumpRecorder\MultiDumpHandler' => \Facade\Ignition\DumpRecorder\MultiDumpHandler::class, + 'Facade\Ignition\ErrorPage\Renderer' => \Facade\Ignition\ErrorPage\Renderer::class, + 'Facade\Ignition\IgnitionConfig' => \Facade\Ignition\IgnitionConfig::class, + 'Facade\Ignition\JobRecorder\JobRecorder' => \Facade\Ignition\JobRecorder\JobRecorder::class, + 'Facade\Ignition\LogRecorder\LogRecorder' => \Facade\Ignition\LogRecorder\LogRecorder::class, + 'Facade\Ignition\QueryRecorder\QueryRecorder' => \Facade\Ignition\QueryRecorder\QueryRecorder::class, + 'Facade\Ignition\Support\SentReports' => \Facade\Ignition\Support\SentReports::class, + 'Illuminate\Auth\Middleware\RequirePassword' => \Illuminate\Auth\Middleware\RequirePassword::class, + 'Illuminate\Broadcasting\BroadcastManager' => \Illuminate\Broadcasting\BroadcastManager::class, + 'Illuminate\Bus\BatchRepository' => \Illuminate\Bus\DatabaseBatchRepository::class, + 'Illuminate\Bus\DatabaseBatchRepository' => \Illuminate\Bus\DatabaseBatchRepository::class, + 'Illuminate\Bus\Dispatcher' => \Illuminate\Bus\Dispatcher::class, + 'Illuminate\Cache\RateLimiter' => \Illuminate\Cache\RateLimiter::class, + 'Illuminate\Console\Scheduling\Schedule' => \Illuminate\Console\Scheduling\Schedule::class, + 'Illuminate\Console\Scheduling\ScheduleClearCacheCommand' => \Illuminate\Console\Scheduling\ScheduleClearCacheCommand::class, + 'Illuminate\Console\Scheduling\ScheduleFinishCommand' => \Illuminate\Console\Scheduling\ScheduleFinishCommand::class, + 'Illuminate\Console\Scheduling\ScheduleListCommand' => \Illuminate\Console\Scheduling\ScheduleListCommand::class, + 'Illuminate\Console\Scheduling\ScheduleRunCommand' => \Illuminate\Console\Scheduling\ScheduleRunCommand::class, + 'Illuminate\Console\Scheduling\ScheduleTestCommand' => \Illuminate\Console\Scheduling\ScheduleTestCommand::class, + 'Illuminate\Console\Scheduling\ScheduleWorkCommand' => \Illuminate\Console\Scheduling\ScheduleWorkCommand::class, + 'Illuminate\Contracts\Auth\Access\Gate' => \Illuminate\Auth\Access\Gate::class, + 'Illuminate\Contracts\Broadcasting\Broadcaster' => \Illuminate\Broadcasting\Broadcasters\LogBroadcaster::class, + 'Illuminate\Contracts\Console\Kernel' => \App\Console\Kernel::class, + 'Illuminate\Contracts\Debug\ExceptionHandler' => \NunoMaduro\Collision\Adapters\Laravel\ExceptionHandler::class, + 'Illuminate\Contracts\Http\Kernel' => \App\Http\Kernel::class, + 'Illuminate\Contracts\Pipeline\Hub' => \Illuminate\Pipeline\Hub::class, + 'Illuminate\Contracts\Queue\EntityResolver' => \Illuminate\Database\Eloquent\QueueEntityResolver::class, + 'Illuminate\Contracts\Routing\ResponseFactory' => \Illuminate\Routing\ResponseFactory::class, + 'Illuminate\Contracts\Validation\UncompromisedVerifier' => \Illuminate\Validation\NotPwnedVerifier::class, + 'Illuminate\Database\Console\DbCommand' => \Illuminate\Database\Console\DbCommand::class, + 'Illuminate\Foundation\Mix' => \Illuminate\Foundation\Mix::class, + 'Illuminate\Foundation\PackageManifest' => \Illuminate\Foundation\PackageManifest::class, + 'Illuminate\Mail\Markdown' => \Illuminate\Mail\Markdown::class, + 'Illuminate\Notifications\ChannelManager' => \Illuminate\Notifications\ChannelManager::class, + 'Illuminate\Routing\Contracts\ControllerDispatcher' => \Illuminate\Routing\ControllerDispatcher::class, + 'Illuminate\Session\Middleware\StartSession' => \Illuminate\Session\Middleware\StartSession::class, + 'Illuminate\Testing\ParallelTesting' => \Illuminate\Testing\ParallelTesting::class, + 'NunoMaduro\Collision\Contracts\Provider' => \NunoMaduro\Collision\Provider::class, + 'Whoops\Handler\HandlerInterface' => \Facade\Ignition\ErrorPage\IgnitionWhoopsHandler::class, + 'auth' => \Illuminate\Auth\AuthManager::class, + 'auth.driver' => \Illuminate\Auth\SessionGuard::class, + 'auth.password' => \Illuminate\Auth\Passwords\PasswordBrokerManager::class, + 'auth.password.broker' => \Illuminate\Auth\Passwords\PasswordBroker::class, + 'blade.compiler' => \Illuminate\View\Compilers\BladeCompiler::class, + 'cache' => \Illuminate\Cache\CacheManager::class, + 'cache.psr6' => \Symfony\Component\Cache\Adapter\Psr16Adapter::class, + 'cache.store' => \Illuminate\Cache\Repository::class, + 'command.auth.resets.clear' => \Illuminate\Auth\Console\ClearResetsCommand::class, + 'command.cache.clear' => \Illuminate\Cache\Console\ClearCommand::class, + 'command.cache.forget' => \Illuminate\Cache\Console\ForgetCommand::class, + 'command.cache.table' => \Illuminate\Cache\Console\CacheTableCommand::class, + 'command.cast.make' => \Illuminate\Foundation\Console\CastMakeCommand::class, + 'command.channel.make' => \Illuminate\Foundation\Console\ChannelMakeCommand::class, + 'command.clear-compiled' => \Illuminate\Foundation\Console\ClearCompiledCommand::class, + 'command.component.make' => \Illuminate\Foundation\Console\ComponentMakeCommand::class, + 'command.config.cache' => \Illuminate\Foundation\Console\ConfigCacheCommand::class, + 'command.config.clear' => \Illuminate\Foundation\Console\ConfigClearCommand::class, + 'command.console.make' => \Illuminate\Foundation\Console\ConsoleMakeCommand::class, + 'command.controller.make' => \Illuminate\Routing\Console\ControllerMakeCommand::class, + 'command.db.prune' => \Illuminate\Database\Console\PruneCommand::class, + 'command.db.wipe' => \Illuminate\Database\Console\WipeCommand::class, + 'command.down' => \Illuminate\Foundation\Console\DownCommand::class, + 'command.environment' => \Illuminate\Foundation\Console\EnvironmentCommand::class, + 'command.event.cache' => \Illuminate\Foundation\Console\EventCacheCommand::class, + 'command.event.clear' => \Illuminate\Foundation\Console\EventClearCommand::class, + 'command.event.generate' => \Illuminate\Foundation\Console\EventGenerateCommand::class, + 'command.event.list' => \Illuminate\Foundation\Console\EventListCommand::class, + 'command.event.make' => \Illuminate\Foundation\Console\EventMakeCommand::class, + 'command.exception.make' => \Illuminate\Foundation\Console\ExceptionMakeCommand::class, + 'command.factory.make' => \Illuminate\Database\Console\Factories\FactoryMakeCommand::class, + 'command.flare:test' => \Facade\Ignition\Commands\TestCommand::class, + 'command.ide-helper.eloquent' => \Barryvdh\LaravelIdeHelper\Console\EloquentCommand::class, + 'command.ide-helper.generate' => \Barryvdh\LaravelIdeHelper\Console\GeneratorCommand::class, + 'command.ide-helper.meta' => \Barryvdh\LaravelIdeHelper\Console\MetaCommand::class, + 'command.ide-helper.models' => \Barryvdh\LaravelIdeHelper\Console\ModelsCommand::class, + 'command.job.make' => \Illuminate\Foundation\Console\JobMakeCommand::class, + 'command.key.generate' => \Illuminate\Foundation\Console\KeyGenerateCommand::class, + 'command.listener.make' => \Illuminate\Foundation\Console\ListenerMakeCommand::class, + 'command.mail.make' => \Illuminate\Foundation\Console\MailMakeCommand::class, + 'command.make:solution' => \Facade\Ignition\Commands\SolutionMakeCommand::class, + 'command.make:solution-provider' => \Facade\Ignition\Commands\SolutionProviderMakeCommand::class, + 'command.middleware.make' => \Illuminate\Routing\Console\MiddlewareMakeCommand::class, + 'command.migrate' => \Illuminate\Database\Console\Migrations\MigrateCommand::class, + 'command.migrate.fresh' => \Illuminate\Database\Console\Migrations\FreshCommand::class, + 'command.migrate.install' => \Illuminate\Database\Console\Migrations\InstallCommand::class, + 'command.migrate.make' => \Illuminate\Database\Console\Migrations\MigrateMakeCommand::class, + 'command.migrate.refresh' => \Illuminate\Database\Console\Migrations\RefreshCommand::class, + 'command.migrate.reset' => \Illuminate\Database\Console\Migrations\ResetCommand::class, + 'command.migrate.rollback' => \Illuminate\Database\Console\Migrations\RollbackCommand::class, + 'command.migrate.status' => \Illuminate\Database\Console\Migrations\StatusCommand::class, + 'command.model.make' => \Illuminate\Foundation\Console\ModelMakeCommand::class, + 'command.notification.make' => \Illuminate\Foundation\Console\NotificationMakeCommand::class, + 'command.notification.table' => \Illuminate\Notifications\Console\NotificationTableCommand::class, + 'command.observer.make' => \Illuminate\Foundation\Console\ObserverMakeCommand::class, + 'command.optimize' => \Illuminate\Foundation\Console\OptimizeCommand::class, + 'command.optimize.clear' => \Illuminate\Foundation\Console\OptimizeClearCommand::class, + 'command.package.discover' => \Illuminate\Foundation\Console\PackageDiscoverCommand::class, + 'command.policy.make' => \Illuminate\Foundation\Console\PolicyMakeCommand::class, + 'command.provider.make' => \Illuminate\Foundation\Console\ProviderMakeCommand::class, + 'command.queue.batches-table' => \Illuminate\Queue\Console\BatchesTableCommand::class, + 'command.queue.clear' => \Illuminate\Queue\Console\ClearCommand::class, + 'command.queue.failed' => \Illuminate\Queue\Console\ListFailedCommand::class, + 'command.queue.failed-table' => \Illuminate\Queue\Console\FailedTableCommand::class, + 'command.queue.flush' => \Illuminate\Queue\Console\FlushFailedCommand::class, + 'command.queue.forget' => \Illuminate\Queue\Console\ForgetFailedCommand::class, + 'command.queue.listen' => \Illuminate\Queue\Console\ListenCommand::class, + 'command.queue.monitor' => \Illuminate\Queue\Console\MonitorCommand::class, + 'command.queue.prune-batches' => \Illuminate\Queue\Console\PruneBatchesCommand::class, + 'command.queue.prune-failed-jobs' => \Illuminate\Queue\Console\PruneFailedJobsCommand::class, + 'command.queue.restart' => \Illuminate\Queue\Console\RestartCommand::class, + 'command.queue.retry' => \Illuminate\Queue\Console\RetryCommand::class, + 'command.queue.retry-batch' => \Illuminate\Queue\Console\RetryBatchCommand::class, + 'command.queue.table' => \Illuminate\Queue\Console\TableCommand::class, + 'command.queue.work' => \Illuminate\Queue\Console\WorkCommand::class, + 'command.request.make' => \Illuminate\Foundation\Console\RequestMakeCommand::class, + 'command.resource.make' => \Illuminate\Foundation\Console\ResourceMakeCommand::class, + 'command.route.cache' => \Illuminate\Foundation\Console\RouteCacheCommand::class, + 'command.route.clear' => \Illuminate\Foundation\Console\RouteClearCommand::class, + 'command.route.list' => \Illuminate\Foundation\Console\RouteListCommand::class, + 'command.rule.make' => \Illuminate\Foundation\Console\RuleMakeCommand::class, + 'command.schema.dump' => \Illuminate\Database\Console\DumpCommand::class, + 'command.seed' => \Illuminate\Database\Console\Seeds\SeedCommand::class, + 'command.seeder.make' => \Illuminate\Database\Console\Seeds\SeederMakeCommand::class, + 'command.serve' => \Illuminate\Foundation\Console\ServeCommand::class, + 'command.session.table' => \Illuminate\Session\Console\SessionTableCommand::class, + 'command.storage.link' => \Illuminate\Foundation\Console\StorageLinkCommand::class, + 'command.stub.publish' => \Illuminate\Foundation\Console\StubPublishCommand::class, + 'command.test.make' => \Illuminate\Foundation\Console\TestMakeCommand::class, + 'command.tinker' => \Laravel\Tinker\Console\TinkerCommand::class, + 'command.up' => \Illuminate\Foundation\Console\UpCommand::class, + 'command.vendor.publish' => \Illuminate\Foundation\Console\VendorPublishCommand::class, + 'command.view.cache' => \Illuminate\Foundation\Console\ViewCacheCommand::class, + 'command.view.clear' => \Illuminate\Foundation\Console\ViewClearCommand::class, + 'composer' => \Illuminate\Support\Composer::class, + 'cookie' => \Illuminate\Cookie\CookieJar::class, + 'db' => \Illuminate\Database\DatabaseManager::class, + 'db.connection' => \Illuminate\Database\SQLiteConnection::class, + 'db.factory' => \Illuminate\Database\Connectors\ConnectionFactory::class, + 'db.transactions' => \Illuminate\Database\DatabaseTransactionsManager::class, + 'encrypter' => \Illuminate\Encryption\Encrypter::class, + 'events' => \Illuminate\Events\Dispatcher::class, + 'files' => \Illuminate\Filesystem\Filesystem::class, + 'filesystem' => \Illuminate\Filesystem\FilesystemManager::class, + 'filesystem.disk' => \Illuminate\Filesystem\FilesystemAdapter::class, + 'flare.http' => \Facade\FlareClient\Http\Client::class, + 'flare.logger' => \Monolog\Logger::class, + 'form' => \Collective\Html\FormBuilder::class, + 'github' => \GrahamCampbell\GitHub\GitHubManager::class, + 'github.authfactory' => \GrahamCampbell\GitHub\Auth\AuthenticatorFactory::class, + 'github.cachefactory' => \GrahamCampbell\GitHub\Cache\ConnectionFactory::class, + 'github.factory' => \GrahamCampbell\GitHub\GitHubFactory::class, + 'hash' => \Illuminate\Hashing\HashManager::class, + 'hash.driver' => \Illuminate\Hashing\BcryptHasher::class, + 'html' => \Collective\Html\HtmlBuilder::class, + 'log' => \Illuminate\Log\LogManager::class, + 'mail.manager' => \Illuminate\Mail\MailManager::class, + 'mailer' => \Illuminate\Mail\Mailer::class, + 'memcached.connector' => \Illuminate\Cache\MemcachedConnector::class, + 'migration.creator' => \Illuminate\Database\Migrations\MigrationCreator::class, + 'migration.repository' => \Illuminate\Database\Migrations\DatabaseMigrationRepository::class, + 'migrator' => \Illuminate\Database\Migrations\Migrator::class, + 'queue' => \Illuminate\Queue\QueueManager::class, + 'queue.connection' => \Illuminate\Queue\SyncQueue::class, + 'queue.failer' => \Illuminate\Queue\Failed\DatabaseFailedJobProvider::class, + 'queue.listener' => \Illuminate\Queue\Listener::class, + 'queue.worker' => \Illuminate\Queue\Worker::class, + 'redirect' => \Illuminate\Routing\Redirector::class, + 'redis' => \Illuminate\Redis\RedisManager::class, + 'router' => \Illuminate\Routing\Router::class, + 'session' => \Illuminate\Session\SessionManager::class, + 'session.store' => \Illuminate\Session\Store::class, + 'settings' => \App\Setting::class, + 'translation.loader' => \Illuminate\Translation\FileLoader::class, + 'translator' => \Illuminate\Translation\Translator::class, + 'url' => \Illuminate\Routing\UrlGenerator::class, + 'validation.presence' => \Illuminate\Validation\DatabasePresenceVerifier::class, + 'view' => \Illuminate\View\Factory::class, + 'view.engine.resolver' => \Illuminate\View\Engines\EngineResolver::class, + 'view.finder' => \Illuminate\View\FileViewFinder::class, + ])); + override(\App::makeWith(0), map([ + '' => '@', + 'Facade\FlareClient\Flare' => \Facade\FlareClient\Flare::class, + 'Facade\IgnitionContracts\SolutionProviderRepository' => \Facade\Ignition\SolutionProviders\SolutionProviderRepository::class, + 'Facade\Ignition\DumpRecorder\DumpRecorder' => \Facade\Ignition\DumpRecorder\DumpRecorder::class, + 'Facade\Ignition\DumpRecorder\MultiDumpHandler' => \Facade\Ignition\DumpRecorder\MultiDumpHandler::class, + 'Facade\Ignition\ErrorPage\Renderer' => \Facade\Ignition\ErrorPage\Renderer::class, + 'Facade\Ignition\IgnitionConfig' => \Facade\Ignition\IgnitionConfig::class, + 'Facade\Ignition\JobRecorder\JobRecorder' => \Facade\Ignition\JobRecorder\JobRecorder::class, + 'Facade\Ignition\LogRecorder\LogRecorder' => \Facade\Ignition\LogRecorder\LogRecorder::class, + 'Facade\Ignition\QueryRecorder\QueryRecorder' => \Facade\Ignition\QueryRecorder\QueryRecorder::class, + 'Facade\Ignition\Support\SentReports' => \Facade\Ignition\Support\SentReports::class, + 'Illuminate\Auth\Middleware\RequirePassword' => \Illuminate\Auth\Middleware\RequirePassword::class, + 'Illuminate\Broadcasting\BroadcastManager' => \Illuminate\Broadcasting\BroadcastManager::class, + 'Illuminate\Bus\BatchRepository' => \Illuminate\Bus\DatabaseBatchRepository::class, + 'Illuminate\Bus\DatabaseBatchRepository' => \Illuminate\Bus\DatabaseBatchRepository::class, + 'Illuminate\Bus\Dispatcher' => \Illuminate\Bus\Dispatcher::class, + 'Illuminate\Cache\RateLimiter' => \Illuminate\Cache\RateLimiter::class, + 'Illuminate\Console\Scheduling\Schedule' => \Illuminate\Console\Scheduling\Schedule::class, + 'Illuminate\Console\Scheduling\ScheduleClearCacheCommand' => \Illuminate\Console\Scheduling\ScheduleClearCacheCommand::class, + 'Illuminate\Console\Scheduling\ScheduleFinishCommand' => \Illuminate\Console\Scheduling\ScheduleFinishCommand::class, + 'Illuminate\Console\Scheduling\ScheduleListCommand' => \Illuminate\Console\Scheduling\ScheduleListCommand::class, + 'Illuminate\Console\Scheduling\ScheduleRunCommand' => \Illuminate\Console\Scheduling\ScheduleRunCommand::class, + 'Illuminate\Console\Scheduling\ScheduleTestCommand' => \Illuminate\Console\Scheduling\ScheduleTestCommand::class, + 'Illuminate\Console\Scheduling\ScheduleWorkCommand' => \Illuminate\Console\Scheduling\ScheduleWorkCommand::class, + 'Illuminate\Contracts\Auth\Access\Gate' => \Illuminate\Auth\Access\Gate::class, + 'Illuminate\Contracts\Broadcasting\Broadcaster' => \Illuminate\Broadcasting\Broadcasters\LogBroadcaster::class, + 'Illuminate\Contracts\Console\Kernel' => \App\Console\Kernel::class, + 'Illuminate\Contracts\Debug\ExceptionHandler' => \NunoMaduro\Collision\Adapters\Laravel\ExceptionHandler::class, + 'Illuminate\Contracts\Http\Kernel' => \App\Http\Kernel::class, + 'Illuminate\Contracts\Pipeline\Hub' => \Illuminate\Pipeline\Hub::class, + 'Illuminate\Contracts\Queue\EntityResolver' => \Illuminate\Database\Eloquent\QueueEntityResolver::class, + 'Illuminate\Contracts\Routing\ResponseFactory' => \Illuminate\Routing\ResponseFactory::class, + 'Illuminate\Contracts\Validation\UncompromisedVerifier' => \Illuminate\Validation\NotPwnedVerifier::class, + 'Illuminate\Database\Console\DbCommand' => \Illuminate\Database\Console\DbCommand::class, + 'Illuminate\Foundation\Mix' => \Illuminate\Foundation\Mix::class, + 'Illuminate\Foundation\PackageManifest' => \Illuminate\Foundation\PackageManifest::class, + 'Illuminate\Mail\Markdown' => \Illuminate\Mail\Markdown::class, + 'Illuminate\Notifications\ChannelManager' => \Illuminate\Notifications\ChannelManager::class, + 'Illuminate\Routing\Contracts\ControllerDispatcher' => \Illuminate\Routing\ControllerDispatcher::class, + 'Illuminate\Session\Middleware\StartSession' => \Illuminate\Session\Middleware\StartSession::class, + 'Illuminate\Testing\ParallelTesting' => \Illuminate\Testing\ParallelTesting::class, + 'NunoMaduro\Collision\Contracts\Provider' => \NunoMaduro\Collision\Provider::class, + 'Whoops\Handler\HandlerInterface' => \Facade\Ignition\ErrorPage\IgnitionWhoopsHandler::class, + 'auth' => \Illuminate\Auth\AuthManager::class, + 'auth.driver' => \Illuminate\Auth\SessionGuard::class, + 'auth.password' => \Illuminate\Auth\Passwords\PasswordBrokerManager::class, + 'auth.password.broker' => \Illuminate\Auth\Passwords\PasswordBroker::class, + 'blade.compiler' => \Illuminate\View\Compilers\BladeCompiler::class, + 'cache' => \Illuminate\Cache\CacheManager::class, + 'cache.psr6' => \Symfony\Component\Cache\Adapter\Psr16Adapter::class, + 'cache.store' => \Illuminate\Cache\Repository::class, + 'command.auth.resets.clear' => \Illuminate\Auth\Console\ClearResetsCommand::class, + 'command.cache.clear' => \Illuminate\Cache\Console\ClearCommand::class, + 'command.cache.forget' => \Illuminate\Cache\Console\ForgetCommand::class, + 'command.cache.table' => \Illuminate\Cache\Console\CacheTableCommand::class, + 'command.cast.make' => \Illuminate\Foundation\Console\CastMakeCommand::class, + 'command.channel.make' => \Illuminate\Foundation\Console\ChannelMakeCommand::class, + 'command.clear-compiled' => \Illuminate\Foundation\Console\ClearCompiledCommand::class, + 'command.component.make' => \Illuminate\Foundation\Console\ComponentMakeCommand::class, + 'command.config.cache' => \Illuminate\Foundation\Console\ConfigCacheCommand::class, + 'command.config.clear' => \Illuminate\Foundation\Console\ConfigClearCommand::class, + 'command.console.make' => \Illuminate\Foundation\Console\ConsoleMakeCommand::class, + 'command.controller.make' => \Illuminate\Routing\Console\ControllerMakeCommand::class, + 'command.db.prune' => \Illuminate\Database\Console\PruneCommand::class, + 'command.db.wipe' => \Illuminate\Database\Console\WipeCommand::class, + 'command.down' => \Illuminate\Foundation\Console\DownCommand::class, + 'command.environment' => \Illuminate\Foundation\Console\EnvironmentCommand::class, + 'command.event.cache' => \Illuminate\Foundation\Console\EventCacheCommand::class, + 'command.event.clear' => \Illuminate\Foundation\Console\EventClearCommand::class, + 'command.event.generate' => \Illuminate\Foundation\Console\EventGenerateCommand::class, + 'command.event.list' => \Illuminate\Foundation\Console\EventListCommand::class, + 'command.event.make' => \Illuminate\Foundation\Console\EventMakeCommand::class, + 'command.exception.make' => \Illuminate\Foundation\Console\ExceptionMakeCommand::class, + 'command.factory.make' => \Illuminate\Database\Console\Factories\FactoryMakeCommand::class, + 'command.flare:test' => \Facade\Ignition\Commands\TestCommand::class, + 'command.ide-helper.eloquent' => \Barryvdh\LaravelIdeHelper\Console\EloquentCommand::class, + 'command.ide-helper.generate' => \Barryvdh\LaravelIdeHelper\Console\GeneratorCommand::class, + 'command.ide-helper.meta' => \Barryvdh\LaravelIdeHelper\Console\MetaCommand::class, + 'command.ide-helper.models' => \Barryvdh\LaravelIdeHelper\Console\ModelsCommand::class, + 'command.job.make' => \Illuminate\Foundation\Console\JobMakeCommand::class, + 'command.key.generate' => \Illuminate\Foundation\Console\KeyGenerateCommand::class, + 'command.listener.make' => \Illuminate\Foundation\Console\ListenerMakeCommand::class, + 'command.mail.make' => \Illuminate\Foundation\Console\MailMakeCommand::class, + 'command.make:solution' => \Facade\Ignition\Commands\SolutionMakeCommand::class, + 'command.make:solution-provider' => \Facade\Ignition\Commands\SolutionProviderMakeCommand::class, + 'command.middleware.make' => \Illuminate\Routing\Console\MiddlewareMakeCommand::class, + 'command.migrate' => \Illuminate\Database\Console\Migrations\MigrateCommand::class, + 'command.migrate.fresh' => \Illuminate\Database\Console\Migrations\FreshCommand::class, + 'command.migrate.install' => \Illuminate\Database\Console\Migrations\InstallCommand::class, + 'command.migrate.make' => \Illuminate\Database\Console\Migrations\MigrateMakeCommand::class, + 'command.migrate.refresh' => \Illuminate\Database\Console\Migrations\RefreshCommand::class, + 'command.migrate.reset' => \Illuminate\Database\Console\Migrations\ResetCommand::class, + 'command.migrate.rollback' => \Illuminate\Database\Console\Migrations\RollbackCommand::class, + 'command.migrate.status' => \Illuminate\Database\Console\Migrations\StatusCommand::class, + 'command.model.make' => \Illuminate\Foundation\Console\ModelMakeCommand::class, + 'command.notification.make' => \Illuminate\Foundation\Console\NotificationMakeCommand::class, + 'command.notification.table' => \Illuminate\Notifications\Console\NotificationTableCommand::class, + 'command.observer.make' => \Illuminate\Foundation\Console\ObserverMakeCommand::class, + 'command.optimize' => \Illuminate\Foundation\Console\OptimizeCommand::class, + 'command.optimize.clear' => \Illuminate\Foundation\Console\OptimizeClearCommand::class, + 'command.package.discover' => \Illuminate\Foundation\Console\PackageDiscoverCommand::class, + 'command.policy.make' => \Illuminate\Foundation\Console\PolicyMakeCommand::class, + 'command.provider.make' => \Illuminate\Foundation\Console\ProviderMakeCommand::class, + 'command.queue.batches-table' => \Illuminate\Queue\Console\BatchesTableCommand::class, + 'command.queue.clear' => \Illuminate\Queue\Console\ClearCommand::class, + 'command.queue.failed' => \Illuminate\Queue\Console\ListFailedCommand::class, + 'command.queue.failed-table' => \Illuminate\Queue\Console\FailedTableCommand::class, + 'command.queue.flush' => \Illuminate\Queue\Console\FlushFailedCommand::class, + 'command.queue.forget' => \Illuminate\Queue\Console\ForgetFailedCommand::class, + 'command.queue.listen' => \Illuminate\Queue\Console\ListenCommand::class, + 'command.queue.monitor' => \Illuminate\Queue\Console\MonitorCommand::class, + 'command.queue.prune-batches' => \Illuminate\Queue\Console\PruneBatchesCommand::class, + 'command.queue.prune-failed-jobs' => \Illuminate\Queue\Console\PruneFailedJobsCommand::class, + 'command.queue.restart' => \Illuminate\Queue\Console\RestartCommand::class, + 'command.queue.retry' => \Illuminate\Queue\Console\RetryCommand::class, + 'command.queue.retry-batch' => \Illuminate\Queue\Console\RetryBatchCommand::class, + 'command.queue.table' => \Illuminate\Queue\Console\TableCommand::class, + 'command.queue.work' => \Illuminate\Queue\Console\WorkCommand::class, + 'command.request.make' => \Illuminate\Foundation\Console\RequestMakeCommand::class, + 'command.resource.make' => \Illuminate\Foundation\Console\ResourceMakeCommand::class, + 'command.route.cache' => \Illuminate\Foundation\Console\RouteCacheCommand::class, + 'command.route.clear' => \Illuminate\Foundation\Console\RouteClearCommand::class, + 'command.route.list' => \Illuminate\Foundation\Console\RouteListCommand::class, + 'command.rule.make' => \Illuminate\Foundation\Console\RuleMakeCommand::class, + 'command.schema.dump' => \Illuminate\Database\Console\DumpCommand::class, + 'command.seed' => \Illuminate\Database\Console\Seeds\SeedCommand::class, + 'command.seeder.make' => \Illuminate\Database\Console\Seeds\SeederMakeCommand::class, + 'command.serve' => \Illuminate\Foundation\Console\ServeCommand::class, + 'command.session.table' => \Illuminate\Session\Console\SessionTableCommand::class, + 'command.storage.link' => \Illuminate\Foundation\Console\StorageLinkCommand::class, + 'command.stub.publish' => \Illuminate\Foundation\Console\StubPublishCommand::class, + 'command.test.make' => \Illuminate\Foundation\Console\TestMakeCommand::class, + 'command.tinker' => \Laravel\Tinker\Console\TinkerCommand::class, + 'command.up' => \Illuminate\Foundation\Console\UpCommand::class, + 'command.vendor.publish' => \Illuminate\Foundation\Console\VendorPublishCommand::class, + 'command.view.cache' => \Illuminate\Foundation\Console\ViewCacheCommand::class, + 'command.view.clear' => \Illuminate\Foundation\Console\ViewClearCommand::class, + 'composer' => \Illuminate\Support\Composer::class, + 'cookie' => \Illuminate\Cookie\CookieJar::class, + 'db' => \Illuminate\Database\DatabaseManager::class, + 'db.connection' => \Illuminate\Database\SQLiteConnection::class, + 'db.factory' => \Illuminate\Database\Connectors\ConnectionFactory::class, + 'db.transactions' => \Illuminate\Database\DatabaseTransactionsManager::class, + 'encrypter' => \Illuminate\Encryption\Encrypter::class, + 'events' => \Illuminate\Events\Dispatcher::class, + 'files' => \Illuminate\Filesystem\Filesystem::class, + 'filesystem' => \Illuminate\Filesystem\FilesystemManager::class, + 'filesystem.disk' => \Illuminate\Filesystem\FilesystemAdapter::class, + 'flare.http' => \Facade\FlareClient\Http\Client::class, + 'flare.logger' => \Monolog\Logger::class, + 'form' => \Collective\Html\FormBuilder::class, + 'github' => \GrahamCampbell\GitHub\GitHubManager::class, + 'github.authfactory' => \GrahamCampbell\GitHub\Auth\AuthenticatorFactory::class, + 'github.cachefactory' => \GrahamCampbell\GitHub\Cache\ConnectionFactory::class, + 'github.factory' => \GrahamCampbell\GitHub\GitHubFactory::class, + 'hash' => \Illuminate\Hashing\HashManager::class, + 'hash.driver' => \Illuminate\Hashing\BcryptHasher::class, + 'html' => \Collective\Html\HtmlBuilder::class, + 'log' => \Illuminate\Log\LogManager::class, + 'mail.manager' => \Illuminate\Mail\MailManager::class, + 'mailer' => \Illuminate\Mail\Mailer::class, + 'memcached.connector' => \Illuminate\Cache\MemcachedConnector::class, + 'migration.creator' => \Illuminate\Database\Migrations\MigrationCreator::class, + 'migration.repository' => \Illuminate\Database\Migrations\DatabaseMigrationRepository::class, + 'migrator' => \Illuminate\Database\Migrations\Migrator::class, + 'queue' => \Illuminate\Queue\QueueManager::class, + 'queue.connection' => \Illuminate\Queue\SyncQueue::class, + 'queue.failer' => \Illuminate\Queue\Failed\DatabaseFailedJobProvider::class, + 'queue.listener' => \Illuminate\Queue\Listener::class, + 'queue.worker' => \Illuminate\Queue\Worker::class, + 'redirect' => \Illuminate\Routing\Redirector::class, + 'redis' => \Illuminate\Redis\RedisManager::class, + 'router' => \Illuminate\Routing\Router::class, + 'session' => \Illuminate\Session\SessionManager::class, + 'session.store' => \Illuminate\Session\Store::class, + 'settings' => \App\Setting::class, + 'translation.loader' => \Illuminate\Translation\FileLoader::class, + 'translator' => \Illuminate\Translation\Translator::class, + 'url' => \Illuminate\Routing\UrlGenerator::class, + 'validation.presence' => \Illuminate\Validation\DatabasePresenceVerifier::class, + 'view' => \Illuminate\View\Factory::class, + 'view.engine.resolver' => \Illuminate\View\Engines\EngineResolver::class, + 'view.finder' => \Illuminate\View\FileViewFinder::class, + ])); + override(\app(0), map([ + '' => '@', + 'Facade\FlareClient\Flare' => \Facade\FlareClient\Flare::class, + 'Facade\IgnitionContracts\SolutionProviderRepository' => \Facade\Ignition\SolutionProviders\SolutionProviderRepository::class, + 'Facade\Ignition\DumpRecorder\DumpRecorder' => \Facade\Ignition\DumpRecorder\DumpRecorder::class, + 'Facade\Ignition\DumpRecorder\MultiDumpHandler' => \Facade\Ignition\DumpRecorder\MultiDumpHandler::class, + 'Facade\Ignition\ErrorPage\Renderer' => \Facade\Ignition\ErrorPage\Renderer::class, + 'Facade\Ignition\IgnitionConfig' => \Facade\Ignition\IgnitionConfig::class, + 'Facade\Ignition\JobRecorder\JobRecorder' => \Facade\Ignition\JobRecorder\JobRecorder::class, + 'Facade\Ignition\LogRecorder\LogRecorder' => \Facade\Ignition\LogRecorder\LogRecorder::class, + 'Facade\Ignition\QueryRecorder\QueryRecorder' => \Facade\Ignition\QueryRecorder\QueryRecorder::class, + 'Facade\Ignition\Support\SentReports' => \Facade\Ignition\Support\SentReports::class, + 'Illuminate\Auth\Middleware\RequirePassword' => \Illuminate\Auth\Middleware\RequirePassword::class, + 'Illuminate\Broadcasting\BroadcastManager' => \Illuminate\Broadcasting\BroadcastManager::class, + 'Illuminate\Bus\BatchRepository' => \Illuminate\Bus\DatabaseBatchRepository::class, + 'Illuminate\Bus\DatabaseBatchRepository' => \Illuminate\Bus\DatabaseBatchRepository::class, + 'Illuminate\Bus\Dispatcher' => \Illuminate\Bus\Dispatcher::class, + 'Illuminate\Cache\RateLimiter' => \Illuminate\Cache\RateLimiter::class, + 'Illuminate\Console\Scheduling\Schedule' => \Illuminate\Console\Scheduling\Schedule::class, + 'Illuminate\Console\Scheduling\ScheduleClearCacheCommand' => \Illuminate\Console\Scheduling\ScheduleClearCacheCommand::class, + 'Illuminate\Console\Scheduling\ScheduleFinishCommand' => \Illuminate\Console\Scheduling\ScheduleFinishCommand::class, + 'Illuminate\Console\Scheduling\ScheduleListCommand' => \Illuminate\Console\Scheduling\ScheduleListCommand::class, + 'Illuminate\Console\Scheduling\ScheduleRunCommand' => \Illuminate\Console\Scheduling\ScheduleRunCommand::class, + 'Illuminate\Console\Scheduling\ScheduleTestCommand' => \Illuminate\Console\Scheduling\ScheduleTestCommand::class, + 'Illuminate\Console\Scheduling\ScheduleWorkCommand' => \Illuminate\Console\Scheduling\ScheduleWorkCommand::class, + 'Illuminate\Contracts\Auth\Access\Gate' => \Illuminate\Auth\Access\Gate::class, + 'Illuminate\Contracts\Broadcasting\Broadcaster' => \Illuminate\Broadcasting\Broadcasters\LogBroadcaster::class, + 'Illuminate\Contracts\Console\Kernel' => \App\Console\Kernel::class, + 'Illuminate\Contracts\Debug\ExceptionHandler' => \NunoMaduro\Collision\Adapters\Laravel\ExceptionHandler::class, + 'Illuminate\Contracts\Http\Kernel' => \App\Http\Kernel::class, + 'Illuminate\Contracts\Pipeline\Hub' => \Illuminate\Pipeline\Hub::class, + 'Illuminate\Contracts\Queue\EntityResolver' => \Illuminate\Database\Eloquent\QueueEntityResolver::class, + 'Illuminate\Contracts\Routing\ResponseFactory' => \Illuminate\Routing\ResponseFactory::class, + 'Illuminate\Contracts\Validation\UncompromisedVerifier' => \Illuminate\Validation\NotPwnedVerifier::class, + 'Illuminate\Database\Console\DbCommand' => \Illuminate\Database\Console\DbCommand::class, + 'Illuminate\Foundation\Mix' => \Illuminate\Foundation\Mix::class, + 'Illuminate\Foundation\PackageManifest' => \Illuminate\Foundation\PackageManifest::class, + 'Illuminate\Mail\Markdown' => \Illuminate\Mail\Markdown::class, + 'Illuminate\Notifications\ChannelManager' => \Illuminate\Notifications\ChannelManager::class, + 'Illuminate\Routing\Contracts\ControllerDispatcher' => \Illuminate\Routing\ControllerDispatcher::class, + 'Illuminate\Session\Middleware\StartSession' => \Illuminate\Session\Middleware\StartSession::class, + 'Illuminate\Testing\ParallelTesting' => \Illuminate\Testing\ParallelTesting::class, + 'NunoMaduro\Collision\Contracts\Provider' => \NunoMaduro\Collision\Provider::class, + 'Whoops\Handler\HandlerInterface' => \Facade\Ignition\ErrorPage\IgnitionWhoopsHandler::class, + 'auth' => \Illuminate\Auth\AuthManager::class, + 'auth.driver' => \Illuminate\Auth\SessionGuard::class, + 'auth.password' => \Illuminate\Auth\Passwords\PasswordBrokerManager::class, + 'auth.password.broker' => \Illuminate\Auth\Passwords\PasswordBroker::class, + 'blade.compiler' => \Illuminate\View\Compilers\BladeCompiler::class, + 'cache' => \Illuminate\Cache\CacheManager::class, + 'cache.psr6' => \Symfony\Component\Cache\Adapter\Psr16Adapter::class, + 'cache.store' => \Illuminate\Cache\Repository::class, + 'command.auth.resets.clear' => \Illuminate\Auth\Console\ClearResetsCommand::class, + 'command.cache.clear' => \Illuminate\Cache\Console\ClearCommand::class, + 'command.cache.forget' => \Illuminate\Cache\Console\ForgetCommand::class, + 'command.cache.table' => \Illuminate\Cache\Console\CacheTableCommand::class, + 'command.cast.make' => \Illuminate\Foundation\Console\CastMakeCommand::class, + 'command.channel.make' => \Illuminate\Foundation\Console\ChannelMakeCommand::class, + 'command.clear-compiled' => \Illuminate\Foundation\Console\ClearCompiledCommand::class, + 'command.component.make' => \Illuminate\Foundation\Console\ComponentMakeCommand::class, + 'command.config.cache' => \Illuminate\Foundation\Console\ConfigCacheCommand::class, + 'command.config.clear' => \Illuminate\Foundation\Console\ConfigClearCommand::class, + 'command.console.make' => \Illuminate\Foundation\Console\ConsoleMakeCommand::class, + 'command.controller.make' => \Illuminate\Routing\Console\ControllerMakeCommand::class, + 'command.db.prune' => \Illuminate\Database\Console\PruneCommand::class, + 'command.db.wipe' => \Illuminate\Database\Console\WipeCommand::class, + 'command.down' => \Illuminate\Foundation\Console\DownCommand::class, + 'command.environment' => \Illuminate\Foundation\Console\EnvironmentCommand::class, + 'command.event.cache' => \Illuminate\Foundation\Console\EventCacheCommand::class, + 'command.event.clear' => \Illuminate\Foundation\Console\EventClearCommand::class, + 'command.event.generate' => \Illuminate\Foundation\Console\EventGenerateCommand::class, + 'command.event.list' => \Illuminate\Foundation\Console\EventListCommand::class, + 'command.event.make' => \Illuminate\Foundation\Console\EventMakeCommand::class, + 'command.exception.make' => \Illuminate\Foundation\Console\ExceptionMakeCommand::class, + 'command.factory.make' => \Illuminate\Database\Console\Factories\FactoryMakeCommand::class, + 'command.flare:test' => \Facade\Ignition\Commands\TestCommand::class, + 'command.ide-helper.eloquent' => \Barryvdh\LaravelIdeHelper\Console\EloquentCommand::class, + 'command.ide-helper.generate' => \Barryvdh\LaravelIdeHelper\Console\GeneratorCommand::class, + 'command.ide-helper.meta' => \Barryvdh\LaravelIdeHelper\Console\MetaCommand::class, + 'command.ide-helper.models' => \Barryvdh\LaravelIdeHelper\Console\ModelsCommand::class, + 'command.job.make' => \Illuminate\Foundation\Console\JobMakeCommand::class, + 'command.key.generate' => \Illuminate\Foundation\Console\KeyGenerateCommand::class, + 'command.listener.make' => \Illuminate\Foundation\Console\ListenerMakeCommand::class, + 'command.mail.make' => \Illuminate\Foundation\Console\MailMakeCommand::class, + 'command.make:solution' => \Facade\Ignition\Commands\SolutionMakeCommand::class, + 'command.make:solution-provider' => \Facade\Ignition\Commands\SolutionProviderMakeCommand::class, + 'command.middleware.make' => \Illuminate\Routing\Console\MiddlewareMakeCommand::class, + 'command.migrate' => \Illuminate\Database\Console\Migrations\MigrateCommand::class, + 'command.migrate.fresh' => \Illuminate\Database\Console\Migrations\FreshCommand::class, + 'command.migrate.install' => \Illuminate\Database\Console\Migrations\InstallCommand::class, + 'command.migrate.make' => \Illuminate\Database\Console\Migrations\MigrateMakeCommand::class, + 'command.migrate.refresh' => \Illuminate\Database\Console\Migrations\RefreshCommand::class, + 'command.migrate.reset' => \Illuminate\Database\Console\Migrations\ResetCommand::class, + 'command.migrate.rollback' => \Illuminate\Database\Console\Migrations\RollbackCommand::class, + 'command.migrate.status' => \Illuminate\Database\Console\Migrations\StatusCommand::class, + 'command.model.make' => \Illuminate\Foundation\Console\ModelMakeCommand::class, + 'command.notification.make' => \Illuminate\Foundation\Console\NotificationMakeCommand::class, + 'command.notification.table' => \Illuminate\Notifications\Console\NotificationTableCommand::class, + 'command.observer.make' => \Illuminate\Foundation\Console\ObserverMakeCommand::class, + 'command.optimize' => \Illuminate\Foundation\Console\OptimizeCommand::class, + 'command.optimize.clear' => \Illuminate\Foundation\Console\OptimizeClearCommand::class, + 'command.package.discover' => \Illuminate\Foundation\Console\PackageDiscoverCommand::class, + 'command.policy.make' => \Illuminate\Foundation\Console\PolicyMakeCommand::class, + 'command.provider.make' => \Illuminate\Foundation\Console\ProviderMakeCommand::class, + 'command.queue.batches-table' => \Illuminate\Queue\Console\BatchesTableCommand::class, + 'command.queue.clear' => \Illuminate\Queue\Console\ClearCommand::class, + 'command.queue.failed' => \Illuminate\Queue\Console\ListFailedCommand::class, + 'command.queue.failed-table' => \Illuminate\Queue\Console\FailedTableCommand::class, + 'command.queue.flush' => \Illuminate\Queue\Console\FlushFailedCommand::class, + 'command.queue.forget' => \Illuminate\Queue\Console\ForgetFailedCommand::class, + 'command.queue.listen' => \Illuminate\Queue\Console\ListenCommand::class, + 'command.queue.monitor' => \Illuminate\Queue\Console\MonitorCommand::class, + 'command.queue.prune-batches' => \Illuminate\Queue\Console\PruneBatchesCommand::class, + 'command.queue.prune-failed-jobs' => \Illuminate\Queue\Console\PruneFailedJobsCommand::class, + 'command.queue.restart' => \Illuminate\Queue\Console\RestartCommand::class, + 'command.queue.retry' => \Illuminate\Queue\Console\RetryCommand::class, + 'command.queue.retry-batch' => \Illuminate\Queue\Console\RetryBatchCommand::class, + 'command.queue.table' => \Illuminate\Queue\Console\TableCommand::class, + 'command.queue.work' => \Illuminate\Queue\Console\WorkCommand::class, + 'command.request.make' => \Illuminate\Foundation\Console\RequestMakeCommand::class, + 'command.resource.make' => \Illuminate\Foundation\Console\ResourceMakeCommand::class, + 'command.route.cache' => \Illuminate\Foundation\Console\RouteCacheCommand::class, + 'command.route.clear' => \Illuminate\Foundation\Console\RouteClearCommand::class, + 'command.route.list' => \Illuminate\Foundation\Console\RouteListCommand::class, + 'command.rule.make' => \Illuminate\Foundation\Console\RuleMakeCommand::class, + 'command.schema.dump' => \Illuminate\Database\Console\DumpCommand::class, + 'command.seed' => \Illuminate\Database\Console\Seeds\SeedCommand::class, + 'command.seeder.make' => \Illuminate\Database\Console\Seeds\SeederMakeCommand::class, + 'command.serve' => \Illuminate\Foundation\Console\ServeCommand::class, + 'command.session.table' => \Illuminate\Session\Console\SessionTableCommand::class, + 'command.storage.link' => \Illuminate\Foundation\Console\StorageLinkCommand::class, + 'command.stub.publish' => \Illuminate\Foundation\Console\StubPublishCommand::class, + 'command.test.make' => \Illuminate\Foundation\Console\TestMakeCommand::class, + 'command.tinker' => \Laravel\Tinker\Console\TinkerCommand::class, + 'command.up' => \Illuminate\Foundation\Console\UpCommand::class, + 'command.vendor.publish' => \Illuminate\Foundation\Console\VendorPublishCommand::class, + 'command.view.cache' => \Illuminate\Foundation\Console\ViewCacheCommand::class, + 'command.view.clear' => \Illuminate\Foundation\Console\ViewClearCommand::class, + 'composer' => \Illuminate\Support\Composer::class, + 'cookie' => \Illuminate\Cookie\CookieJar::class, + 'db' => \Illuminate\Database\DatabaseManager::class, + 'db.connection' => \Illuminate\Database\SQLiteConnection::class, + 'db.factory' => \Illuminate\Database\Connectors\ConnectionFactory::class, + 'db.transactions' => \Illuminate\Database\DatabaseTransactionsManager::class, + 'encrypter' => \Illuminate\Encryption\Encrypter::class, + 'events' => \Illuminate\Events\Dispatcher::class, + 'files' => \Illuminate\Filesystem\Filesystem::class, + 'filesystem' => \Illuminate\Filesystem\FilesystemManager::class, + 'filesystem.disk' => \Illuminate\Filesystem\FilesystemAdapter::class, + 'flare.http' => \Facade\FlareClient\Http\Client::class, + 'flare.logger' => \Monolog\Logger::class, + 'form' => \Collective\Html\FormBuilder::class, + 'github' => \GrahamCampbell\GitHub\GitHubManager::class, + 'github.authfactory' => \GrahamCampbell\GitHub\Auth\AuthenticatorFactory::class, + 'github.cachefactory' => \GrahamCampbell\GitHub\Cache\ConnectionFactory::class, + 'github.factory' => \GrahamCampbell\GitHub\GitHubFactory::class, + 'hash' => \Illuminate\Hashing\HashManager::class, + 'hash.driver' => \Illuminate\Hashing\BcryptHasher::class, + 'html' => \Collective\Html\HtmlBuilder::class, + 'log' => \Illuminate\Log\LogManager::class, + 'mail.manager' => \Illuminate\Mail\MailManager::class, + 'mailer' => \Illuminate\Mail\Mailer::class, + 'memcached.connector' => \Illuminate\Cache\MemcachedConnector::class, + 'migration.creator' => \Illuminate\Database\Migrations\MigrationCreator::class, + 'migration.repository' => \Illuminate\Database\Migrations\DatabaseMigrationRepository::class, + 'migrator' => \Illuminate\Database\Migrations\Migrator::class, + 'queue' => \Illuminate\Queue\QueueManager::class, + 'queue.connection' => \Illuminate\Queue\SyncQueue::class, + 'queue.failer' => \Illuminate\Queue\Failed\DatabaseFailedJobProvider::class, + 'queue.listener' => \Illuminate\Queue\Listener::class, + 'queue.worker' => \Illuminate\Queue\Worker::class, + 'redirect' => \Illuminate\Routing\Redirector::class, + 'redis' => \Illuminate\Redis\RedisManager::class, + 'router' => \Illuminate\Routing\Router::class, + 'session' => \Illuminate\Session\SessionManager::class, + 'session.store' => \Illuminate\Session\Store::class, + 'settings' => \App\Setting::class, + 'translation.loader' => \Illuminate\Translation\FileLoader::class, + 'translator' => \Illuminate\Translation\Translator::class, + 'url' => \Illuminate\Routing\UrlGenerator::class, + 'validation.presence' => \Illuminate\Validation\DatabasePresenceVerifier::class, + 'view' => \Illuminate\View\Factory::class, + 'view.engine.resolver' => \Illuminate\View\Engines\EngineResolver::class, + 'view.finder' => \Illuminate\View\FileViewFinder::class, + ])); + override(\resolve(0), map([ + '' => '@', + 'Facade\FlareClient\Flare' => \Facade\FlareClient\Flare::class, + 'Facade\IgnitionContracts\SolutionProviderRepository' => \Facade\Ignition\SolutionProviders\SolutionProviderRepository::class, + 'Facade\Ignition\DumpRecorder\DumpRecorder' => \Facade\Ignition\DumpRecorder\DumpRecorder::class, + 'Facade\Ignition\DumpRecorder\MultiDumpHandler' => \Facade\Ignition\DumpRecorder\MultiDumpHandler::class, + 'Facade\Ignition\ErrorPage\Renderer' => \Facade\Ignition\ErrorPage\Renderer::class, + 'Facade\Ignition\IgnitionConfig' => \Facade\Ignition\IgnitionConfig::class, + 'Facade\Ignition\JobRecorder\JobRecorder' => \Facade\Ignition\JobRecorder\JobRecorder::class, + 'Facade\Ignition\LogRecorder\LogRecorder' => \Facade\Ignition\LogRecorder\LogRecorder::class, + 'Facade\Ignition\QueryRecorder\QueryRecorder' => \Facade\Ignition\QueryRecorder\QueryRecorder::class, + 'Facade\Ignition\Support\SentReports' => \Facade\Ignition\Support\SentReports::class, + 'Illuminate\Auth\Middleware\RequirePassword' => \Illuminate\Auth\Middleware\RequirePassword::class, + 'Illuminate\Broadcasting\BroadcastManager' => \Illuminate\Broadcasting\BroadcastManager::class, + 'Illuminate\Bus\BatchRepository' => \Illuminate\Bus\DatabaseBatchRepository::class, + 'Illuminate\Bus\DatabaseBatchRepository' => \Illuminate\Bus\DatabaseBatchRepository::class, + 'Illuminate\Bus\Dispatcher' => \Illuminate\Bus\Dispatcher::class, + 'Illuminate\Cache\RateLimiter' => \Illuminate\Cache\RateLimiter::class, + 'Illuminate\Console\Scheduling\Schedule' => \Illuminate\Console\Scheduling\Schedule::class, + 'Illuminate\Console\Scheduling\ScheduleClearCacheCommand' => \Illuminate\Console\Scheduling\ScheduleClearCacheCommand::class, + 'Illuminate\Console\Scheduling\ScheduleFinishCommand' => \Illuminate\Console\Scheduling\ScheduleFinishCommand::class, + 'Illuminate\Console\Scheduling\ScheduleListCommand' => \Illuminate\Console\Scheduling\ScheduleListCommand::class, + 'Illuminate\Console\Scheduling\ScheduleRunCommand' => \Illuminate\Console\Scheduling\ScheduleRunCommand::class, + 'Illuminate\Console\Scheduling\ScheduleTestCommand' => \Illuminate\Console\Scheduling\ScheduleTestCommand::class, + 'Illuminate\Console\Scheduling\ScheduleWorkCommand' => \Illuminate\Console\Scheduling\ScheduleWorkCommand::class, + 'Illuminate\Contracts\Auth\Access\Gate' => \Illuminate\Auth\Access\Gate::class, + 'Illuminate\Contracts\Broadcasting\Broadcaster' => \Illuminate\Broadcasting\Broadcasters\LogBroadcaster::class, + 'Illuminate\Contracts\Console\Kernel' => \App\Console\Kernel::class, + 'Illuminate\Contracts\Debug\ExceptionHandler' => \NunoMaduro\Collision\Adapters\Laravel\ExceptionHandler::class, + 'Illuminate\Contracts\Http\Kernel' => \App\Http\Kernel::class, + 'Illuminate\Contracts\Pipeline\Hub' => \Illuminate\Pipeline\Hub::class, + 'Illuminate\Contracts\Queue\EntityResolver' => \Illuminate\Database\Eloquent\QueueEntityResolver::class, + 'Illuminate\Contracts\Routing\ResponseFactory' => \Illuminate\Routing\ResponseFactory::class, + 'Illuminate\Contracts\Validation\UncompromisedVerifier' => \Illuminate\Validation\NotPwnedVerifier::class, + 'Illuminate\Database\Console\DbCommand' => \Illuminate\Database\Console\DbCommand::class, + 'Illuminate\Foundation\Mix' => \Illuminate\Foundation\Mix::class, + 'Illuminate\Foundation\PackageManifest' => \Illuminate\Foundation\PackageManifest::class, + 'Illuminate\Mail\Markdown' => \Illuminate\Mail\Markdown::class, + 'Illuminate\Notifications\ChannelManager' => \Illuminate\Notifications\ChannelManager::class, + 'Illuminate\Routing\Contracts\ControllerDispatcher' => \Illuminate\Routing\ControllerDispatcher::class, + 'Illuminate\Session\Middleware\StartSession' => \Illuminate\Session\Middleware\StartSession::class, + 'Illuminate\Testing\ParallelTesting' => \Illuminate\Testing\ParallelTesting::class, + 'NunoMaduro\Collision\Contracts\Provider' => \NunoMaduro\Collision\Provider::class, + 'Whoops\Handler\HandlerInterface' => \Facade\Ignition\ErrorPage\IgnitionWhoopsHandler::class, + 'auth' => \Illuminate\Auth\AuthManager::class, + 'auth.driver' => \Illuminate\Auth\SessionGuard::class, + 'auth.password' => \Illuminate\Auth\Passwords\PasswordBrokerManager::class, + 'auth.password.broker' => \Illuminate\Auth\Passwords\PasswordBroker::class, + 'blade.compiler' => \Illuminate\View\Compilers\BladeCompiler::class, + 'cache' => \Illuminate\Cache\CacheManager::class, + 'cache.psr6' => \Symfony\Component\Cache\Adapter\Psr16Adapter::class, + 'cache.store' => \Illuminate\Cache\Repository::class, + 'command.auth.resets.clear' => \Illuminate\Auth\Console\ClearResetsCommand::class, + 'command.cache.clear' => \Illuminate\Cache\Console\ClearCommand::class, + 'command.cache.forget' => \Illuminate\Cache\Console\ForgetCommand::class, + 'command.cache.table' => \Illuminate\Cache\Console\CacheTableCommand::class, + 'command.cast.make' => \Illuminate\Foundation\Console\CastMakeCommand::class, + 'command.channel.make' => \Illuminate\Foundation\Console\ChannelMakeCommand::class, + 'command.clear-compiled' => \Illuminate\Foundation\Console\ClearCompiledCommand::class, + 'command.component.make' => \Illuminate\Foundation\Console\ComponentMakeCommand::class, + 'command.config.cache' => \Illuminate\Foundation\Console\ConfigCacheCommand::class, + 'command.config.clear' => \Illuminate\Foundation\Console\ConfigClearCommand::class, + 'command.console.make' => \Illuminate\Foundation\Console\ConsoleMakeCommand::class, + 'command.controller.make' => \Illuminate\Routing\Console\ControllerMakeCommand::class, + 'command.db.prune' => \Illuminate\Database\Console\PruneCommand::class, + 'command.db.wipe' => \Illuminate\Database\Console\WipeCommand::class, + 'command.down' => \Illuminate\Foundation\Console\DownCommand::class, + 'command.environment' => \Illuminate\Foundation\Console\EnvironmentCommand::class, + 'command.event.cache' => \Illuminate\Foundation\Console\EventCacheCommand::class, + 'command.event.clear' => \Illuminate\Foundation\Console\EventClearCommand::class, + 'command.event.generate' => \Illuminate\Foundation\Console\EventGenerateCommand::class, + 'command.event.list' => \Illuminate\Foundation\Console\EventListCommand::class, + 'command.event.make' => \Illuminate\Foundation\Console\EventMakeCommand::class, + 'command.exception.make' => \Illuminate\Foundation\Console\ExceptionMakeCommand::class, + 'command.factory.make' => \Illuminate\Database\Console\Factories\FactoryMakeCommand::class, + 'command.flare:test' => \Facade\Ignition\Commands\TestCommand::class, + 'command.ide-helper.eloquent' => \Barryvdh\LaravelIdeHelper\Console\EloquentCommand::class, + 'command.ide-helper.generate' => \Barryvdh\LaravelIdeHelper\Console\GeneratorCommand::class, + 'command.ide-helper.meta' => \Barryvdh\LaravelIdeHelper\Console\MetaCommand::class, + 'command.ide-helper.models' => \Barryvdh\LaravelIdeHelper\Console\ModelsCommand::class, + 'command.job.make' => \Illuminate\Foundation\Console\JobMakeCommand::class, + 'command.key.generate' => \Illuminate\Foundation\Console\KeyGenerateCommand::class, + 'command.listener.make' => \Illuminate\Foundation\Console\ListenerMakeCommand::class, + 'command.mail.make' => \Illuminate\Foundation\Console\MailMakeCommand::class, + 'command.make:solution' => \Facade\Ignition\Commands\SolutionMakeCommand::class, + 'command.make:solution-provider' => \Facade\Ignition\Commands\SolutionProviderMakeCommand::class, + 'command.middleware.make' => \Illuminate\Routing\Console\MiddlewareMakeCommand::class, + 'command.migrate' => \Illuminate\Database\Console\Migrations\MigrateCommand::class, + 'command.migrate.fresh' => \Illuminate\Database\Console\Migrations\FreshCommand::class, + 'command.migrate.install' => \Illuminate\Database\Console\Migrations\InstallCommand::class, + 'command.migrate.make' => \Illuminate\Database\Console\Migrations\MigrateMakeCommand::class, + 'command.migrate.refresh' => \Illuminate\Database\Console\Migrations\RefreshCommand::class, + 'command.migrate.reset' => \Illuminate\Database\Console\Migrations\ResetCommand::class, + 'command.migrate.rollback' => \Illuminate\Database\Console\Migrations\RollbackCommand::class, + 'command.migrate.status' => \Illuminate\Database\Console\Migrations\StatusCommand::class, + 'command.model.make' => \Illuminate\Foundation\Console\ModelMakeCommand::class, + 'command.notification.make' => \Illuminate\Foundation\Console\NotificationMakeCommand::class, + 'command.notification.table' => \Illuminate\Notifications\Console\NotificationTableCommand::class, + 'command.observer.make' => \Illuminate\Foundation\Console\ObserverMakeCommand::class, + 'command.optimize' => \Illuminate\Foundation\Console\OptimizeCommand::class, + 'command.optimize.clear' => \Illuminate\Foundation\Console\OptimizeClearCommand::class, + 'command.package.discover' => \Illuminate\Foundation\Console\PackageDiscoverCommand::class, + 'command.policy.make' => \Illuminate\Foundation\Console\PolicyMakeCommand::class, + 'command.provider.make' => \Illuminate\Foundation\Console\ProviderMakeCommand::class, + 'command.queue.batches-table' => \Illuminate\Queue\Console\BatchesTableCommand::class, + 'command.queue.clear' => \Illuminate\Queue\Console\ClearCommand::class, + 'command.queue.failed' => \Illuminate\Queue\Console\ListFailedCommand::class, + 'command.queue.failed-table' => \Illuminate\Queue\Console\FailedTableCommand::class, + 'command.queue.flush' => \Illuminate\Queue\Console\FlushFailedCommand::class, + 'command.queue.forget' => \Illuminate\Queue\Console\ForgetFailedCommand::class, + 'command.queue.listen' => \Illuminate\Queue\Console\ListenCommand::class, + 'command.queue.monitor' => \Illuminate\Queue\Console\MonitorCommand::class, + 'command.queue.prune-batches' => \Illuminate\Queue\Console\PruneBatchesCommand::class, + 'command.queue.prune-failed-jobs' => \Illuminate\Queue\Console\PruneFailedJobsCommand::class, + 'command.queue.restart' => \Illuminate\Queue\Console\RestartCommand::class, + 'command.queue.retry' => \Illuminate\Queue\Console\RetryCommand::class, + 'command.queue.retry-batch' => \Illuminate\Queue\Console\RetryBatchCommand::class, + 'command.queue.table' => \Illuminate\Queue\Console\TableCommand::class, + 'command.queue.work' => \Illuminate\Queue\Console\WorkCommand::class, + 'command.request.make' => \Illuminate\Foundation\Console\RequestMakeCommand::class, + 'command.resource.make' => \Illuminate\Foundation\Console\ResourceMakeCommand::class, + 'command.route.cache' => \Illuminate\Foundation\Console\RouteCacheCommand::class, + 'command.route.clear' => \Illuminate\Foundation\Console\RouteClearCommand::class, + 'command.route.list' => \Illuminate\Foundation\Console\RouteListCommand::class, + 'command.rule.make' => \Illuminate\Foundation\Console\RuleMakeCommand::class, + 'command.schema.dump' => \Illuminate\Database\Console\DumpCommand::class, + 'command.seed' => \Illuminate\Database\Console\Seeds\SeedCommand::class, + 'command.seeder.make' => \Illuminate\Database\Console\Seeds\SeederMakeCommand::class, + 'command.serve' => \Illuminate\Foundation\Console\ServeCommand::class, + 'command.session.table' => \Illuminate\Session\Console\SessionTableCommand::class, + 'command.storage.link' => \Illuminate\Foundation\Console\StorageLinkCommand::class, + 'command.stub.publish' => \Illuminate\Foundation\Console\StubPublishCommand::class, + 'command.test.make' => \Illuminate\Foundation\Console\TestMakeCommand::class, + 'command.tinker' => \Laravel\Tinker\Console\TinkerCommand::class, + 'command.up' => \Illuminate\Foundation\Console\UpCommand::class, + 'command.vendor.publish' => \Illuminate\Foundation\Console\VendorPublishCommand::class, + 'command.view.cache' => \Illuminate\Foundation\Console\ViewCacheCommand::class, + 'command.view.clear' => \Illuminate\Foundation\Console\ViewClearCommand::class, + 'composer' => \Illuminate\Support\Composer::class, + 'cookie' => \Illuminate\Cookie\CookieJar::class, + 'db' => \Illuminate\Database\DatabaseManager::class, + 'db.connection' => \Illuminate\Database\SQLiteConnection::class, + 'db.factory' => \Illuminate\Database\Connectors\ConnectionFactory::class, + 'db.transactions' => \Illuminate\Database\DatabaseTransactionsManager::class, + 'encrypter' => \Illuminate\Encryption\Encrypter::class, + 'events' => \Illuminate\Events\Dispatcher::class, + 'files' => \Illuminate\Filesystem\Filesystem::class, + 'filesystem' => \Illuminate\Filesystem\FilesystemManager::class, + 'filesystem.disk' => \Illuminate\Filesystem\FilesystemAdapter::class, + 'flare.http' => \Facade\FlareClient\Http\Client::class, + 'flare.logger' => \Monolog\Logger::class, + 'form' => \Collective\Html\FormBuilder::class, + 'github' => \GrahamCampbell\GitHub\GitHubManager::class, + 'github.authfactory' => \GrahamCampbell\GitHub\Auth\AuthenticatorFactory::class, + 'github.cachefactory' => \GrahamCampbell\GitHub\Cache\ConnectionFactory::class, + 'github.factory' => \GrahamCampbell\GitHub\GitHubFactory::class, + 'hash' => \Illuminate\Hashing\HashManager::class, + 'hash.driver' => \Illuminate\Hashing\BcryptHasher::class, + 'html' => \Collective\Html\HtmlBuilder::class, + 'log' => \Illuminate\Log\LogManager::class, + 'mail.manager' => \Illuminate\Mail\MailManager::class, + 'mailer' => \Illuminate\Mail\Mailer::class, + 'memcached.connector' => \Illuminate\Cache\MemcachedConnector::class, + 'migration.creator' => \Illuminate\Database\Migrations\MigrationCreator::class, + 'migration.repository' => \Illuminate\Database\Migrations\DatabaseMigrationRepository::class, + 'migrator' => \Illuminate\Database\Migrations\Migrator::class, + 'queue' => \Illuminate\Queue\QueueManager::class, + 'queue.connection' => \Illuminate\Queue\SyncQueue::class, + 'queue.failer' => \Illuminate\Queue\Failed\DatabaseFailedJobProvider::class, + 'queue.listener' => \Illuminate\Queue\Listener::class, + 'queue.worker' => \Illuminate\Queue\Worker::class, + 'redirect' => \Illuminate\Routing\Redirector::class, + 'redis' => \Illuminate\Redis\RedisManager::class, + 'router' => \Illuminate\Routing\Router::class, + 'session' => \Illuminate\Session\SessionManager::class, + 'session.store' => \Illuminate\Session\Store::class, + 'settings' => \App\Setting::class, + 'translation.loader' => \Illuminate\Translation\FileLoader::class, + 'translator' => \Illuminate\Translation\Translator::class, + 'url' => \Illuminate\Routing\UrlGenerator::class, + 'validation.presence' => \Illuminate\Validation\DatabasePresenceVerifier::class, + 'view' => \Illuminate\View\Factory::class, + 'view.engine.resolver' => \Illuminate\View\Engines\EngineResolver::class, + 'view.finder' => \Illuminate\View\FileViewFinder::class, + ])); + override(\Psr\Container\ContainerInterface::get(0), map([ + '' => '@', + 'Facade\FlareClient\Flare' => \Facade\FlareClient\Flare::class, + 'Facade\IgnitionContracts\SolutionProviderRepository' => \Facade\Ignition\SolutionProviders\SolutionProviderRepository::class, + 'Facade\Ignition\DumpRecorder\DumpRecorder' => \Facade\Ignition\DumpRecorder\DumpRecorder::class, + 'Facade\Ignition\DumpRecorder\MultiDumpHandler' => \Facade\Ignition\DumpRecorder\MultiDumpHandler::class, + 'Facade\Ignition\ErrorPage\Renderer' => \Facade\Ignition\ErrorPage\Renderer::class, + 'Facade\Ignition\IgnitionConfig' => \Facade\Ignition\IgnitionConfig::class, + 'Facade\Ignition\JobRecorder\JobRecorder' => \Facade\Ignition\JobRecorder\JobRecorder::class, + 'Facade\Ignition\LogRecorder\LogRecorder' => \Facade\Ignition\LogRecorder\LogRecorder::class, + 'Facade\Ignition\QueryRecorder\QueryRecorder' => \Facade\Ignition\QueryRecorder\QueryRecorder::class, + 'Facade\Ignition\Support\SentReports' => \Facade\Ignition\Support\SentReports::class, + 'Illuminate\Auth\Middleware\RequirePassword' => \Illuminate\Auth\Middleware\RequirePassword::class, + 'Illuminate\Broadcasting\BroadcastManager' => \Illuminate\Broadcasting\BroadcastManager::class, + 'Illuminate\Bus\BatchRepository' => \Illuminate\Bus\DatabaseBatchRepository::class, + 'Illuminate\Bus\DatabaseBatchRepository' => \Illuminate\Bus\DatabaseBatchRepository::class, + 'Illuminate\Bus\Dispatcher' => \Illuminate\Bus\Dispatcher::class, + 'Illuminate\Cache\RateLimiter' => \Illuminate\Cache\RateLimiter::class, + 'Illuminate\Console\Scheduling\Schedule' => \Illuminate\Console\Scheduling\Schedule::class, + 'Illuminate\Console\Scheduling\ScheduleClearCacheCommand' => \Illuminate\Console\Scheduling\ScheduleClearCacheCommand::class, + 'Illuminate\Console\Scheduling\ScheduleFinishCommand' => \Illuminate\Console\Scheduling\ScheduleFinishCommand::class, + 'Illuminate\Console\Scheduling\ScheduleListCommand' => \Illuminate\Console\Scheduling\ScheduleListCommand::class, + 'Illuminate\Console\Scheduling\ScheduleRunCommand' => \Illuminate\Console\Scheduling\ScheduleRunCommand::class, + 'Illuminate\Console\Scheduling\ScheduleTestCommand' => \Illuminate\Console\Scheduling\ScheduleTestCommand::class, + 'Illuminate\Console\Scheduling\ScheduleWorkCommand' => \Illuminate\Console\Scheduling\ScheduleWorkCommand::class, + 'Illuminate\Contracts\Auth\Access\Gate' => \Illuminate\Auth\Access\Gate::class, + 'Illuminate\Contracts\Broadcasting\Broadcaster' => \Illuminate\Broadcasting\Broadcasters\LogBroadcaster::class, + 'Illuminate\Contracts\Console\Kernel' => \App\Console\Kernel::class, + 'Illuminate\Contracts\Debug\ExceptionHandler' => \NunoMaduro\Collision\Adapters\Laravel\ExceptionHandler::class, + 'Illuminate\Contracts\Http\Kernel' => \App\Http\Kernel::class, + 'Illuminate\Contracts\Pipeline\Hub' => \Illuminate\Pipeline\Hub::class, + 'Illuminate\Contracts\Queue\EntityResolver' => \Illuminate\Database\Eloquent\QueueEntityResolver::class, + 'Illuminate\Contracts\Routing\ResponseFactory' => \Illuminate\Routing\ResponseFactory::class, + 'Illuminate\Contracts\Validation\UncompromisedVerifier' => \Illuminate\Validation\NotPwnedVerifier::class, + 'Illuminate\Database\Console\DbCommand' => \Illuminate\Database\Console\DbCommand::class, + 'Illuminate\Foundation\Mix' => \Illuminate\Foundation\Mix::class, + 'Illuminate\Foundation\PackageManifest' => \Illuminate\Foundation\PackageManifest::class, + 'Illuminate\Mail\Markdown' => \Illuminate\Mail\Markdown::class, + 'Illuminate\Notifications\ChannelManager' => \Illuminate\Notifications\ChannelManager::class, + 'Illuminate\Routing\Contracts\ControllerDispatcher' => \Illuminate\Routing\ControllerDispatcher::class, + 'Illuminate\Session\Middleware\StartSession' => \Illuminate\Session\Middleware\StartSession::class, + 'Illuminate\Testing\ParallelTesting' => \Illuminate\Testing\ParallelTesting::class, + 'NunoMaduro\Collision\Contracts\Provider' => \NunoMaduro\Collision\Provider::class, + 'Whoops\Handler\HandlerInterface' => \Facade\Ignition\ErrorPage\IgnitionWhoopsHandler::class, + 'auth' => \Illuminate\Auth\AuthManager::class, + 'auth.driver' => \Illuminate\Auth\SessionGuard::class, + 'auth.password' => \Illuminate\Auth\Passwords\PasswordBrokerManager::class, + 'auth.password.broker' => \Illuminate\Auth\Passwords\PasswordBroker::class, + 'blade.compiler' => \Illuminate\View\Compilers\BladeCompiler::class, + 'cache' => \Illuminate\Cache\CacheManager::class, + 'cache.psr6' => \Symfony\Component\Cache\Adapter\Psr16Adapter::class, + 'cache.store' => \Illuminate\Cache\Repository::class, + 'command.auth.resets.clear' => \Illuminate\Auth\Console\ClearResetsCommand::class, + 'command.cache.clear' => \Illuminate\Cache\Console\ClearCommand::class, + 'command.cache.forget' => \Illuminate\Cache\Console\ForgetCommand::class, + 'command.cache.table' => \Illuminate\Cache\Console\CacheTableCommand::class, + 'command.cast.make' => \Illuminate\Foundation\Console\CastMakeCommand::class, + 'command.channel.make' => \Illuminate\Foundation\Console\ChannelMakeCommand::class, + 'command.clear-compiled' => \Illuminate\Foundation\Console\ClearCompiledCommand::class, + 'command.component.make' => \Illuminate\Foundation\Console\ComponentMakeCommand::class, + 'command.config.cache' => \Illuminate\Foundation\Console\ConfigCacheCommand::class, + 'command.config.clear' => \Illuminate\Foundation\Console\ConfigClearCommand::class, + 'command.console.make' => \Illuminate\Foundation\Console\ConsoleMakeCommand::class, + 'command.controller.make' => \Illuminate\Routing\Console\ControllerMakeCommand::class, + 'command.db.prune' => \Illuminate\Database\Console\PruneCommand::class, + 'command.db.wipe' => \Illuminate\Database\Console\WipeCommand::class, + 'command.down' => \Illuminate\Foundation\Console\DownCommand::class, + 'command.environment' => \Illuminate\Foundation\Console\EnvironmentCommand::class, + 'command.event.cache' => \Illuminate\Foundation\Console\EventCacheCommand::class, + 'command.event.clear' => \Illuminate\Foundation\Console\EventClearCommand::class, + 'command.event.generate' => \Illuminate\Foundation\Console\EventGenerateCommand::class, + 'command.event.list' => \Illuminate\Foundation\Console\EventListCommand::class, + 'command.event.make' => \Illuminate\Foundation\Console\EventMakeCommand::class, + 'command.exception.make' => \Illuminate\Foundation\Console\ExceptionMakeCommand::class, + 'command.factory.make' => \Illuminate\Database\Console\Factories\FactoryMakeCommand::class, + 'command.flare:test' => \Facade\Ignition\Commands\TestCommand::class, + 'command.ide-helper.eloquent' => \Barryvdh\LaravelIdeHelper\Console\EloquentCommand::class, + 'command.ide-helper.generate' => \Barryvdh\LaravelIdeHelper\Console\GeneratorCommand::class, + 'command.ide-helper.meta' => \Barryvdh\LaravelIdeHelper\Console\MetaCommand::class, + 'command.ide-helper.models' => \Barryvdh\LaravelIdeHelper\Console\ModelsCommand::class, + 'command.job.make' => \Illuminate\Foundation\Console\JobMakeCommand::class, + 'command.key.generate' => \Illuminate\Foundation\Console\KeyGenerateCommand::class, + 'command.listener.make' => \Illuminate\Foundation\Console\ListenerMakeCommand::class, + 'command.mail.make' => \Illuminate\Foundation\Console\MailMakeCommand::class, + 'command.make:solution' => \Facade\Ignition\Commands\SolutionMakeCommand::class, + 'command.make:solution-provider' => \Facade\Ignition\Commands\SolutionProviderMakeCommand::class, + 'command.middleware.make' => \Illuminate\Routing\Console\MiddlewareMakeCommand::class, + 'command.migrate' => \Illuminate\Database\Console\Migrations\MigrateCommand::class, + 'command.migrate.fresh' => \Illuminate\Database\Console\Migrations\FreshCommand::class, + 'command.migrate.install' => \Illuminate\Database\Console\Migrations\InstallCommand::class, + 'command.migrate.make' => \Illuminate\Database\Console\Migrations\MigrateMakeCommand::class, + 'command.migrate.refresh' => \Illuminate\Database\Console\Migrations\RefreshCommand::class, + 'command.migrate.reset' => \Illuminate\Database\Console\Migrations\ResetCommand::class, + 'command.migrate.rollback' => \Illuminate\Database\Console\Migrations\RollbackCommand::class, + 'command.migrate.status' => \Illuminate\Database\Console\Migrations\StatusCommand::class, + 'command.model.make' => \Illuminate\Foundation\Console\ModelMakeCommand::class, + 'command.notification.make' => \Illuminate\Foundation\Console\NotificationMakeCommand::class, + 'command.notification.table' => \Illuminate\Notifications\Console\NotificationTableCommand::class, + 'command.observer.make' => \Illuminate\Foundation\Console\ObserverMakeCommand::class, + 'command.optimize' => \Illuminate\Foundation\Console\OptimizeCommand::class, + 'command.optimize.clear' => \Illuminate\Foundation\Console\OptimizeClearCommand::class, + 'command.package.discover' => \Illuminate\Foundation\Console\PackageDiscoverCommand::class, + 'command.policy.make' => \Illuminate\Foundation\Console\PolicyMakeCommand::class, + 'command.provider.make' => \Illuminate\Foundation\Console\ProviderMakeCommand::class, + 'command.queue.batches-table' => \Illuminate\Queue\Console\BatchesTableCommand::class, + 'command.queue.clear' => \Illuminate\Queue\Console\ClearCommand::class, + 'command.queue.failed' => \Illuminate\Queue\Console\ListFailedCommand::class, + 'command.queue.failed-table' => \Illuminate\Queue\Console\FailedTableCommand::class, + 'command.queue.flush' => \Illuminate\Queue\Console\FlushFailedCommand::class, + 'command.queue.forget' => \Illuminate\Queue\Console\ForgetFailedCommand::class, + 'command.queue.listen' => \Illuminate\Queue\Console\ListenCommand::class, + 'command.queue.monitor' => \Illuminate\Queue\Console\MonitorCommand::class, + 'command.queue.prune-batches' => \Illuminate\Queue\Console\PruneBatchesCommand::class, + 'command.queue.prune-failed-jobs' => \Illuminate\Queue\Console\PruneFailedJobsCommand::class, + 'command.queue.restart' => \Illuminate\Queue\Console\RestartCommand::class, + 'command.queue.retry' => \Illuminate\Queue\Console\RetryCommand::class, + 'command.queue.retry-batch' => \Illuminate\Queue\Console\RetryBatchCommand::class, + 'command.queue.table' => \Illuminate\Queue\Console\TableCommand::class, + 'command.queue.work' => \Illuminate\Queue\Console\WorkCommand::class, + 'command.request.make' => \Illuminate\Foundation\Console\RequestMakeCommand::class, + 'command.resource.make' => \Illuminate\Foundation\Console\ResourceMakeCommand::class, + 'command.route.cache' => \Illuminate\Foundation\Console\RouteCacheCommand::class, + 'command.route.clear' => \Illuminate\Foundation\Console\RouteClearCommand::class, + 'command.route.list' => \Illuminate\Foundation\Console\RouteListCommand::class, + 'command.rule.make' => \Illuminate\Foundation\Console\RuleMakeCommand::class, + 'command.schema.dump' => \Illuminate\Database\Console\DumpCommand::class, + 'command.seed' => \Illuminate\Database\Console\Seeds\SeedCommand::class, + 'command.seeder.make' => \Illuminate\Database\Console\Seeds\SeederMakeCommand::class, + 'command.serve' => \Illuminate\Foundation\Console\ServeCommand::class, + 'command.session.table' => \Illuminate\Session\Console\SessionTableCommand::class, + 'command.storage.link' => \Illuminate\Foundation\Console\StorageLinkCommand::class, + 'command.stub.publish' => \Illuminate\Foundation\Console\StubPublishCommand::class, + 'command.test.make' => \Illuminate\Foundation\Console\TestMakeCommand::class, + 'command.tinker' => \Laravel\Tinker\Console\TinkerCommand::class, + 'command.up' => \Illuminate\Foundation\Console\UpCommand::class, + 'command.vendor.publish' => \Illuminate\Foundation\Console\VendorPublishCommand::class, + 'command.view.cache' => \Illuminate\Foundation\Console\ViewCacheCommand::class, + 'command.view.clear' => \Illuminate\Foundation\Console\ViewClearCommand::class, + 'composer' => \Illuminate\Support\Composer::class, + 'cookie' => \Illuminate\Cookie\CookieJar::class, + 'db' => \Illuminate\Database\DatabaseManager::class, + 'db.connection' => \Illuminate\Database\SQLiteConnection::class, + 'db.factory' => \Illuminate\Database\Connectors\ConnectionFactory::class, + 'db.transactions' => \Illuminate\Database\DatabaseTransactionsManager::class, + 'encrypter' => \Illuminate\Encryption\Encrypter::class, + 'events' => \Illuminate\Events\Dispatcher::class, + 'files' => \Illuminate\Filesystem\Filesystem::class, + 'filesystem' => \Illuminate\Filesystem\FilesystemManager::class, + 'filesystem.disk' => \Illuminate\Filesystem\FilesystemAdapter::class, + 'flare.http' => \Facade\FlareClient\Http\Client::class, + 'flare.logger' => \Monolog\Logger::class, + 'form' => \Collective\Html\FormBuilder::class, + 'github' => \GrahamCampbell\GitHub\GitHubManager::class, + 'github.authfactory' => \GrahamCampbell\GitHub\Auth\AuthenticatorFactory::class, + 'github.cachefactory' => \GrahamCampbell\GitHub\Cache\ConnectionFactory::class, + 'github.factory' => \GrahamCampbell\GitHub\GitHubFactory::class, + 'hash' => \Illuminate\Hashing\HashManager::class, + 'hash.driver' => \Illuminate\Hashing\BcryptHasher::class, + 'html' => \Collective\Html\HtmlBuilder::class, + 'log' => \Illuminate\Log\LogManager::class, + 'mail.manager' => \Illuminate\Mail\MailManager::class, + 'mailer' => \Illuminate\Mail\Mailer::class, + 'memcached.connector' => \Illuminate\Cache\MemcachedConnector::class, + 'migration.creator' => \Illuminate\Database\Migrations\MigrationCreator::class, + 'migration.repository' => \Illuminate\Database\Migrations\DatabaseMigrationRepository::class, + 'migrator' => \Illuminate\Database\Migrations\Migrator::class, + 'queue' => \Illuminate\Queue\QueueManager::class, + 'queue.connection' => \Illuminate\Queue\SyncQueue::class, + 'queue.failer' => \Illuminate\Queue\Failed\DatabaseFailedJobProvider::class, + 'queue.listener' => \Illuminate\Queue\Listener::class, + 'queue.worker' => \Illuminate\Queue\Worker::class, + 'redirect' => \Illuminate\Routing\Redirector::class, + 'redis' => \Illuminate\Redis\RedisManager::class, + 'router' => \Illuminate\Routing\Router::class, + 'session' => \Illuminate\Session\SessionManager::class, + 'session.store' => \Illuminate\Session\Store::class, + 'settings' => \App\Setting::class, + 'translation.loader' => \Illuminate\Translation\FileLoader::class, + 'translator' => \Illuminate\Translation\Translator::class, + 'url' => \Illuminate\Routing\UrlGenerator::class, + 'validation.presence' => \Illuminate\Validation\DatabasePresenceVerifier::class, + 'view' => \Illuminate\View\Factory::class, + 'view.engine.resolver' => \Illuminate\View\Engines\EngineResolver::class, + 'view.finder' => \Illuminate\View\FileViewFinder::class, + ])); + + + override(\Illuminate\Support\Arr::add(0), type(0)); + override(\Illuminate\Support\Arr::except(0), type(0)); + override(\Illuminate\Support\Arr::first(0), elementType(0)); + override(\Illuminate\Support\Arr::last(0), elementType(0)); + override(\Illuminate\Support\Arr::get(0), elementType(0)); + override(\Illuminate\Support\Arr::only(0), type(0)); + override(\Illuminate\Support\Arr::prepend(0), type(0)); + override(\Illuminate\Support\Arr::pull(0), elementType(0)); + override(\Illuminate\Support\Arr::set(0), type(0)); + override(\Illuminate\Support\Arr::shuffle(0), type(0)); + override(\Illuminate\Support\Arr::sort(0), type(0)); + override(\Illuminate\Support\Arr::sortRecursive(0), type(0)); + override(\Illuminate\Support\Arr::where(0), type(0)); + override(\array_add(0), type(0)); + override(\array_except(0), type(0)); + override(\array_first(0), elementType(0)); + override(\array_last(0), elementType(0)); + override(\array_get(0), elementType(0)); + override(\array_only(0), type(0)); + override(\array_prepend(0), type(0)); + override(\array_pull(0), elementType(0)); + override(\array_set(0), type(0)); + override(\array_sort(0), type(0)); + override(\array_sort_recursive(0), type(0)); + override(\array_where(0), type(0)); + override(\head(0), elementType(0)); + override(\last(0), elementType(0)); + override(\with(0), type(0)); + override(\tap(0), type(0)); + override(\optional(0), type(0)); + +} diff --git a/_ide_helper.php b/_ide_helper.php new file mode 100644 index 00000000..995e2e23 --- /dev/null +++ b/_ide_helper.php @@ -0,0 +1,20867 @@ + + * @see https://github.com/barryvdh/laravel-ide-helper + */ + + namespace Illuminate\Support\Facades { + /** + * + * + * @see \Illuminate\Contracts\Foundation\Application + */ + class App { + /** + * Get the version number of the application. + * + * @return string + * @static + */ + public static function version() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->version(); + } + /** + * Run the given array of bootstrap classes. + * + * @param string[] $bootstrappers + * @return void + * @static + */ + public static function bootstrapWith($bootstrappers) + { + /** @var \Illuminate\Foundation\Application $instance */ + $instance->bootstrapWith($bootstrappers); + } + /** + * Register a callback to run after loading the environment. + * + * @param \Closure $callback + * @return void + * @static + */ + public static function afterLoadingEnvironment($callback) + { + /** @var \Illuminate\Foundation\Application $instance */ + $instance->afterLoadingEnvironment($callback); + } + /** + * Register a callback to run before a bootstrapper. + * + * @param string $bootstrapper + * @param \Closure $callback + * @return void + * @static + */ + public static function beforeBootstrapping($bootstrapper, $callback) + { + /** @var \Illuminate\Foundation\Application $instance */ + $instance->beforeBootstrapping($bootstrapper, $callback); + } + /** + * Register a callback to run after a bootstrapper. + * + * @param string $bootstrapper + * @param \Closure $callback + * @return void + * @static + */ + public static function afterBootstrapping($bootstrapper, $callback) + { + /** @var \Illuminate\Foundation\Application $instance */ + $instance->afterBootstrapping($bootstrapper, $callback); + } + /** + * Determine if the application has been bootstrapped before. + * + * @return bool + * @static + */ + public static function hasBeenBootstrapped() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->hasBeenBootstrapped(); + } + /** + * Set the base path for the application. + * + * @param string $basePath + * @return \Illuminate\Foundation\Application + * @static + */ + public static function setBasePath($basePath) + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->setBasePath($basePath); + } + /** + * Get the path to the application "app" directory. + * + * @param string $path + * @return string + * @static + */ + public static function path($path = '') + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->path($path); + } + /** + * Set the application directory. + * + * @param string $path + * @return \Illuminate\Foundation\Application + * @static + */ + public static function useAppPath($path) + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->useAppPath($path); + } + /** + * Get the base path of the Laravel installation. + * + * @param string $path + * @return string + * @static + */ + public static function basePath($path = '') + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->basePath($path); + } + /** + * Get the path to the bootstrap directory. + * + * @param string $path + * @return string + * @static + */ + public static function bootstrapPath($path = '') + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->bootstrapPath($path); + } + /** + * Get the path to the application configuration files. + * + * @param string $path + * @return string + * @static + */ + public static function configPath($path = '') + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->configPath($path); + } + /** + * Get the path to the database directory. + * + * @param string $path + * @return string + * @static + */ + public static function databasePath($path = '') + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->databasePath($path); + } + /** + * Set the database directory. + * + * @param string $path + * @return \Illuminate\Foundation\Application + * @static + */ + public static function useDatabasePath($path) + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->useDatabasePath($path); + } + /** + * Get the path to the language files. + * + * @return string + * @static + */ + public static function langPath() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->langPath(); + } + /** + * Set the language file directory. + * + * @param string $path + * @return \Illuminate\Foundation\Application + * @static + */ + public static function useLangPath($path) + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->useLangPath($path); + } + /** + * Get the path to the public / web directory. + * + * @return string + * @static + */ + public static function publicPath() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->publicPath(); + } + /** + * Get the path to the storage directory. + * + * @return string + * @static + */ + public static function storagePath() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->storagePath(); + } + /** + * Set the storage directory. + * + * @param string $path + * @return \Illuminate\Foundation\Application + * @static + */ + public static function useStoragePath($path) + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->useStoragePath($path); + } + /** + * Get the path to the resources directory. + * + * @param string $path + * @return string + * @static + */ + public static function resourcePath($path = '') + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->resourcePath($path); + } + /** + * Get the path to the views directory. + * + * This method returns the first configured path in the array of view paths. + * + * @param string $path + * @return string + * @static + */ + public static function viewPath($path = '') + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->viewPath($path); + } + /** + * Get the path to the environment file directory. + * + * @return string + * @static + */ + public static function environmentPath() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->environmentPath(); + } + /** + * Set the directory for the environment file. + * + * @param string $path + * @return \Illuminate\Foundation\Application + * @static + */ + public static function useEnvironmentPath($path) + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->useEnvironmentPath($path); + } + /** + * Set the environment file to be loaded during bootstrapping. + * + * @param string $file + * @return \Illuminate\Foundation\Application + * @static + */ + public static function loadEnvironmentFrom($file) + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->loadEnvironmentFrom($file); + } + /** + * Get the environment file the application is using. + * + * @return string + * @static + */ + public static function environmentFile() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->environmentFile(); + } + /** + * Get the fully qualified path to the environment file. + * + * @return string + * @static + */ + public static function environmentFilePath() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->environmentFilePath(); + } + /** + * Get or check the current application environment. + * + * @param string|array $environments + * @return string|bool + * @static + */ + public static function environment(...$environments) + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->environment(...$environments); + } + /** + * Determine if the application is in the local environment. + * + * @return bool + * @static + */ + public static function isLocal() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->isLocal(); + } + /** + * Determine if the application is in the production environment. + * + * @return bool + * @static + */ + public static function isProduction() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->isProduction(); + } + /** + * Detect the application's current environment. + * + * @param \Closure $callback + * @return string + * @static + */ + public static function detectEnvironment($callback) + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->detectEnvironment($callback); + } + /** + * Determine if the application is running in the console. + * + * @return bool + * @static + */ + public static function runningInConsole() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->runningInConsole(); + } + /** + * Determine if the application is running unit tests. + * + * @return bool + * @static + */ + public static function runningUnitTests() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->runningUnitTests(); + } + /** + * Determine if the application is running with debug mode enabled. + * + * @return bool + * @static + */ + public static function hasDebugModeEnabled() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->hasDebugModeEnabled(); + } + /** + * Register all of the configured providers. + * + * @return void + * @static + */ + public static function registerConfiguredProviders() + { + /** @var \Illuminate\Foundation\Application $instance */ + $instance->registerConfiguredProviders(); + } + /** + * Register a service provider with the application. + * + * @param \Illuminate\Support\ServiceProvider|string $provider + * @param bool $force + * @return \Illuminate\Support\ServiceProvider + * @static + */ + public static function register($provider, $force = false) + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->register($provider, $force); + } + /** + * Get the registered service provider instance if it exists. + * + * @param \Illuminate\Support\ServiceProvider|string $provider + * @return \Illuminate\Support\ServiceProvider|null + * @static + */ + public static function getProvider($provider) + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->getProvider($provider); + } + /** + * Get the registered service provider instances if any exist. + * + * @param \Illuminate\Support\ServiceProvider|string $provider + * @return array + * @static + */ + public static function getProviders($provider) + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->getProviders($provider); + } + /** + * Resolve a service provider instance from the class name. + * + * @param string $provider + * @return \Illuminate\Support\ServiceProvider + * @static + */ + public static function resolveProvider($provider) + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->resolveProvider($provider); + } + /** + * Load and boot all of the remaining deferred providers. + * + * @return void + * @static + */ + public static function loadDeferredProviders() + { + /** @var \Illuminate\Foundation\Application $instance */ + $instance->loadDeferredProviders(); + } + /** + * Load the provider for a deferred service. + * + * @param string $service + * @return void + * @static + */ + public static function loadDeferredProvider($service) + { + /** @var \Illuminate\Foundation\Application $instance */ + $instance->loadDeferredProvider($service); + } + /** + * Register a deferred provider and service. + * + * @param string $provider + * @param string|null $service + * @return void + * @static + */ + public static function registerDeferredProvider($provider, $service = null) + { + /** @var \Illuminate\Foundation\Application $instance */ + $instance->registerDeferredProvider($provider, $service); + } + /** + * Resolve the given type from the container. + * + * @param string $abstract + * @param array $parameters + * @return mixed + * @static + */ + public static function make($abstract, $parameters = []) + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->make($abstract, $parameters); + } + /** + * Determine if the given abstract type has been bound. + * + * @param string $abstract + * @return bool + * @static + */ + public static function bound($abstract) + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->bound($abstract); + } + /** + * Determine if the application has booted. + * + * @return bool + * @static + */ + public static function isBooted() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->isBooted(); + } + /** + * Boot the application's service providers. + * + * @return void + * @static + */ + public static function boot() + { + /** @var \Illuminate\Foundation\Application $instance */ + $instance->boot(); + } + /** + * Register a new boot listener. + * + * @param callable $callback + * @return void + * @static + */ + public static function booting($callback) + { + /** @var \Illuminate\Foundation\Application $instance */ + $instance->booting($callback); + } + /** + * Register a new "booted" listener. + * + * @param callable $callback + * @return void + * @static + */ + public static function booted($callback) + { + /** @var \Illuminate\Foundation\Application $instance */ + $instance->booted($callback); + } + /** + * {@inheritdoc} + * + * @return \Symfony\Component\HttpFoundation\Response + * @static + */ + public static function handle($request, $type = 1, $catch = true) + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->handle($request, $type, $catch); + } + /** + * Determine if middleware has been disabled for the application. + * + * @return bool + * @static + */ + public static function shouldSkipMiddleware() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->shouldSkipMiddleware(); + } + /** + * Get the path to the cached services.php file. + * + * @return string + * @static + */ + public static function getCachedServicesPath() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->getCachedServicesPath(); + } + /** + * Get the path to the cached packages.php file. + * + * @return string + * @static + */ + public static function getCachedPackagesPath() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->getCachedPackagesPath(); + } + /** + * Determine if the application configuration is cached. + * + * @return bool + * @static + */ + public static function configurationIsCached() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->configurationIsCached(); + } + /** + * Get the path to the configuration cache file. + * + * @return string + * @static + */ + public static function getCachedConfigPath() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->getCachedConfigPath(); + } + /** + * Determine if the application routes are cached. + * + * @return bool + * @static + */ + public static function routesAreCached() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->routesAreCached(); + } + /** + * Get the path to the routes cache file. + * + * @return string + * @static + */ + public static function getCachedRoutesPath() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->getCachedRoutesPath(); + } + /** + * Determine if the application events are cached. + * + * @return bool + * @static + */ + public static function eventsAreCached() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->eventsAreCached(); + } + /** + * Get the path to the events cache file. + * + * @return string + * @static + */ + public static function getCachedEventsPath() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->getCachedEventsPath(); + } + /** + * Add new prefix to list of absolute path prefixes. + * + * @param string $prefix + * @return \Illuminate\Foundation\Application + * @static + */ + public static function addAbsoluteCachePathPrefix($prefix) + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->addAbsoluteCachePathPrefix($prefix); + } + /** + * Determine if the application is currently down for maintenance. + * + * @return bool + * @static + */ + public static function isDownForMaintenance() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->isDownForMaintenance(); + } + /** + * Throw an HttpException with the given data. + * + * @param int $code + * @param string $message + * @param array $headers + * @return \Illuminate\Foundation\never + * @throws \Symfony\Component\HttpKernel\Exception\HttpException + * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException + * @static + */ + public static function abort($code, $message = '', $headers = []) + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->abort($code, $message, $headers); + } + /** + * Register a terminating callback with the application. + * + * @param callable|string $callback + * @return \Illuminate\Foundation\Application + * @static + */ + public static function terminating($callback) + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->terminating($callback); + } + /** + * Terminate the application. + * + * @return void + * @static + */ + public static function terminate() + { + /** @var \Illuminate\Foundation\Application $instance */ + $instance->terminate(); + } + /** + * Get the service providers that have been loaded. + * + * @return array + * @static + */ + public static function getLoadedProviders() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->getLoadedProviders(); + } + /** + * Determine if the given service provider is loaded. + * + * @param string $provider + * @return bool + * @static + */ + public static function providerIsLoaded($provider) + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->providerIsLoaded($provider); + } + /** + * Get the application's deferred services. + * + * @return array + * @static + */ + public static function getDeferredServices() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->getDeferredServices(); + } + /** + * Set the application's deferred services. + * + * @param array $services + * @return void + * @static + */ + public static function setDeferredServices($services) + { + /** @var \Illuminate\Foundation\Application $instance */ + $instance->setDeferredServices($services); + } + /** + * Add an array of services to the application's deferred services. + * + * @param array $services + * @return void + * @static + */ + public static function addDeferredServices($services) + { + /** @var \Illuminate\Foundation\Application $instance */ + $instance->addDeferredServices($services); + } + /** + * Determine if the given service is a deferred service. + * + * @param string $service + * @return bool + * @static + */ + public static function isDeferredService($service) + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->isDeferredService($service); + } + /** + * Configure the real-time facade namespace. + * + * @param string $namespace + * @return void + * @static + */ + public static function provideFacades($namespace) + { + /** @var \Illuminate\Foundation\Application $instance */ + $instance->provideFacades($namespace); + } + /** + * Get the current application locale. + * + * @return string + * @static + */ + public static function getLocale() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->getLocale(); + } + /** + * Get the current application locale. + * + * @return string + * @static + */ + public static function currentLocale() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->currentLocale(); + } + /** + * Get the current application fallback locale. + * + * @return string + * @static + */ + public static function getFallbackLocale() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->getFallbackLocale(); + } + /** + * Set the current application locale. + * + * @param string $locale + * @return void + * @static + */ + public static function setLocale($locale) + { + /** @var \Illuminate\Foundation\Application $instance */ + $instance->setLocale($locale); + } + /** + * Set the current application fallback locale. + * + * @param string $fallbackLocale + * @return void + * @static + */ + public static function setFallbackLocale($fallbackLocale) + { + /** @var \Illuminate\Foundation\Application $instance */ + $instance->setFallbackLocale($fallbackLocale); + } + /** + * Determine if the application locale is the given locale. + * + * @param string $locale + * @return bool + * @static + */ + public static function isLocale($locale) + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->isLocale($locale); + } + /** + * Register the core class aliases in the container. + * + * @return void + * @static + */ + public static function registerCoreContainerAliases() + { + /** @var \Illuminate\Foundation\Application $instance */ + $instance->registerCoreContainerAliases(); + } + /** + * Flush the container of all bindings and resolved instances. + * + * @return void + * @static + */ + public static function flush() + { + /** @var \Illuminate\Foundation\Application $instance */ + $instance->flush(); + } + /** + * Get the application namespace. + * + * @return string + * @throws \RuntimeException + * @static + */ + public static function getNamespace() + { + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->getNamespace(); + } + /** + * Define a contextual binding. + * + * @param array|string $concrete + * @return \Illuminate\Contracts\Container\ContextualBindingBuilder + * @static + */ + public static function when($concrete) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->when($concrete); + } + /** + * Returns true if the container can return an entry for the given identifier. + * + * Returns false otherwise. + * + * `has($id)` returning true does not mean that `get($id)` will not throw an exception. + * It does however mean that `get($id)` will not throw a `NotFoundExceptionInterface`. + * + * @return bool + * @param string $id Identifier of the entry to look for. + * @return bool + * @static + */ + public static function has($id) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->has($id); + } + /** + * Determine if the given abstract type has been resolved. + * + * @param string $abstract + * @return bool + * @static + */ + public static function resolved($abstract) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->resolved($abstract); + } + /** + * Determine if a given type is shared. + * + * @param string $abstract + * @return bool + * @static + */ + public static function isShared($abstract) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->isShared($abstract); + } + /** + * Determine if a given string is an alias. + * + * @param string $name + * @return bool + * @static + */ + public static function isAlias($name) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->isAlias($name); + } + /** + * Register a binding with the container. + * + * @param string $abstract + * @param \Closure|string|null $concrete + * @param bool $shared + * @return void + * @throws \TypeError + * @static + */ + public static function bind($abstract, $concrete = null, $shared = false) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + $instance->bind($abstract, $concrete, $shared); + } + /** + * Determine if the container has a method binding. + * + * @param string $method + * @return bool + * @static + */ + public static function hasMethodBinding($method) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->hasMethodBinding($method); + } + /** + * Bind a callback to resolve with Container::call. + * + * @param array|string $method + * @param \Closure $callback + * @return void + * @static + */ + public static function bindMethod($method, $callback) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + $instance->bindMethod($method, $callback); + } + /** + * Get the method binding for the given method. + * + * @param string $method + * @param mixed $instance + * @return mixed + * @static + */ + public static function callMethodBinding($method, $instance) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->callMethodBinding($method, $instance); + } + /** + * Add a contextual binding to the container. + * + * @param string $concrete + * @param string $abstract + * @param \Closure|string $implementation + * @return void + * @static + */ + public static function addContextualBinding($concrete, $abstract, $implementation) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + $instance->addContextualBinding($concrete, $abstract, $implementation); + } + /** + * Register a binding if it hasn't already been registered. + * + * @param string $abstract + * @param \Closure|string|null $concrete + * @param bool $shared + * @return void + * @static + */ + public static function bindIf($abstract, $concrete = null, $shared = false) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + $instance->bindIf($abstract, $concrete, $shared); + } + /** + * Register a shared binding in the container. + * + * @param string $abstract + * @param \Closure|string|null $concrete + * @return void + * @static + */ + public static function singleton($abstract, $concrete = null) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + $instance->singleton($abstract, $concrete); + } + /** + * Register a shared binding if it hasn't already been registered. + * + * @param string $abstract + * @param \Closure|string|null $concrete + * @return void + * @static + */ + public static function singletonIf($abstract, $concrete = null) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + $instance->singletonIf($abstract, $concrete); + } + /** + * Register a scoped binding in the container. + * + * @param string $abstract + * @param \Closure|string|null $concrete + * @return void + * @static + */ + public static function scoped($abstract, $concrete = null) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + $instance->scoped($abstract, $concrete); + } + /** + * Register a scoped binding if it hasn't already been registered. + * + * @param string $abstract + * @param \Closure|string|null $concrete + * @return void + * @static + */ + public static function scopedIf($abstract, $concrete = null) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + $instance->scopedIf($abstract, $concrete); + } + /** + * "Extend" an abstract type in the container. + * + * @param string $abstract + * @param \Closure $closure + * @return void + * @throws \InvalidArgumentException + * @static + */ + public static function extend($abstract, $closure) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + $instance->extend($abstract, $closure); + } + /** + * Register an existing instance as shared in the container. + * + * @param string $abstract + * @param mixed $instance + * @return mixed + * @static + */ + public static function instance($abstract, $instance) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->instance($abstract, $instance); + } + /** + * Assign a set of tags to a given binding. + * + * @param array|string $abstracts + * @param array|mixed $tags + * @return void + * @static + */ + public static function tag($abstracts, $tags) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + $instance->tag($abstracts, $tags); + } + /** + * Resolve all of the bindings for a given tag. + * + * @param string $tag + * @return \Illuminate\Container\iterable + * @static + */ + public static function tagged($tag) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->tagged($tag); + } + /** + * Alias a type to a different name. + * + * @param string $abstract + * @param string $alias + * @return void + * @throws \LogicException + * @static + */ + public static function alias($abstract, $alias) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + $instance->alias($abstract, $alias); + } + /** + * Bind a new callback to an abstract's rebind event. + * + * @param string $abstract + * @param \Closure $callback + * @return mixed + * @static + */ + public static function rebinding($abstract, $callback) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->rebinding($abstract, $callback); + } + /** + * Refresh an instance on the given target and method. + * + * @param string $abstract + * @param mixed $target + * @param string $method + * @return mixed + * @static + */ + public static function refresh($abstract, $target, $method) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->refresh($abstract, $target, $method); + } + /** + * Wrap the given closure such that its dependencies will be injected when executed. + * + * @param \Closure $callback + * @param array $parameters + * @return \Closure + * @static + */ + public static function wrap($callback, $parameters = []) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->wrap($callback, $parameters); + } + /** + * Call the given Closure / class@method and inject its dependencies. + * + * @param callable|string $callback + * @param \Illuminate\Container\array $parameters + * @param string|null $defaultMethod + * @return mixed + * @throws \InvalidArgumentException + * @static + */ + public static function call($callback, $parameters = [], $defaultMethod = null) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->call($callback, $parameters, $defaultMethod); + } + /** + * Get a closure to resolve the given type from the container. + * + * @param string $abstract + * @return \Closure + * @static + */ + public static function factory($abstract) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->factory($abstract); + } + /** + * An alias function name for make(). + * + * @param string|callable $abstract + * @param array $parameters + * @return mixed + * @throws \Illuminate\Contracts\Container\BindingResolutionException + * @static + */ + public static function makeWith($abstract, $parameters = []) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->makeWith($abstract, $parameters); + } + /** + * Finds an entry of the container by its identifier and returns it. + * + * @return mixed + * @param string $id Identifier of the entry to look for. + * @throws NotFoundExceptionInterface No entry was found for **this** identifier. + * @throws ContainerExceptionInterface Error while retrieving the entry. + * @return mixed Entry. + * @static + */ + public static function get($id) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->get($id); + } + /** + * Instantiate a concrete instance of the given type. + * + * @param \Closure|string $concrete + * @return mixed + * @throws \Illuminate\Contracts\Container\BindingResolutionException + * @throws \Illuminate\Contracts\Container\CircularDependencyException + * @static + */ + public static function build($concrete) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->build($concrete); + } + /** + * Register a new before resolving callback for all types. + * + * @param \Closure|string $abstract + * @param \Closure|null $callback + * @return void + * @static + */ + public static function beforeResolving($abstract, $callback = null) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + $instance->beforeResolving($abstract, $callback); + } + /** + * Register a new resolving callback. + * + * @param \Closure|string $abstract + * @param \Closure|null $callback + * @return void + * @static + */ + public static function resolving($abstract, $callback = null) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + $instance->resolving($abstract, $callback); + } + /** + * Register a new after resolving callback for all types. + * + * @param \Closure|string $abstract + * @param \Closure|null $callback + * @return void + * @static + */ + public static function afterResolving($abstract, $callback = null) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + $instance->afterResolving($abstract, $callback); + } + /** + * Get the container's bindings. + * + * @return array + * @static + */ + public static function getBindings() + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->getBindings(); + } + /** + * Get the alias for an abstract if available. + * + * @param string $abstract + * @return string + * @static + */ + public static function getAlias($abstract) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->getAlias($abstract); + } + /** + * Remove all of the extender callbacks for a given type. + * + * @param string $abstract + * @return void + * @static + */ + public static function forgetExtenders($abstract) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + $instance->forgetExtenders($abstract); + } + /** + * Remove a resolved instance from the instance cache. + * + * @param string $abstract + * @return void + * @static + */ + public static function forgetInstance($abstract) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + $instance->forgetInstance($abstract); + } + /** + * Clear all of the instances from the container. + * + * @return void + * @static + */ + public static function forgetInstances() + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + $instance->forgetInstances(); + } + /** + * Clear all of the scoped instances from the container. + * + * @return void + * @static + */ + public static function forgetScopedInstances() + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + $instance->forgetScopedInstances(); + } + /** + * Get the globally available instance of the container. + * + * @return static + * @static + */ + public static function getInstance() + { //Method inherited from \Illuminate\Container\Container + return \Illuminate\Foundation\Application::getInstance(); + } + /** + * Set the shared instance of the container. + * + * @param \Illuminate\Contracts\Container\Container|null $container + * @return \Illuminate\Contracts\Container\Container|static + * @static + */ + public static function setInstance($container = null) + { //Method inherited from \Illuminate\Container\Container + return \Illuminate\Foundation\Application::setInstance($container); + } + /** + * Determine if a given offset exists. + * + * @param string $key + * @return bool + * @static + */ + public static function offsetExists($key) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->offsetExists($key); + } + /** + * Get the value at a given offset. + * + * @param string $key + * @return mixed + * @static + */ + public static function offsetGet($key) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + return $instance->offsetGet($key); + } + /** + * Set the value at a given offset. + * + * @param string $key + * @param mixed $value + * @return void + * @static + */ + public static function offsetSet($key, $value) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + $instance->offsetSet($key, $value); + } + /** + * Unset the value at a given offset. + * + * @param string $key + * @return void + * @static + */ + public static function offsetUnset($key) + { //Method inherited from \Illuminate\Container\Container + /** @var \Illuminate\Foundation\Application $instance */ + $instance->offsetUnset($key); + } + + } + /** + * + * + * @see \Illuminate\Contracts\Console\Kernel + */ + class Artisan { + /** + * Run the console application. + * + * @param \Symfony\Component\Console\Input\InputInterface $input + * @param \Symfony\Component\Console\Output\OutputInterface|null $output + * @return int + * @static + */ + public static function handle($input, $output = null) + { //Method inherited from \Illuminate\Foundation\Console\Kernel + /** @var \App\Console\Kernel $instance */ + return $instance->handle($input, $output); + } + /** + * Terminate the application. + * + * @param \Symfony\Component\Console\Input\InputInterface $input + * @param int $status + * @return void + * @static + */ + public static function terminate($input, $status) + { //Method inherited from \Illuminate\Foundation\Console\Kernel + /** @var \App\Console\Kernel $instance */ + $instance->terminate($input, $status); + } + /** + * Register a Closure based command with the application. + * + * @param string $signature + * @param \Closure $callback + * @return \Illuminate\Foundation\Console\ClosureCommand + * @static + */ + public static function command($signature, $callback) + { //Method inherited from \Illuminate\Foundation\Console\Kernel + /** @var \App\Console\Kernel $instance */ + return $instance->command($signature, $callback); + } + /** + * Register the given command with the console application. + * + * @param \Symfony\Component\Console\Command\Command $command + * @return void + * @static + */ + public static function registerCommand($command) + { //Method inherited from \Illuminate\Foundation\Console\Kernel + /** @var \App\Console\Kernel $instance */ + $instance->registerCommand($command); + } + /** + * Run an Artisan console command by name. + * + * @param string $command + * @param array $parameters + * @param \Symfony\Component\Console\Output\OutputInterface|null $outputBuffer + * @return int + * @throws \Symfony\Component\Console\Exception\CommandNotFoundException + * @static + */ + public static function call($command, $parameters = [], $outputBuffer = null) + { //Method inherited from \Illuminate\Foundation\Console\Kernel + /** @var \App\Console\Kernel $instance */ + return $instance->call($command, $parameters, $outputBuffer); + } + /** + * Queue the given console command. + * + * @param string $command + * @param array $parameters + * @return \Illuminate\Foundation\Bus\PendingDispatch + * @static + */ + public static function queue($command, $parameters = []) + { //Method inherited from \Illuminate\Foundation\Console\Kernel + /** @var \App\Console\Kernel $instance */ + return $instance->queue($command, $parameters); + } + /** + * Get all of the commands registered with the console. + * + * @return array + * @static + */ + public static function all() + { //Method inherited from \Illuminate\Foundation\Console\Kernel + /** @var \App\Console\Kernel $instance */ + return $instance->all(); + } + /** + * Get the output for the last run command. + * + * @return string + * @static + */ + public static function output() + { //Method inherited from \Illuminate\Foundation\Console\Kernel + /** @var \App\Console\Kernel $instance */ + return $instance->output(); + } + /** + * Bootstrap the application for artisan commands. + * + * @return void + * @static + */ + public static function bootstrap() + { //Method inherited from \Illuminate\Foundation\Console\Kernel + /** @var \App\Console\Kernel $instance */ + $instance->bootstrap(); + } + /** + * Set the Artisan application instance. + * + * @param \Illuminate\Console\Application $artisan + * @return void + * @static + */ + public static function setArtisan($artisan) + { //Method inherited from \Illuminate\Foundation\Console\Kernel + /** @var \App\Console\Kernel $instance */ + $instance->setArtisan($artisan); + } + + } + /** + * + * + * @see \Illuminate\Auth\AuthManager + * @see \Illuminate\Contracts\Auth\Factory + * @see \Illuminate\Contracts\Auth\Guard + * @see \Illuminate\Contracts\Auth\StatefulGuard + */ + class Auth { + /** + * Attempt to get the guard from the local cache. + * + * @param string|null $name + * @return \Illuminate\Contracts\Auth\Guard|\Illuminate\Contracts\Auth\StatefulGuard + * @static + */ + public static function guard($name = null) + { + /** @var \Illuminate\Auth\AuthManager $instance */ + return $instance->guard($name); + } + /** + * Create a session based authentication guard. + * + * @param string $name + * @param array $config + * @return \Illuminate\Auth\SessionGuard + * @static + */ + public static function createSessionDriver($name, $config) + { + /** @var \Illuminate\Auth\AuthManager $instance */ + return $instance->createSessionDriver($name, $config); + } + /** + * Create a token based authentication guard. + * + * @param string $name + * @param array $config + * @return \Illuminate\Auth\TokenGuard + * @static + */ + public static function createTokenDriver($name, $config) + { + /** @var \Illuminate\Auth\AuthManager $instance */ + return $instance->createTokenDriver($name, $config); + } + /** + * Get the default authentication driver name. + * + * @return string + * @static + */ + public static function getDefaultDriver() + { + /** @var \Illuminate\Auth\AuthManager $instance */ + return $instance->getDefaultDriver(); + } + /** + * Set the default guard driver the factory should serve. + * + * @param string $name + * @return void + * @static + */ + public static function shouldUse($name) + { + /** @var \Illuminate\Auth\AuthManager $instance */ + $instance->shouldUse($name); + } + /** + * Set the default authentication driver name. + * + * @param string $name + * @return void + * @static + */ + public static function setDefaultDriver($name) + { + /** @var \Illuminate\Auth\AuthManager $instance */ + $instance->setDefaultDriver($name); + } + /** + * Register a new callback based request guard. + * + * @param string $driver + * @param callable $callback + * @return \Illuminate\Auth\AuthManager + * @static + */ + public static function viaRequest($driver, $callback) + { + /** @var \Illuminate\Auth\AuthManager $instance */ + return $instance->viaRequest($driver, $callback); + } + /** + * Get the user resolver callback. + * + * @return \Closure + * @static + */ + public static function userResolver() + { + /** @var \Illuminate\Auth\AuthManager $instance */ + return $instance->userResolver(); + } + /** + * Set the callback to be used to resolve users. + * + * @param \Closure $userResolver + * @return \Illuminate\Auth\AuthManager + * @static + */ + public static function resolveUsersUsing($userResolver) + { + /** @var \Illuminate\Auth\AuthManager $instance */ + return $instance->resolveUsersUsing($userResolver); + } + /** + * Register a custom driver creator Closure. + * + * @param string $driver + * @param \Closure $callback + * @return \Illuminate\Auth\AuthManager + * @static + */ + public static function extend($driver, $callback) + { + /** @var \Illuminate\Auth\AuthManager $instance */ + return $instance->extend($driver, $callback); + } + /** + * Register a custom provider creator Closure. + * + * @param string $name + * @param \Closure $callback + * @return \Illuminate\Auth\AuthManager + * @static + */ + public static function provider($name, $callback) + { + /** @var \Illuminate\Auth\AuthManager $instance */ + return $instance->provider($name, $callback); + } + /** + * Determines if any guards have already been resolved. + * + * @return bool + * @static + */ + public static function hasResolvedGuards() + { + /** @var \Illuminate\Auth\AuthManager $instance */ + return $instance->hasResolvedGuards(); + } + /** + * Forget all of the resolved guard instances. + * + * @return \Illuminate\Auth\AuthManager + * @static + */ + public static function forgetGuards() + { + /** @var \Illuminate\Auth\AuthManager $instance */ + return $instance->forgetGuards(); + } + /** + * Set the application instance used by the manager. + * + * @param \Illuminate\Contracts\Foundation\Application $app + * @return \Illuminate\Auth\AuthManager + * @static + */ + public static function setApplication($app) + { + /** @var \Illuminate\Auth\AuthManager $instance */ + return $instance->setApplication($app); + } + /** + * Create the user provider implementation for the driver. + * + * @param string|null $provider + * @return \Illuminate\Contracts\Auth\UserProvider|null + * @throws \InvalidArgumentException + * @static + */ + public static function createUserProvider($provider = null) + { + /** @var \Illuminate\Auth\AuthManager $instance */ + return $instance->createUserProvider($provider); + } + /** + * Get the default user provider name. + * + * @return string + * @static + */ + public static function getDefaultUserProvider() + { + /** @var \Illuminate\Auth\AuthManager $instance */ + return $instance->getDefaultUserProvider(); + } + /** + * Get the currently authenticated user. + * + * @return \App\User|null + * @static + */ + public static function user() + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->user(); + } + /** + * Get the ID for the currently authenticated user. + * + * @return int|string|null + * @static + */ + public static function id() + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->id(); + } + /** + * Log a user into the application without sessions or cookies. + * + * @param array $credentials + * @return bool + * @static + */ + public static function once($credentials = []) + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->once($credentials); + } + /** + * Log the given user ID into the application without sessions or cookies. + * + * @param mixed $id + * @return \App\User|false + * @static + */ + public static function onceUsingId($id) + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->onceUsingId($id); + } + /** + * Validate a user's credentials. + * + * @param array $credentials + * @return bool + * @static + */ + public static function validate($credentials = []) + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->validate($credentials); + } + /** + * Attempt to authenticate using HTTP Basic Auth. + * + * @param string $field + * @param array $extraConditions + * @return \Symfony\Component\HttpFoundation\Response|null + * @static + */ + public static function basic($field = 'email', $extraConditions = []) + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->basic($field, $extraConditions); + } + /** + * Perform a stateless HTTP Basic login attempt. + * + * @param string $field + * @param array $extraConditions + * @return \Symfony\Component\HttpFoundation\Response|null + * @static + */ + public static function onceBasic($field = 'email', $extraConditions = []) + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->onceBasic($field, $extraConditions); + } + /** + * Attempt to authenticate a user using the given credentials. + * + * @param array $credentials + * @param bool $remember + * @return bool + * @static + */ + public static function attempt($credentials = [], $remember = false) + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->attempt($credentials, $remember); + } + /** + * Attempt to authenticate a user with credentials and additional callbacks. + * + * @param array $credentials + * @param array|callable $callbacks + * @param false $remember + * @return bool + * @static + */ + public static function attemptWhen($credentials = [], $callbacks = null, $remember = false) + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->attemptWhen($credentials, $callbacks, $remember); + } + /** + * Log the given user ID into the application. + * + * @param mixed $id + * @param bool $remember + * @return \App\User|false + * @static + */ + public static function loginUsingId($id, $remember = false) + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->loginUsingId($id, $remember); + } + /** + * Log a user into the application. + * + * @param \Illuminate\Contracts\Auth\Authenticatable $user + * @param bool $remember + * @return void + * @static + */ + public static function login($user, $remember = false) + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + $instance->login($user, $remember); + } + /** + * Log the user out of the application. + * + * @return void + * @static + */ + public static function logout() + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + $instance->logout(); + } + /** + * Log the user out of the application on their current device only. + * + * This method does not cycle the "remember" token. + * + * @return void + * @static + */ + public static function logoutCurrentDevice() + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + $instance->logoutCurrentDevice(); + } + /** + * Invalidate other sessions for the current user. + * + * The application must be using the AuthenticateSession middleware. + * + * @param string $password + * @param string $attribute + * @return \App\User|null + * @throws \Illuminate\Auth\AuthenticationException + * @static + */ + public static function logoutOtherDevices($password, $attribute = 'password') + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->logoutOtherDevices($password, $attribute); + } + /** + * Register an authentication attempt event listener. + * + * @param mixed $callback + * @return void + * @static + */ + public static function attempting($callback) + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + $instance->attempting($callback); + } + /** + * Get the last user we attempted to authenticate. + * + * @return \App\User + * @static + */ + public static function getLastAttempted() + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->getLastAttempted(); + } + /** + * Get a unique identifier for the auth session value. + * + * @return string + * @static + */ + public static function getName() + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->getName(); + } + /** + * Get the name of the cookie used to store the "recaller". + * + * @return string + * @static + */ + public static function getRecallerName() + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->getRecallerName(); + } + /** + * Determine if the user was authenticated via "remember me" cookie. + * + * @return bool + * @static + */ + public static function viaRemember() + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->viaRemember(); + } + /** + * Set the number of minutes the remember me cookie should be valid for. + * + * @param int $minutes + * @return \Illuminate\Auth\SessionGuard + * @static + */ + public static function setRememberDuration($minutes) + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->setRememberDuration($minutes); + } + /** + * Get the cookie creator instance used by the guard. + * + * @return \Illuminate\Contracts\Cookie\QueueingFactory + * @throws \RuntimeException + * @static + */ + public static function getCookieJar() + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->getCookieJar(); + } + /** + * Set the cookie creator instance used by the guard. + * + * @param \Illuminate\Contracts\Cookie\QueueingFactory $cookie + * @return void + * @static + */ + public static function setCookieJar($cookie) + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + $instance->setCookieJar($cookie); + } + /** + * Get the event dispatcher instance. + * + * @return \Illuminate\Contracts\Events\Dispatcher + * @static + */ + public static function getDispatcher() + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->getDispatcher(); + } + /** + * Set the event dispatcher instance. + * + * @param \Illuminate\Contracts\Events\Dispatcher $events + * @return void + * @static + */ + public static function setDispatcher($events) + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + $instance->setDispatcher($events); + } + /** + * Get the session store used by the guard. + * + * @return \Illuminate\Contracts\Session\Session + * @static + */ + public static function getSession() + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->getSession(); + } + /** + * Return the currently cached user. + * + * @return \App\User|null + * @static + */ + public static function getUser() + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->getUser(); + } + /** + * Set the current user. + * + * @param \Illuminate\Contracts\Auth\Authenticatable $user + * @return \Illuminate\Auth\SessionGuard + * @static + */ + public static function setUser($user) + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->setUser($user); + } + /** + * Get the current request instance. + * + * @return \Symfony\Component\HttpFoundation\Request + * @static + */ + public static function getRequest() + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->getRequest(); + } + /** + * Set the current request instance. + * + * @param \Symfony\Component\HttpFoundation\Request $request + * @return \Illuminate\Auth\SessionGuard + * @static + */ + public static function setRequest($request) + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->setRequest($request); + } + /** + * Get the timebox instance used by the guard. + * + * @return \Illuminate\Support\Timebox + * @static + */ + public static function getTimebox() + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->getTimebox(); + } + /** + * Determine if the current user is authenticated. If not, throw an exception. + * + * @return \App\User + * @throws \Illuminate\Auth\AuthenticationException + * @static + */ + public static function authenticate() + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->authenticate(); + } + /** + * Determine if the guard has a user instance. + * + * @return bool + * @static + */ + public static function hasUser() + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->hasUser(); + } + /** + * Determine if the current user is authenticated. + * + * @return bool + * @static + */ + public static function check() + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->check(); + } + /** + * Determine if the current user is a guest. + * + * @return bool + * @static + */ + public static function guest() + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->guest(); + } + /** + * Get the user provider used by the guard. + * + * @return \Illuminate\Contracts\Auth\UserProvider + * @static + */ + public static function getProvider() + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + return $instance->getProvider(); + } + /** + * Set the user provider used by the guard. + * + * @param \Illuminate\Contracts\Auth\UserProvider $provider + * @return void + * @static + */ + public static function setProvider($provider) + { + /** @var \Illuminate\Auth\SessionGuard $instance */ + $instance->setProvider($provider); + } + /** + * Register a custom macro. + * + * @param string $name + * @param object|callable $macro + * @return void + * @static + */ + public static function macro($name, $macro) + { + \Illuminate\Auth\SessionGuard::macro($name, $macro); + } + /** + * Mix another object into the class. + * + * @param object $mixin + * @param bool $replace + * @return void + * @throws \ReflectionException + * @static + */ + public static function mixin($mixin, $replace = true) + { + \Illuminate\Auth\SessionGuard::mixin($mixin, $replace); + } + /** + * Checks if macro is registered. + * + * @param string $name + * @return bool + * @static + */ + public static function hasMacro($name) + { + return \Illuminate\Auth\SessionGuard::hasMacro($name); + } + /** + * Flush the existing macros. + * + * @return void + * @static + */ + public static function flushMacros() + { + \Illuminate\Auth\SessionGuard::flushMacros(); + } + + } + /** + * + * + * @see \Illuminate\View\Compilers\BladeCompiler + */ + class Blade { + /** + * Compile the view at the given path. + * + * @param string|null $path + * @return void + * @static + */ + public static function compile($path = null) + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + $instance->compile($path); + } + /** + * Get the path currently being compiled. + * + * @return string + * @static + */ + public static function getPath() + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + return $instance->getPath(); + } + /** + * Set the path currently being compiled. + * + * @param string $path + * @return void + * @static + */ + public static function setPath($path) + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + $instance->setPath($path); + } + /** + * Compile the given Blade template contents. + * + * @param string $value + * @return string + * @static + */ + public static function compileString($value) + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + return $instance->compileString($value); + } + /** + * Evaluate and render a Blade string to HTML. + * + * @param string $string + * @param array $data + * @param bool $deleteCachedView + * @return string + * @static + */ + public static function render($string, $data = [], $deleteCachedView = false) + { + return \Illuminate\View\Compilers\BladeCompiler::render($string, $data, $deleteCachedView); + } + /** + * Render a component instance to HTML. + * + * @param \Illuminate\View\Component $component + * @return string + * @static + */ + public static function renderComponent($component) + { + return \Illuminate\View\Compilers\BladeCompiler::renderComponent($component); + } + /** + * Strip the parentheses from the given expression. + * + * @param string $expression + * @return string + * @static + */ + public static function stripParentheses($expression) + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + return $instance->stripParentheses($expression); + } + /** + * Register a custom Blade compiler. + * + * @param callable $compiler + * @return void + * @static + */ + public static function extend($compiler) + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + $instance->extend($compiler); + } + /** + * Get the extensions used by the compiler. + * + * @return array + * @static + */ + public static function getExtensions() + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + return $instance->getExtensions(); + } + /** + * Register an "if" statement directive. + * + * @param string $name + * @param callable $callback + * @return void + * @static + */ + public static function if($name, $callback) + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + $instance->if($name, $callback); + } + /** + * Check the result of a condition. + * + * @param string $name + * @param array $parameters + * @return bool + * @static + */ + public static function check($name, ...$parameters) + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + return $instance->check($name, ...$parameters); + } + /** + * Register a class-based component alias directive. + * + * @param string $class + * @param string|null $alias + * @param string $prefix + * @return void + * @static + */ + public static function component($class, $alias = null, $prefix = '') + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + $instance->component($class, $alias, $prefix); + } + /** + * Register an array of class-based components. + * + * @param array $components + * @param string $prefix + * @return void + * @static + */ + public static function components($components, $prefix = '') + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + $instance->components($components, $prefix); + } + /** + * Get the registered class component aliases. + * + * @return array + * @static + */ + public static function getClassComponentAliases() + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + return $instance->getClassComponentAliases(); + } + /** + * Register a class-based component namespace. + * + * @param string $namespace + * @param string $prefix + * @return void + * @static + */ + public static function componentNamespace($namespace, $prefix) + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + $instance->componentNamespace($namespace, $prefix); + } + /** + * Get the registered class component namespaces. + * + * @return array + * @static + */ + public static function getClassComponentNamespaces() + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + return $instance->getClassComponentNamespaces(); + } + /** + * Register a component alias directive. + * + * @param string $path + * @param string|null $alias + * @return void + * @static + */ + public static function aliasComponent($path, $alias = null) + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + $instance->aliasComponent($path, $alias); + } + /** + * Register an include alias directive. + * + * @param string $path + * @param string|null $alias + * @return void + * @static + */ + public static function include($path, $alias = null) + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + $instance->include($path, $alias); + } + /** + * Register an include alias directive. + * + * @param string $path + * @param string|null $alias + * @return void + * @static + */ + public static function aliasInclude($path, $alias = null) + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + $instance->aliasInclude($path, $alias); + } + /** + * Register a handler for custom directives. + * + * @param string $name + * @param callable $handler + * @return void + * @throws \InvalidArgumentException + * @static + */ + public static function directive($name, $handler) + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + $instance->directive($name, $handler); + } + /** + * Get the list of custom directives. + * + * @return array + * @static + */ + public static function getCustomDirectives() + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + return $instance->getCustomDirectives(); + } + /** + * Register a new precompiler. + * + * @param callable $precompiler + * @return void + * @static + */ + public static function precompiler($precompiler) + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + $instance->precompiler($precompiler); + } + /** + * Set the echo format to be used by the compiler. + * + * @param string $format + * @return void + * @static + */ + public static function setEchoFormat($format) + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + $instance->setEchoFormat($format); + } + /** + * Set the "echo" format to double encode entities. + * + * @return void + * @static + */ + public static function withDoubleEncoding() + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + $instance->withDoubleEncoding(); + } + /** + * Set the "echo" format to not double encode entities. + * + * @return void + * @static + */ + public static function withoutDoubleEncoding() + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + $instance->withoutDoubleEncoding(); + } + /** + * Indicate that component tags should not be compiled. + * + * @return void + * @static + */ + public static function withoutComponentTags() + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + $instance->withoutComponentTags(); + } + /** + * Get the path to the compiled version of a view. + * + * @param string $path + * @return string + * @static + */ + public static function getCompiledPath($path) + { //Method inherited from \Illuminate\View\Compilers\Compiler + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + return $instance->getCompiledPath($path); + } + /** + * Determine if the view at the given path is expired. + * + * @param string $path + * @return bool + * @static + */ + public static function isExpired($path) + { //Method inherited from \Illuminate\View\Compilers\Compiler + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + return $instance->isExpired($path); + } + /** + * Get a new component hash for a component name. + * + * @param string $component + * @return string + * @static + */ + public static function newComponentHash($component) + { + return \Illuminate\View\Compilers\BladeCompiler::newComponentHash($component); + } + /** + * Compile a class component opening. + * + * @param string $component + * @param string $alias + * @param string $data + * @param string $hash + * @return string + * @static + */ + public static function compileClassComponentOpening($component, $alias, $data, $hash) + { + return \Illuminate\View\Compilers\BladeCompiler::compileClassComponentOpening($component, $alias, $data, $hash); + } + /** + * Compile the end-component statements into valid PHP. + * + * @return string + * @static + */ + public static function compileEndComponentClass() + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + return $instance->compileEndComponentClass(); + } + /** + * Sanitize the given component attribute value. + * + * @param mixed $value + * @return mixed + * @static + */ + public static function sanitizeComponentAttribute($value) + { + return \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($value); + } + /** + * Compile an end-once block into valid PHP. + * + * @return string + * @static + */ + public static function compileEndOnce() + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + return $instance->compileEndOnce(); + } + /** + * Add a handler to be executed before echoing a given class. + * + * @param string|callable $class + * @param callable|null $handler + * @return void + * @static + */ + public static function stringable($class, $handler = null) + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + $instance->stringable($class, $handler); + } + /** + * Compile Blade echos into valid PHP. + * + * @param string $value + * @return string + * @static + */ + public static function compileEchos($value) + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + return $instance->compileEchos($value); + } + /** + * Apply the echo handler for the value if it exists. + * + * @param string $value + * @return string + * @static + */ + public static function applyEchoHandler($value) + { + /** @var \Illuminate\View\Compilers\BladeCompiler $instance */ + return $instance->applyEchoHandler($value); + } + + } + /** + * + * + * @method static \Illuminate\Broadcasting\Broadcasters\Broadcaster channel(string $channel, callable|string $callback, array $options = []) + * @method static mixed auth(\Illuminate\Http\Request $request) + * @see \Illuminate\Contracts\Broadcasting\Factory + */ + class Broadcast { + /** + * Register the routes for handling broadcast authentication and sockets. + * + * @param array|null $attributes + * @return void + * @static + */ + public static function routes($attributes = null) + { + /** @var \Illuminate\Broadcasting\BroadcastManager $instance */ + $instance->routes($attributes); + } + /** + * Get the socket ID for the given request. + * + * @param \Illuminate\Http\Request|null $request + * @return string|null + * @static + */ + public static function socket($request = null) + { + /** @var \Illuminate\Broadcasting\BroadcastManager $instance */ + return $instance->socket($request); + } + /** + * Begin broadcasting an event. + * + * @param mixed|null $event + * @return \Illuminate\Broadcasting\PendingBroadcast + * @static + */ + public static function event($event = null) + { + /** @var \Illuminate\Broadcasting\BroadcastManager $instance */ + return $instance->event($event); + } + /** + * Queue the given event for broadcast. + * + * @param mixed $event + * @return void + * @static + */ + public static function queue($event) + { + /** @var \Illuminate\Broadcasting\BroadcastManager $instance */ + $instance->queue($event); + } + /** + * Get a driver instance. + * + * @param string|null $driver + * @return mixed + * @static + */ + public static function connection($driver = null) + { + /** @var \Illuminate\Broadcasting\BroadcastManager $instance */ + return $instance->connection($driver); + } + /** + * Get a driver instance. + * + * @param string|null $name + * @return mixed + * @static + */ + public static function driver($name = null) + { + /** @var \Illuminate\Broadcasting\BroadcastManager $instance */ + return $instance->driver($name); + } + /** + * Get the default driver name. + * + * @return string + * @static + */ + public static function getDefaultDriver() + { + /** @var \Illuminate\Broadcasting\BroadcastManager $instance */ + return $instance->getDefaultDriver(); + } + /** + * Set the default driver name. + * + * @param string $name + * @return void + * @static + */ + public static function setDefaultDriver($name) + { + /** @var \Illuminate\Broadcasting\BroadcastManager $instance */ + $instance->setDefaultDriver($name); + } + /** + * Disconnect the given disk and remove from local cache. + * + * @param string|null $name + * @return void + * @static + */ + public static function purge($name = null) + { + /** @var \Illuminate\Broadcasting\BroadcastManager $instance */ + $instance->purge($name); + } + /** + * Register a custom driver creator Closure. + * + * @param string $driver + * @param \Closure $callback + * @return \Illuminate\Broadcasting\BroadcastManager + * @static + */ + public static function extend($driver, $callback) + { + /** @var \Illuminate\Broadcasting\BroadcastManager $instance */ + return $instance->extend($driver, $callback); + } + /** + * Get the application instance used by the manager. + * + * @return \Illuminate\Contracts\Foundation\Application + * @static + */ + public static function getApplication() + { + /** @var \Illuminate\Broadcasting\BroadcastManager $instance */ + return $instance->getApplication(); + } + /** + * Set the application instance used by the manager. + * + * @param \Illuminate\Contracts\Foundation\Application $app + * @return \Illuminate\Broadcasting\BroadcastManager + * @static + */ + public static function setApplication($app) + { + /** @var \Illuminate\Broadcasting\BroadcastManager $instance */ + return $instance->setApplication($app); + } + /** + * Forget all of the resolved driver instances. + * + * @return \Illuminate\Broadcasting\BroadcastManager + * @static + */ + public static function forgetDrivers() + { + /** @var \Illuminate\Broadcasting\BroadcastManager $instance */ + return $instance->forgetDrivers(); + } + + } + /** + * + * + * @see \Illuminate\Contracts\Bus\Dispatcher + */ + class Bus { + /** + * Dispatch a command to its appropriate handler. + * + * @param mixed $command + * @return mixed + * @static + */ + public static function dispatch($command) + { + /** @var \Illuminate\Bus\Dispatcher $instance */ + return $instance->dispatch($command); + } + /** + * Dispatch a command to its appropriate handler in the current process. + * + * Queueable jobs will be dispatched to the "sync" queue. + * + * @param mixed $command + * @param mixed $handler + * @return mixed + * @static + */ + public static function dispatchSync($command, $handler = null) + { + /** @var \Illuminate\Bus\Dispatcher $instance */ + return $instance->dispatchSync($command, $handler); + } + /** + * Dispatch a command to its appropriate handler in the current process without using the synchronous queue. + * + * @param mixed $command + * @param mixed $handler + * @return mixed + * @static + */ + public static function dispatchNow($command, $handler = null) + { + /** @var \Illuminate\Bus\Dispatcher $instance */ + return $instance->dispatchNow($command, $handler); + } + /** + * Attempt to find the batch with the given ID. + * + * @param string $batchId + * @return \Illuminate\Bus\Batch|null + * @static + */ + public static function findBatch($batchId) + { + /** @var \Illuminate\Bus\Dispatcher $instance */ + return $instance->findBatch($batchId); + } + /** + * Create a new batch of queueable jobs. + * + * @param \Illuminate\Support\Collection|array|mixed $jobs + * @return \Illuminate\Bus\PendingBatch + * @static + */ + public static function batch($jobs) + { + /** @var \Illuminate\Bus\Dispatcher $instance */ + return $instance->batch($jobs); + } + /** + * Create a new chain of queueable jobs. + * + * @param \Illuminate\Support\Collection|array $jobs + * @return \Illuminate\Foundation\Bus\PendingChain + * @static + */ + public static function chain($jobs) + { + /** @var \Illuminate\Bus\Dispatcher $instance */ + return $instance->chain($jobs); + } + /** + * Determine if the given command has a handler. + * + * @param mixed $command + * @return bool + * @static + */ + public static function hasCommandHandler($command) + { + /** @var \Illuminate\Bus\Dispatcher $instance */ + return $instance->hasCommandHandler($command); + } + /** + * Retrieve the handler for a command. + * + * @param mixed $command + * @return bool|mixed + * @static + */ + public static function getCommandHandler($command) + { + /** @var \Illuminate\Bus\Dispatcher $instance */ + return $instance->getCommandHandler($command); + } + /** + * Dispatch a command to its appropriate handler behind a queue. + * + * @param mixed $command + * @return mixed + * @throws \RuntimeException + * @static + */ + public static function dispatchToQueue($command) + { + /** @var \Illuminate\Bus\Dispatcher $instance */ + return $instance->dispatchToQueue($command); + } + /** + * Dispatch a command to its appropriate handler after the current process. + * + * @param mixed $command + * @param mixed $handler + * @return void + * @static + */ + public static function dispatchAfterResponse($command, $handler = null) + { + /** @var \Illuminate\Bus\Dispatcher $instance */ + $instance->dispatchAfterResponse($command, $handler); + } + /** + * Set the pipes through which commands should be piped before dispatching. + * + * @param array $pipes + * @return \Illuminate\Bus\Dispatcher + * @static + */ + public static function pipeThrough($pipes) + { + /** @var \Illuminate\Bus\Dispatcher $instance */ + return $instance->pipeThrough($pipes); + } + /** + * Map a command to a handler. + * + * @param array $map + * @return \Illuminate\Bus\Dispatcher + * @static + */ + public static function map($map) + { + /** @var \Illuminate\Bus\Dispatcher $instance */ + return $instance->map($map); + } + /** + * Assert if a job was dispatched based on a truth-test callback. + * + * @param string|\Closure $command + * @param callable|int|null $callback + * @return void + * @static + */ + public static function assertDispatched($command, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */ + $instance->assertDispatched($command, $callback); + } + /** + * Assert if a job was pushed a number of times. + * + * @param string $command + * @param int $times + * @return void + * @static + */ + public static function assertDispatchedTimes($command, $times = 1) + { + /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */ + $instance->assertDispatchedTimes($command, $times); + } + /** + * Determine if a job was dispatched based on a truth-test callback. + * + * @param string|\Closure $command + * @param callable|null $callback + * @return void + * @static + */ + public static function assertNotDispatched($command, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */ + $instance->assertNotDispatched($command, $callback); + } + /** + * Assert that no jobs were dispatched. + * + * @return void + * @static + */ + public static function assertNothingDispatched() + { + /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */ + $instance->assertNothingDispatched(); + } + /** + * Assert if a job was explicitly dispatched synchronously based on a truth-test callback. + * + * @param string|\Closure $command + * @param callable|int|null $callback + * @return void + * @static + */ + public static function assertDispatchedSync($command, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */ + $instance->assertDispatchedSync($command, $callback); + } + /** + * Assert if a job was pushed synchronously a number of times. + * + * @param string $command + * @param int $times + * @return void + * @static + */ + public static function assertDispatchedSyncTimes($command, $times = 1) + { + /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */ + $instance->assertDispatchedSyncTimes($command, $times); + } + /** + * Determine if a job was dispatched based on a truth-test callback. + * + * @param string|\Closure $command + * @param callable|null $callback + * @return void + * @static + */ + public static function assertNotDispatchedSync($command, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */ + $instance->assertNotDispatchedSync($command, $callback); + } + /** + * Assert if a job was dispatched after the response was sent based on a truth-test callback. + * + * @param string|\Closure $command + * @param callable|int|null $callback + * @return void + * @static + */ + public static function assertDispatchedAfterResponse($command, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */ + $instance->assertDispatchedAfterResponse($command, $callback); + } + /** + * Assert if a job was pushed after the response was sent a number of times. + * + * @param string $command + * @param int $times + * @return void + * @static + */ + public static function assertDispatchedAfterResponseTimes($command, $times = 1) + { + /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */ + $instance->assertDispatchedAfterResponseTimes($command, $times); + } + /** + * Determine if a job was dispatched based on a truth-test callback. + * + * @param string|\Closure $command + * @param callable|null $callback + * @return void + * @static + */ + public static function assertNotDispatchedAfterResponse($command, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */ + $instance->assertNotDispatchedAfterResponse($command, $callback); + } + /** + * Assert if a chain of jobs was dispatched. + * + * @param array $expectedChain + * @return void + * @static + */ + public static function assertChained($expectedChain) + { + /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */ + $instance->assertChained($expectedChain); + } + /** + * Assert if a job was dispatched with an empty chain based on a truth-test callback. + * + * @param string|\Closure $command + * @param callable|null $callback + * @return void + * @static + */ + public static function assertDispatchedWithoutChain($command, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */ + $instance->assertDispatchedWithoutChain($command, $callback); + } + /** + * Assert if a batch was dispatched based on a truth-test callback. + * + * @param callable $callback + * @return void + * @static + */ + public static function assertBatched($callback) + { + /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */ + $instance->assertBatched($callback); + } + /** + * Assert the number of batches that have been dispatched. + * + * @param int $count + * @return void + * @static + */ + public static function assertBatchCount($count) + { + /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */ + $instance->assertBatchCount($count); + } + /** + * Get all of the jobs matching a truth-test callback. + * + * @param string $command + * @param callable|null $callback + * @return \Illuminate\Support\Collection + * @static + */ + public static function dispatched($command, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */ + return $instance->dispatched($command, $callback); + } + /** + * Get all of the jobs dispatched synchronously matching a truth-test callback. + * + * @param string $command + * @param callable|null $callback + * @return \Illuminate\Support\Collection + * @static + */ + public static function dispatchedSync($command, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */ + return $instance->dispatchedSync($command, $callback); + } + /** + * Get all of the jobs dispatched after the response was sent matching a truth-test callback. + * + * @param string $command + * @param callable|null $callback + * @return \Illuminate\Support\Collection + * @static + */ + public static function dispatchedAfterResponse($command, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */ + return $instance->dispatchedAfterResponse($command, $callback); + } + /** + * Get all of the pending batches matching a truth-test callback. + * + * @param callable $callback + * @return \Illuminate\Support\Collection + * @static + */ + public static function batched($callback) + { + /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */ + return $instance->batched($callback); + } + /** + * Determine if there are any stored commands for a given class. + * + * @param string $command + * @return bool + * @static + */ + public static function hasDispatched($command) + { + /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */ + return $instance->hasDispatched($command); + } + /** + * Determine if there are any stored commands for a given class. + * + * @param string $command + * @return bool + * @static + */ + public static function hasDispatchedSync($command) + { + /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */ + return $instance->hasDispatchedSync($command); + } + /** + * Determine if there are any stored commands for a given class. + * + * @param string $command + * @return bool + * @static + */ + public static function hasDispatchedAfterResponse($command) + { + /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */ + return $instance->hasDispatchedAfterResponse($command); + } + /** + * Record the fake pending batch dispatch. + * + * @param \Illuminate\Bus\PendingBatch $pendingBatch + * @return \Illuminate\Bus\Batch + * @static + */ + public static function recordPendingBatch($pendingBatch) + { + /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */ + return $instance->recordPendingBatch($pendingBatch); + } + + } + /** + * + * + * @see \Illuminate\Cache\CacheManager + * @see \Illuminate\Cache\Repository + */ + class Cache { + /** + * Get a cache store instance by name, wrapped in a repository. + * + * @param string|null $name + * @return \Illuminate\Contracts\Cache\Repository + * @static + */ + public static function store($name = null) + { + /** @var \Illuminate\Cache\CacheManager $instance */ + return $instance->store($name); + } + /** + * Get a cache driver instance. + * + * @param string|null $driver + * @return \Illuminate\Contracts\Cache\Repository + * @static + */ + public static function driver($driver = null) + { + /** @var \Illuminate\Cache\CacheManager $instance */ + return $instance->driver($driver); + } + /** + * Create a new cache repository with the given implementation. + * + * @param \Illuminate\Contracts\Cache\Store $store + * @return \Illuminate\Cache\Repository + * @static + */ + public static function repository($store) + { + /** @var \Illuminate\Cache\CacheManager $instance */ + return $instance->repository($store); + } + /** + * Re-set the event dispatcher on all resolved cache repositories. + * + * @return void + * @static + */ + public static function refreshEventDispatcher() + { + /** @var \Illuminate\Cache\CacheManager $instance */ + $instance->refreshEventDispatcher(); + } + /** + * Get the default cache driver name. + * + * @return string + * @static + */ + public static function getDefaultDriver() + { + /** @var \Illuminate\Cache\CacheManager $instance */ + return $instance->getDefaultDriver(); + } + /** + * Set the default cache driver name. + * + * @param string $name + * @return void + * @static + */ + public static function setDefaultDriver($name) + { + /** @var \Illuminate\Cache\CacheManager $instance */ + $instance->setDefaultDriver($name); + } + /** + * Unset the given driver instances. + * + * @param array|string|null $name + * @return \Illuminate\Cache\CacheManager + * @static + */ + public static function forgetDriver($name = null) + { + /** @var \Illuminate\Cache\CacheManager $instance */ + return $instance->forgetDriver($name); + } + /** + * Disconnect the given driver and remove from local cache. + * + * @param string|null $name + * @return void + * @static + */ + public static function purge($name = null) + { + /** @var \Illuminate\Cache\CacheManager $instance */ + $instance->purge($name); + } + /** + * Register a custom driver creator Closure. + * + * @param string $driver + * @param \Closure $callback + * @return \Illuminate\Cache\CacheManager + * @static + */ + public static function extend($driver, $callback) + { + /** @var \Illuminate\Cache\CacheManager $instance */ + return $instance->extend($driver, $callback); + } + /** + * Determine if an item exists in the cache. + * + * @param string $key + * @return bool + * @static + */ + public static function has($key) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->has($key); + } + /** + * Determine if an item doesn't exist in the cache. + * + * @param string $key + * @return bool + * @static + */ + public static function missing($key) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->missing($key); + } + /** + * Retrieve an item from the cache by key. + * + * @param string $key + * @param mixed $default + * @return mixed + * @static + */ + public static function get($key, $default = null) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->get($key, $default); + } + /** + * Retrieve multiple items from the cache by key. + * + * Items not found in the cache will have a null value. + * + * @param array $keys + * @return array + * @static + */ + public static function many($keys) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->many($keys); + } + /** + * Obtains multiple cache items by their unique keys. + * + * @return \Illuminate\Cache\iterable + * @param \Psr\SimpleCache\iterable $keys A list of keys that can obtained in a single operation. + * @param mixed $default Default value to return for keys that do not exist. + * @return \Psr\SimpleCache\iterable A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value. + * @throws \Psr\SimpleCache\InvalidArgumentException + * MUST be thrown if $keys is neither an array nor a Traversable, + * or if any of the $keys are not a legal value. + * @static + */ + public static function getMultiple($keys, $default = null) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->getMultiple($keys, $default); + } + /** + * Retrieve an item from the cache and delete it. + * + * @param string $key + * @param mixed $default + * @return mixed + * @static + */ + public static function pull($key, $default = null) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->pull($key, $default); + } + /** + * Store an item in the cache. + * + * @param string $key + * @param mixed $value + * @param \DateTimeInterface|\DateInterval|int|null $ttl + * @return bool + * @static + */ + public static function put($key, $value, $ttl = null) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->put($key, $value, $ttl); + } + /** + * Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time. + * + * @return bool + * @param string $key The key of the item to store. + * @param mixed $value The value of the item to store, must be serializable. + * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and + * the driver supports TTL then the library may set a default value + * for it or let the driver take care of that. + * @return bool True on success and false on failure. + * @throws \Psr\SimpleCache\InvalidArgumentException + * MUST be thrown if the $key string is not a legal value. + * @static + */ + public static function set($key, $value, $ttl = null) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->set($key, $value, $ttl); + } + /** + * Store multiple items in the cache for a given number of seconds. + * + * @param array $values + * @param \DateTimeInterface|\DateInterval|int|null $ttl + * @return bool + * @static + */ + public static function putMany($values, $ttl = null) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->putMany($values, $ttl); + } + /** + * Persists a set of key => value pairs in the cache, with an optional TTL. + * + * @return bool + * @param \Psr\SimpleCache\iterable $values A list of key => value pairs for a multiple-set operation. + * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and + * the driver supports TTL then the library may set a default value + * for it or let the driver take care of that. + * @return bool True on success and false on failure. + * @throws \Psr\SimpleCache\InvalidArgumentException + * MUST be thrown if $values is neither an array nor a Traversable, + * or if any of the $values are not a legal value. + * @static + */ + public static function setMultiple($values, $ttl = null) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->setMultiple($values, $ttl); + } + /** + * Store an item in the cache if the key does not exist. + * + * @param string $key + * @param mixed $value + * @param \DateTimeInterface|\DateInterval|int|null $ttl + * @return bool + * @static + */ + public static function add($key, $value, $ttl = null) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->add($key, $value, $ttl); + } + /** + * Increment the value of an item in the cache. + * + * @param string $key + * @param mixed $value + * @return int|bool + * @static + */ + public static function increment($key, $value = 1) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->increment($key, $value); + } + /** + * Decrement the value of an item in the cache. + * + * @param string $key + * @param mixed $value + * @return int|bool + * @static + */ + public static function decrement($key, $value = 1) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->decrement($key, $value); + } + /** + * Store an item in the cache indefinitely. + * + * @param string $key + * @param mixed $value + * @return bool + * @static + */ + public static function forever($key, $value) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->forever($key, $value); + } + /** + * Get an item from the cache, or execute the given Closure and store the result. + * + * @param string $key + * @param \Closure|\DateTimeInterface|\DateInterval|int|null $ttl + * @param \Closure $callback + * @return mixed + * @static + */ + public static function remember($key, $ttl, $callback) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->remember($key, $ttl, $callback); + } + /** + * Get an item from the cache, or execute the given Closure and store the result forever. + * + * @param string $key + * @param \Closure $callback + * @return mixed + * @static + */ + public static function sear($key, $callback) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->sear($key, $callback); + } + /** + * Get an item from the cache, or execute the given Closure and store the result forever. + * + * @param string $key + * @param \Closure $callback + * @return mixed + * @static + */ + public static function rememberForever($key, $callback) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->rememberForever($key, $callback); + } + /** + * Remove an item from the cache. + * + * @param string $key + * @return bool + * @static + */ + public static function forget($key) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->forget($key); + } + /** + * Delete an item from the cache by its unique key. + * + * @return bool + * @param string $key The unique cache key of the item to delete. + * @return bool True if the item was successfully removed. False if there was an error. + * @throws \Psr\SimpleCache\InvalidArgumentException + * MUST be thrown if the $key string is not a legal value. + * @static + */ + public static function delete($key) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->delete($key); + } + /** + * Deletes multiple cache items in a single operation. + * + * @return bool + * @param \Psr\SimpleCache\iterable $keys A list of string-based keys to be deleted. + * @return bool True if the items were successfully removed. False if there was an error. + * @throws \Psr\SimpleCache\InvalidArgumentException + * MUST be thrown if $keys is neither an array nor a Traversable, + * or if any of the $keys are not a legal value. + * @static + */ + public static function deleteMultiple($keys) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->deleteMultiple($keys); + } + /** + * Wipes clean the entire cache's keys. + * + * @return bool + * @return bool True on success and false on failure. + * @static + */ + public static function clear() + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->clear(); + } + /** + * Begin executing a new tags operation if the store supports it. + * + * @param array|mixed $names + * @return \Illuminate\Cache\TaggedCache + * @throws \BadMethodCallException + * @static + */ + public static function tags($names) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->tags($names); + } + /** + * Determine if the current store supports tags. + * + * @return bool + * @static + */ + public static function supportsTags() + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->supportsTags(); + } + /** + * Get the default cache time. + * + * @return int|null + * @static + */ + public static function getDefaultCacheTime() + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->getDefaultCacheTime(); + } + /** + * Set the default cache time in seconds. + * + * @param int|null $seconds + * @return \Illuminate\Cache\Repository + * @static + */ + public static function setDefaultCacheTime($seconds) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->setDefaultCacheTime($seconds); + } + /** + * Get the cache store implementation. + * + * @return \Illuminate\Contracts\Cache\Store + * @static + */ + public static function getStore() + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->getStore(); + } + /** + * Get the event dispatcher instance. + * + * @return \Illuminate\Contracts\Events\Dispatcher + * @static + */ + public static function getEventDispatcher() + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->getEventDispatcher(); + } + /** + * Set the event dispatcher instance. + * + * @param \Illuminate\Contracts\Events\Dispatcher $events + * @return void + * @static + */ + public static function setEventDispatcher($events) + { + /** @var \Illuminate\Cache\Repository $instance */ + $instance->setEventDispatcher($events); + } + /** + * Determine if a cached value exists. + * + * @param string $key + * @return bool + * @static + */ + public static function offsetExists($key) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->offsetExists($key); + } + /** + * Retrieve an item from the cache by key. + * + * @param string $key + * @return mixed + * @static + */ + public static function offsetGet($key) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->offsetGet($key); + } + /** + * Store an item in the cache for the default time. + * + * @param string $key + * @param mixed $value + * @return void + * @static + */ + public static function offsetSet($key, $value) + { + /** @var \Illuminate\Cache\Repository $instance */ + $instance->offsetSet($key, $value); + } + /** + * Remove an item from the cache. + * + * @param string $key + * @return void + * @static + */ + public static function offsetUnset($key) + { + /** @var \Illuminate\Cache\Repository $instance */ + $instance->offsetUnset($key); + } + /** + * Register a custom macro. + * + * @param string $name + * @param object|callable $macro + * @return void + * @static + */ + public static function macro($name, $macro) + { + \Illuminate\Cache\Repository::macro($name, $macro); + } + /** + * Mix another object into the class. + * + * @param object $mixin + * @param bool $replace + * @return void + * @throws \ReflectionException + * @static + */ + public static function mixin($mixin, $replace = true) + { + \Illuminate\Cache\Repository::mixin($mixin, $replace); + } + /** + * Checks if macro is registered. + * + * @param string $name + * @return bool + * @static + */ + public static function hasMacro($name) + { + return \Illuminate\Cache\Repository::hasMacro($name); + } + /** + * Flush the existing macros. + * + * @return void + * @static + */ + public static function flushMacros() + { + \Illuminate\Cache\Repository::flushMacros(); + } + /** + * Dynamically handle calls to the class. + * + * @param string $method + * @param array $parameters + * @return mixed + * @throws \BadMethodCallException + * @static + */ + public static function macroCall($method, $parameters) + { + /** @var \Illuminate\Cache\Repository $instance */ + return $instance->macroCall($method, $parameters); + } + /** + * Remove all items from the cache. + * + * @return bool + * @static + */ + public static function flush() + { + /** @var \Illuminate\Cache\FileStore $instance */ + return $instance->flush(); + } + /** + * Get the Filesystem instance. + * + * @return \Illuminate\Filesystem\Filesystem + * @static + */ + public static function getFilesystem() + { + /** @var \Illuminate\Cache\FileStore $instance */ + return $instance->getFilesystem(); + } + /** + * Get the working directory of the cache. + * + * @return string + * @static + */ + public static function getDirectory() + { + /** @var \Illuminate\Cache\FileStore $instance */ + return $instance->getDirectory(); + } + /** + * Get the cache key prefix. + * + * @return string + * @static + */ + public static function getPrefix() + { + /** @var \Illuminate\Cache\FileStore $instance */ + return $instance->getPrefix(); + } + /** + * Get a lock instance. + * + * @param string $name + * @param int $seconds + * @param string|null $owner + * @return \Illuminate\Contracts\Cache\Lock + * @static + */ + public static function lock($name, $seconds = 0, $owner = null) + { + /** @var \Illuminate\Cache\FileStore $instance */ + return $instance->lock($name, $seconds, $owner); + } + /** + * Restore a lock instance using the owner identifier. + * + * @param string $name + * @param string $owner + * @return \Illuminate\Contracts\Cache\Lock + * @static + */ + public static function restoreLock($name, $owner) + { + /** @var \Illuminate\Cache\FileStore $instance */ + return $instance->restoreLock($name, $owner); + } + + } + /** + * + * + * @see \Illuminate\Config\Repository + */ + class Config { + /** + * Determine if the given configuration value exists. + * + * @param string $key + * @return bool + * @static + */ + public static function has($key) + { + /** @var \Illuminate\Config\Repository $instance */ + return $instance->has($key); + } + /** + * Get the specified configuration value. + * + * @param array|string $key + * @param mixed $default + * @return mixed + * @static + */ + public static function get($key, $default = null) + { + /** @var \Illuminate\Config\Repository $instance */ + return $instance->get($key, $default); + } + /** + * Get many configuration values. + * + * @param array $keys + * @return array + * @static + */ + public static function getMany($keys) + { + /** @var \Illuminate\Config\Repository $instance */ + return $instance->getMany($keys); + } + /** + * Set a given configuration value. + * + * @param array|string $key + * @param mixed $value + * @return void + * @static + */ + public static function set($key, $value = null) + { + /** @var \Illuminate\Config\Repository $instance */ + $instance->set($key, $value); + } + /** + * Prepend a value onto an array configuration value. + * + * @param string $key + * @param mixed $value + * @return void + * @static + */ + public static function prepend($key, $value) + { + /** @var \Illuminate\Config\Repository $instance */ + $instance->prepend($key, $value); + } + /** + * Push a value onto an array configuration value. + * + * @param string $key + * @param mixed $value + * @return void + * @static + */ + public static function push($key, $value) + { + /** @var \Illuminate\Config\Repository $instance */ + $instance->push($key, $value); + } + /** + * Get all of the configuration items for the application. + * + * @return array + * @static + */ + public static function all() + { + /** @var \Illuminate\Config\Repository $instance */ + return $instance->all(); + } + /** + * Determine if the given configuration option exists. + * + * @param string $key + * @return bool + * @static + */ + public static function offsetExists($key) + { + /** @var \Illuminate\Config\Repository $instance */ + return $instance->offsetExists($key); + } + /** + * Get a configuration option. + * + * @param string $key + * @return mixed + * @static + */ + public static function offsetGet($key) + { + /** @var \Illuminate\Config\Repository $instance */ + return $instance->offsetGet($key); + } + /** + * Set a configuration option. + * + * @param string $key + * @param mixed $value + * @return void + * @static + */ + public static function offsetSet($key, $value) + { + /** @var \Illuminate\Config\Repository $instance */ + $instance->offsetSet($key, $value); + } + /** + * Unset a configuration option. + * + * @param string $key + * @return void + * @static + */ + public static function offsetUnset($key) + { + /** @var \Illuminate\Config\Repository $instance */ + $instance->offsetUnset($key); + } + + } + /** + * + * + * @see \Illuminate\Cookie\CookieJar + */ + class Cookie { + /** + * Create a new cookie instance. + * + * @param string $name + * @param string $value + * @param int $minutes + * @param string|null $path + * @param string|null $domain + * @param bool|null $secure + * @param bool $httpOnly + * @param bool $raw + * @param string|null $sameSite + * @return \Symfony\Component\HttpFoundation\Cookie + * @static + */ + public static function make($name, $value, $minutes = 0, $path = null, $domain = null, $secure = null, $httpOnly = true, $raw = false, $sameSite = null) + { + /** @var \Illuminate\Cookie\CookieJar $instance */ + return $instance->make($name, $value, $minutes, $path, $domain, $secure, $httpOnly, $raw, $sameSite); + } + /** + * Create a cookie that lasts "forever" (five years). + * + * @param string $name + * @param string $value + * @param string|null $path + * @param string|null $domain + * @param bool|null $secure + * @param bool $httpOnly + * @param bool $raw + * @param string|null $sameSite + * @return \Symfony\Component\HttpFoundation\Cookie + * @static + */ + public static function forever($name, $value, $path = null, $domain = null, $secure = null, $httpOnly = true, $raw = false, $sameSite = null) + { + /** @var \Illuminate\Cookie\CookieJar $instance */ + return $instance->forever($name, $value, $path, $domain, $secure, $httpOnly, $raw, $sameSite); + } + /** + * Expire the given cookie. + * + * @param string $name + * @param string|null $path + * @param string|null $domain + * @return \Symfony\Component\HttpFoundation\Cookie + * @static + */ + public static function forget($name, $path = null, $domain = null) + { + /** @var \Illuminate\Cookie\CookieJar $instance */ + return $instance->forget($name, $path, $domain); + } + /** + * Determine if a cookie has been queued. + * + * @param string $key + * @param string|null $path + * @return bool + * @static + */ + public static function hasQueued($key, $path = null) + { + /** @var \Illuminate\Cookie\CookieJar $instance */ + return $instance->hasQueued($key, $path); + } + /** + * Get a queued cookie instance. + * + * @param string $key + * @param mixed $default + * @param string|null $path + * @return \Symfony\Component\HttpFoundation\Cookie|null + * @static + */ + public static function queued($key, $default = null, $path = null) + { + /** @var \Illuminate\Cookie\CookieJar $instance */ + return $instance->queued($key, $default, $path); + } + /** + * Queue a cookie to send with the next response. + * + * @param array $parameters + * @return void + * @static + */ + public static function queue(...$parameters) + { + /** @var \Illuminate\Cookie\CookieJar $instance */ + $instance->queue(...$parameters); + } + /** + * Queue a cookie to expire with the next response. + * + * @param string $name + * @param string|null $path + * @param string|null $domain + * @return void + * @static + */ + public static function expire($name, $path = null, $domain = null) + { + /** @var \Illuminate\Cookie\CookieJar $instance */ + $instance->expire($name, $path, $domain); + } + /** + * Remove a cookie from the queue. + * + * @param string $name + * @param string|null $path + * @return void + * @static + */ + public static function unqueue($name, $path = null) + { + /** @var \Illuminate\Cookie\CookieJar $instance */ + $instance->unqueue($name, $path); + } + /** + * Set the default path and domain for the jar. + * + * @param string $path + * @param string $domain + * @param bool $secure + * @param string|null $sameSite + * @return \Illuminate\Cookie\CookieJar + * @static + */ + public static function setDefaultPathAndDomain($path, $domain, $secure = false, $sameSite = null) + { + /** @var \Illuminate\Cookie\CookieJar $instance */ + return $instance->setDefaultPathAndDomain($path, $domain, $secure, $sameSite); + } + /** + * Get the cookies which have been queued for the next request. + * + * @return \Symfony\Component\HttpFoundation\Cookie[] + * @static + */ + public static function getQueuedCookies() + { + /** @var \Illuminate\Cookie\CookieJar $instance */ + return $instance->getQueuedCookies(); + } + /** + * Flush the cookies which have been queued for the next request. + * + * @return \Illuminate\Cookie\CookieJar + * @static + */ + public static function flushQueuedCookies() + { + /** @var \Illuminate\Cookie\CookieJar $instance */ + return $instance->flushQueuedCookies(); + } + /** + * Register a custom macro. + * + * @param string $name + * @param object|callable $macro + * @return void + * @static + */ + public static function macro($name, $macro) + { + \Illuminate\Cookie\CookieJar::macro($name, $macro); + } + /** + * Mix another object into the class. + * + * @param object $mixin + * @param bool $replace + * @return void + * @throws \ReflectionException + * @static + */ + public static function mixin($mixin, $replace = true) + { + \Illuminate\Cookie\CookieJar::mixin($mixin, $replace); + } + /** + * Checks if macro is registered. + * + * @param string $name + * @return bool + * @static + */ + public static function hasMacro($name) + { + return \Illuminate\Cookie\CookieJar::hasMacro($name); + } + /** + * Flush the existing macros. + * + * @return void + * @static + */ + public static function flushMacros() + { + \Illuminate\Cookie\CookieJar::flushMacros(); + } + + } + /** + * + * + * @see \Illuminate\Encryption\Encrypter + */ + class Crypt { + /** + * Determine if the given key and cipher combination is valid. + * + * @param string $key + * @param string $cipher + * @return bool + * @static + */ + public static function supported($key, $cipher) + { + return \Illuminate\Encryption\Encrypter::supported($key, $cipher); + } + /** + * Create a new encryption key for the given cipher. + * + * @param string $cipher + * @return string + * @static + */ + public static function generateKey($cipher) + { + return \Illuminate\Encryption\Encrypter::generateKey($cipher); + } + /** + * Encrypt the given value. + * + * @param mixed $value + * @param bool $serialize + * @return string + * @throws \Illuminate\Contracts\Encryption\EncryptException + * @static + */ + public static function encrypt($value, $serialize = true) + { + /** @var \Illuminate\Encryption\Encrypter $instance */ + return $instance->encrypt($value, $serialize); + } + /** + * Encrypt a string without serialization. + * + * @param string $value + * @return string + * @throws \Illuminate\Contracts\Encryption\EncryptException + * @static + */ + public static function encryptString($value) + { + /** @var \Illuminate\Encryption\Encrypter $instance */ + return $instance->encryptString($value); + } + /** + * Decrypt the given value. + * + * @param string $payload + * @param bool $unserialize + * @return mixed + * @throws \Illuminate\Contracts\Encryption\DecryptException + * @static + */ + public static function decrypt($payload, $unserialize = true) + { + /** @var \Illuminate\Encryption\Encrypter $instance */ + return $instance->decrypt($payload, $unserialize); + } + /** + * Decrypt the given string without unserialization. + * + * @param string $payload + * @return string + * @throws \Illuminate\Contracts\Encryption\DecryptException + * @static + */ + public static function decryptString($payload) + { + /** @var \Illuminate\Encryption\Encrypter $instance */ + return $instance->decryptString($payload); + } + /** + * Get the encryption key. + * + * @return string + * @static + */ + public static function getKey() + { + /** @var \Illuminate\Encryption\Encrypter $instance */ + return $instance->getKey(); + } + + } + /** + * + * + * @see \Illuminate\Database\DatabaseManager + * @see \Illuminate\Database\Connection + */ + class DB { + /** + * Get a database connection instance. + * + * @param string|null $name + * @return \Illuminate\Database\Connection + * @static + */ + public static function connection($name = null) + { + /** @var \Illuminate\Database\DatabaseManager $instance */ + return $instance->connection($name); + } + /** + * Register a custom Doctrine type. + * + * @param string $class + * @param string $name + * @param string $type + * @return void + * @throws \Doctrine\DBAL\DBALException + * @throws \RuntimeException + * @static + */ + public static function registerDoctrineType($class, $name, $type) + { + /** @var \Illuminate\Database\DatabaseManager $instance */ + $instance->registerDoctrineType($class, $name, $type); + } + /** + * Disconnect from the given database and remove from local cache. + * + * @param string|null $name + * @return void + * @static + */ + public static function purge($name = null) + { + /** @var \Illuminate\Database\DatabaseManager $instance */ + $instance->purge($name); + } + /** + * Disconnect from the given database. + * + * @param string|null $name + * @return void + * @static + */ + public static function disconnect($name = null) + { + /** @var \Illuminate\Database\DatabaseManager $instance */ + $instance->disconnect($name); + } + /** + * Reconnect to the given database. + * + * @param string|null $name + * @return \Illuminate\Database\Connection + * @static + */ + public static function reconnect($name = null) + { + /** @var \Illuminate\Database\DatabaseManager $instance */ + return $instance->reconnect($name); + } + /** + * Set the default database connection for the callback execution. + * + * @param string $name + * @param callable $callback + * @return mixed + * @static + */ + public static function usingConnection($name, $callback) + { + /** @var \Illuminate\Database\DatabaseManager $instance */ + return $instance->usingConnection($name, $callback); + } + /** + * Get the default connection name. + * + * @return string + * @static + */ + public static function getDefaultConnection() + { + /** @var \Illuminate\Database\DatabaseManager $instance */ + return $instance->getDefaultConnection(); + } + /** + * Set the default connection name. + * + * @param string $name + * @return void + * @static + */ + public static function setDefaultConnection($name) + { + /** @var \Illuminate\Database\DatabaseManager $instance */ + $instance->setDefaultConnection($name); + } + /** + * Get all of the support drivers. + * + * @return array + * @static + */ + public static function supportedDrivers() + { + /** @var \Illuminate\Database\DatabaseManager $instance */ + return $instance->supportedDrivers(); + } + /** + * Get all of the drivers that are actually available. + * + * @return array + * @static + */ + public static function availableDrivers() + { + /** @var \Illuminate\Database\DatabaseManager $instance */ + return $instance->availableDrivers(); + } + /** + * Register an extension connection resolver. + * + * @param string $name + * @param callable $resolver + * @return void + * @static + */ + public static function extend($name, $resolver) + { + /** @var \Illuminate\Database\DatabaseManager $instance */ + $instance->extend($name, $resolver); + } + /** + * Return all of the created connections. + * + * @return array + * @static + */ + public static function getConnections() + { + /** @var \Illuminate\Database\DatabaseManager $instance */ + return $instance->getConnections(); + } + /** + * Set the database reconnector callback. + * + * @param callable $reconnector + * @return void + * @static + */ + public static function setReconnector($reconnector) + { + /** @var \Illuminate\Database\DatabaseManager $instance */ + $instance->setReconnector($reconnector); + } + /** + * Set the application instance used by the manager. + * + * @param \Illuminate\Contracts\Foundation\Application $app + * @return \Illuminate\Database\DatabaseManager + * @static + */ + public static function setApplication($app) + { + /** @var \Illuminate\Database\DatabaseManager $instance */ + return $instance->setApplication($app); + } + /** + * Get a schema builder instance for the connection. + * + * @return \Illuminate\Database\Schema\SQLiteBuilder + * @static + */ + public static function getSchemaBuilder() + { + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->getSchemaBuilder(); + } + /** + * Get the schema state for the connection. + * + * @param \Illuminate\Filesystem\Filesystem|null $files + * @param callable|null $processFactory + * @throws \RuntimeException + * @static + */ + public static function getSchemaState($files = null, $processFactory = null) + { + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->getSchemaState($files, $processFactory); + } + /** + * Set the query grammar to the default implementation. + * + * @return void + * @static + */ + public static function useDefaultQueryGrammar() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + $instance->useDefaultQueryGrammar(); + } + /** + * Set the schema grammar to the default implementation. + * + * @return void + * @static + */ + public static function useDefaultSchemaGrammar() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + $instance->useDefaultSchemaGrammar(); + } + /** + * Set the query post processor to the default implementation. + * + * @return void + * @static + */ + public static function useDefaultPostProcessor() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + $instance->useDefaultPostProcessor(); + } + /** + * Begin a fluent query against a database table. + * + * @param \Closure|\Illuminate\Database\Query\Builder|string $table + * @param string|null $as + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function table($table, $as = null) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->table($table, $as); + } + /** + * Get a new query builder instance. + * + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function query() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->query(); + } + /** + * Run a select statement and return a single result. + * + * @param string $query + * @param array $bindings + * @param bool $useReadPdo + * @return mixed + * @static + */ + public static function selectOne($query, $bindings = [], $useReadPdo = true) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->selectOne($query, $bindings, $useReadPdo); + } + /** + * Run a select statement against the database. + * + * @param string $query + * @param array $bindings + * @return array + * @static + */ + public static function selectFromWriteConnection($query, $bindings = []) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->selectFromWriteConnection($query, $bindings); + } + /** + * Run a select statement against the database. + * + * @param string $query + * @param array $bindings + * @param bool $useReadPdo + * @return array + * @static + */ + public static function select($query, $bindings = [], $useReadPdo = true) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->select($query, $bindings, $useReadPdo); + } + /** + * Run a select statement against the database and returns a generator. + * + * @param string $query + * @param array $bindings + * @param bool $useReadPdo + * @return \Generator + * @static + */ + public static function cursor($query, $bindings = [], $useReadPdo = true) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->cursor($query, $bindings, $useReadPdo); + } + /** + * Run an insert statement against the database. + * + * @param string $query + * @param array $bindings + * @return bool + * @static + */ + public static function insert($query, $bindings = []) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->insert($query, $bindings); + } + /** + * Run an update statement against the database. + * + * @param string $query + * @param array $bindings + * @return int + * @static + */ + public static function update($query, $bindings = []) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->update($query, $bindings); + } + /** + * Run a delete statement against the database. + * + * @param string $query + * @param array $bindings + * @return int + * @static + */ + public static function delete($query, $bindings = []) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->delete($query, $bindings); + } + /** + * Execute an SQL statement and return the boolean result. + * + * @param string $query + * @param array $bindings + * @return bool + * @static + */ + public static function statement($query, $bindings = []) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->statement($query, $bindings); + } + /** + * Run an SQL statement and get the number of rows affected. + * + * @param string $query + * @param array $bindings + * @return int + * @static + */ + public static function affectingStatement($query, $bindings = []) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->affectingStatement($query, $bindings); + } + /** + * Run a raw, unprepared query against the PDO connection. + * + * @param string $query + * @return bool + * @static + */ + public static function unprepared($query) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->unprepared($query); + } + /** + * Execute the given callback in "dry run" mode. + * + * @param \Closure $callback + * @return array + * @static + */ + public static function pretend($callback) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->pretend($callback); + } + /** + * Bind values to their parameters in the given statement. + * + * @param \PDOStatement $statement + * @param array $bindings + * @return void + * @static + */ + public static function bindValues($statement, $bindings) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + $instance->bindValues($statement, $bindings); + } + /** + * Prepare the query bindings for execution. + * + * @param array $bindings + * @return array + * @static + */ + public static function prepareBindings($bindings) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->prepareBindings($bindings); + } + /** + * Log a query in the connection's query log. + * + * @param string $query + * @param array $bindings + * @param float|null $time + * @return void + * @static + */ + public static function logQuery($query, $bindings, $time = null) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + $instance->logQuery($query, $bindings, $time); + } + /** + * Register a hook to be run just before a database query is executed. + * + * @param \Closure $callback + * @return \Illuminate\Database\SQLiteConnection + * @static + */ + public static function beforeExecuting($callback) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->beforeExecuting($callback); + } + /** + * Register a database query listener with the connection. + * + * @param \Closure $callback + * @return void + * @static + */ + public static function listen($callback) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + $instance->listen($callback); + } + /** + * Get a new raw query expression. + * + * @param mixed $value + * @return \Illuminate\Database\Query\Expression + * @static + */ + public static function raw($value) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->raw($value); + } + /** + * Determine if the database connection has modified any database records. + * + * @return bool + * @static + */ + public static function hasModifiedRecords() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->hasModifiedRecords(); + } + /** + * Indicate if any records have been modified. + * + * @param bool $value + * @return void + * @static + */ + public static function recordsHaveBeenModified($value = true) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + $instance->recordsHaveBeenModified($value); + } + /** + * Set the record modification state. + * + * @param bool $value + * @return \Illuminate\Database\SQLiteConnection + * @static + */ + public static function setRecordModificationState($value) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->setRecordModificationState($value); + } + /** + * Reset the record modification state. + * + * @return void + * @static + */ + public static function forgetRecordModificationState() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + $instance->forgetRecordModificationState(); + } + /** + * Indicate that the connection should use the write PDO connection for reads. + * + * @param bool $value + * @return \Illuminate\Database\SQLiteConnection + * @static + */ + public static function useWriteConnectionWhenReading($value = true) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->useWriteConnectionWhenReading($value); + } + /** + * Is Doctrine available? + * + * @return bool + * @static + */ + public static function isDoctrineAvailable() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->isDoctrineAvailable(); + } + /** + * Get a Doctrine Schema Column instance. + * + * @param string $table + * @param string $column + * @return \Doctrine\DBAL\Schema\Column + * @static + */ + public static function getDoctrineColumn($table, $column) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->getDoctrineColumn($table, $column); + } + /** + * Get the Doctrine DBAL schema manager for the connection. + * + * @return \Doctrine\DBAL\Schema\AbstractSchemaManager + * @static + */ + public static function getDoctrineSchemaManager() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->getDoctrineSchemaManager(); + } + /** + * Get the Doctrine DBAL database connection instance. + * + * @return \Doctrine\DBAL\Connection + * @static + */ + public static function getDoctrineConnection() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->getDoctrineConnection(); + } + /** + * Get the current PDO connection. + * + * @return \PDO + * @static + */ + public static function getPdo() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->getPdo(); + } + /** + * Get the current PDO connection parameter without executing any reconnect logic. + * + * @return \PDO|\Closure|null + * @static + */ + public static function getRawPdo() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->getRawPdo(); + } + /** + * Get the current PDO connection used for reading. + * + * @return \PDO + * @static + */ + public static function getReadPdo() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->getReadPdo(); + } + /** + * Get the current read PDO connection parameter without executing any reconnect logic. + * + * @return \PDO|\Closure|null + * @static + */ + public static function getRawReadPdo() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->getRawReadPdo(); + } + /** + * Set the PDO connection. + * + * @param \PDO|\Closure|null $pdo + * @return \Illuminate\Database\SQLiteConnection + * @static + */ + public static function setPdo($pdo) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->setPdo($pdo); + } + /** + * Set the PDO connection used for reading. + * + * @param \PDO|\Closure|null $pdo + * @return \Illuminate\Database\SQLiteConnection + * @static + */ + public static function setReadPdo($pdo) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->setReadPdo($pdo); + } + /** + * Get the database connection name. + * + * @return string|null + * @static + */ + public static function getName() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->getName(); + } + /** + * Get the database connection full name. + * + * @return string|null + * @static + */ + public static function getNameWithReadWriteType() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->getNameWithReadWriteType(); + } + /** + * Get an option from the configuration options. + * + * @param string|null $option + * @return mixed + * @static + */ + public static function getConfig($option = null) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->getConfig($option); + } + /** + * Get the PDO driver name. + * + * @return string + * @static + */ + public static function getDriverName() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->getDriverName(); + } + /** + * Get the query grammar used by the connection. + * + * @return \Illuminate\Database\Query\Grammars\Grammar + * @static + */ + public static function getQueryGrammar() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->getQueryGrammar(); + } + /** + * Set the query grammar used by the connection. + * + * @param \Illuminate\Database\Query\Grammars\Grammar $grammar + * @return \Illuminate\Database\SQLiteConnection + * @static + */ + public static function setQueryGrammar($grammar) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->setQueryGrammar($grammar); + } + /** + * Get the schema grammar used by the connection. + * + * @return \Illuminate\Database\Schema\Grammars\Grammar + * @static + */ + public static function getSchemaGrammar() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->getSchemaGrammar(); + } + /** + * Set the schema grammar used by the connection. + * + * @param \Illuminate\Database\Schema\Grammars\Grammar $grammar + * @return \Illuminate\Database\SQLiteConnection + * @static + */ + public static function setSchemaGrammar($grammar) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->setSchemaGrammar($grammar); + } + /** + * Get the query post processor used by the connection. + * + * @return \Illuminate\Database\Query\Processors\Processor + * @static + */ + public static function getPostProcessor() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->getPostProcessor(); + } + /** + * Set the query post processor used by the connection. + * + * @param \Illuminate\Database\Query\Processors\Processor $processor + * @return \Illuminate\Database\SQLiteConnection + * @static + */ + public static function setPostProcessor($processor) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->setPostProcessor($processor); + } + /** + * Get the event dispatcher used by the connection. + * + * @return \Illuminate\Contracts\Events\Dispatcher + * @static + */ + public static function getEventDispatcher() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->getEventDispatcher(); + } + /** + * Set the event dispatcher instance on the connection. + * + * @param \Illuminate\Contracts\Events\Dispatcher $events + * @return \Illuminate\Database\SQLiteConnection + * @static + */ + public static function setEventDispatcher($events) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->setEventDispatcher($events); + } + /** + * Unset the event dispatcher for this connection. + * + * @return void + * @static + */ + public static function unsetEventDispatcher() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + $instance->unsetEventDispatcher(); + } + /** + * Set the transaction manager instance on the connection. + * + * @param \Illuminate\Database\DatabaseTransactionsManager $manager + * @return \Illuminate\Database\SQLiteConnection + * @static + */ + public static function setTransactionManager($manager) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->setTransactionManager($manager); + } + /** + * Unset the transaction manager for this connection. + * + * @return void + * @static + */ + public static function unsetTransactionManager() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + $instance->unsetTransactionManager(); + } + /** + * Determine if the connection is in a "dry run". + * + * @return bool + * @static + */ + public static function pretending() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->pretending(); + } + /** + * Get the connection query log. + * + * @return array + * @static + */ + public static function getQueryLog() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->getQueryLog(); + } + /** + * Clear the query log. + * + * @return void + * @static + */ + public static function flushQueryLog() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + $instance->flushQueryLog(); + } + /** + * Enable the query log on the connection. + * + * @return void + * @static + */ + public static function enableQueryLog() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + $instance->enableQueryLog(); + } + /** + * Disable the query log on the connection. + * + * @return void + * @static + */ + public static function disableQueryLog() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + $instance->disableQueryLog(); + } + /** + * Determine whether we're logging queries. + * + * @return bool + * @static + */ + public static function logging() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->logging(); + } + /** + * Get the name of the connected database. + * + * @return string + * @static + */ + public static function getDatabaseName() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->getDatabaseName(); + } + /** + * Set the name of the connected database. + * + * @param string $database + * @return \Illuminate\Database\SQLiteConnection + * @static + */ + public static function setDatabaseName($database) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->setDatabaseName($database); + } + /** + * Set the read / write type of the connection. + * + * @param string|null $readWriteType + * @return \Illuminate\Database\SQLiteConnection + * @static + */ + public static function setReadWriteType($readWriteType) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->setReadWriteType($readWriteType); + } + /** + * Get the table prefix for the connection. + * + * @return string + * @static + */ + public static function getTablePrefix() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->getTablePrefix(); + } + /** + * Set the table prefix in use by the connection. + * + * @param string $prefix + * @return \Illuminate\Database\SQLiteConnection + * @static + */ + public static function setTablePrefix($prefix) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->setTablePrefix($prefix); + } + /** + * Set the table prefix and return the grammar. + * + * @param \Illuminate\Database\Grammar $grammar + * @return \Illuminate\Database\Grammar + * @static + */ + public static function withTablePrefix($grammar) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->withTablePrefix($grammar); + } + /** + * Register a connection resolver. + * + * @param string $driver + * @param \Closure $callback + * @return void + * @static + */ + public static function resolverFor($driver, $callback) + { //Method inherited from \Illuminate\Database\Connection + \Illuminate\Database\SQLiteConnection::resolverFor($driver, $callback); + } + /** + * Get the connection resolver for the given driver. + * + * @param string $driver + * @return mixed + * @static + */ + public static function getResolver($driver) + { //Method inherited from \Illuminate\Database\Connection + return \Illuminate\Database\SQLiteConnection::getResolver($driver); + } + /** + * Execute a Closure within a transaction. + * + * @param \Closure $callback + * @param int $attempts + * @return mixed + * @throws \Throwable + * @static + */ + public static function transaction($callback, $attempts = 1) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->transaction($callback, $attempts); + } + /** + * Start a new database transaction. + * + * @return void + * @throws \Throwable + * @static + */ + public static function beginTransaction() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + $instance->beginTransaction(); + } + /** + * Commit the active database transaction. + * + * @return void + * @throws \Throwable + * @static + */ + public static function commit() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + $instance->commit(); + } + /** + * Rollback the active database transaction. + * + * @param int|null $toLevel + * @return void + * @throws \Throwable + * @static + */ + public static function rollBack($toLevel = null) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + $instance->rollBack($toLevel); + } + /** + * Get the number of active transactions. + * + * @return int + * @static + */ + public static function transactionLevel() + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + return $instance->transactionLevel(); + } + /** + * Execute the callback after a transaction commits. + * + * @param callable $callback + * @return void + * @throws \RuntimeException + * @static + */ + public static function afterCommit($callback) + { //Method inherited from \Illuminate\Database\Connection + /** @var \Illuminate\Database\SQLiteConnection $instance */ + $instance->afterCommit($callback); + } + + } + /** + * + * + * @see \Illuminate\Events\Dispatcher + */ + class Event { + /** + * Register an event listener with the dispatcher. + * + * @param \Closure|string|array $events + * @param \Closure|string|array|null $listener + * @return void + * @static + */ + public static function listen($events, $listener = null) + { + /** @var \Illuminate\Events\Dispatcher $instance */ + $instance->listen($events, $listener); + } + /** + * Determine if a given event has listeners. + * + * @param string $eventName + * @return bool + * @static + */ + public static function hasListeners($eventName) + { + /** @var \Illuminate\Events\Dispatcher $instance */ + return $instance->hasListeners($eventName); + } + /** + * Determine if the given event has any wildcard listeners. + * + * @param string $eventName + * @return bool + * @static + */ + public static function hasWildcardListeners($eventName) + { + /** @var \Illuminate\Events\Dispatcher $instance */ + return $instance->hasWildcardListeners($eventName); + } + /** + * Register an event and payload to be fired later. + * + * @param string $event + * @param array $payload + * @return void + * @static + */ + public static function push($event, $payload = []) + { + /** @var \Illuminate\Events\Dispatcher $instance */ + $instance->push($event, $payload); + } + /** + * Flush a set of pushed events. + * + * @param string $event + * @return void + * @static + */ + public static function flush($event) + { + /** @var \Illuminate\Events\Dispatcher $instance */ + $instance->flush($event); + } + /** + * Register an event subscriber with the dispatcher. + * + * @param object|string $subscriber + * @return void + * @static + */ + public static function subscribe($subscriber) + { + /** @var \Illuminate\Events\Dispatcher $instance */ + $instance->subscribe($subscriber); + } + /** + * Fire an event until the first non-null response is returned. + * + * @param string|object $event + * @param mixed $payload + * @return array|null + * @static + */ + public static function until($event, $payload = []) + { + /** @var \Illuminate\Events\Dispatcher $instance */ + return $instance->until($event, $payload); + } + /** + * Fire an event and call the listeners. + * + * @param string|object $event + * @param mixed $payload + * @param bool $halt + * @return array|null + * @static + */ + public static function dispatch($event, $payload = [], $halt = false) + { + /** @var \Illuminate\Events\Dispatcher $instance */ + return $instance->dispatch($event, $payload, $halt); + } + /** + * Get all of the listeners for a given event name. + * + * @param string $eventName + * @return array + * @static + */ + public static function getListeners($eventName) + { + /** @var \Illuminate\Events\Dispatcher $instance */ + return $instance->getListeners($eventName); + } + /** + * Register an event listener with the dispatcher. + * + * @param \Closure|string|array $listener + * @param bool $wildcard + * @return \Closure + * @static + */ + public static function makeListener($listener, $wildcard = false) + { + /** @var \Illuminate\Events\Dispatcher $instance */ + return $instance->makeListener($listener, $wildcard); + } + /** + * Create a class based listener using the IoC container. + * + * @param string $listener + * @param bool $wildcard + * @return \Closure + * @static + */ + public static function createClassListener($listener, $wildcard = false) + { + /** @var \Illuminate\Events\Dispatcher $instance */ + return $instance->createClassListener($listener, $wildcard); + } + /** + * Remove a set of listeners from the dispatcher. + * + * @param string $event + * @return void + * @static + */ + public static function forget($event) + { + /** @var \Illuminate\Events\Dispatcher $instance */ + $instance->forget($event); + } + /** + * Forget all of the pushed listeners. + * + * @return void + * @static + */ + public static function forgetPushed() + { + /** @var \Illuminate\Events\Dispatcher $instance */ + $instance->forgetPushed(); + } + /** + * Set the queue resolver implementation. + * + * @param callable $resolver + * @return \Illuminate\Events\Dispatcher + * @static + */ + public static function setQueueResolver($resolver) + { + /** @var \Illuminate\Events\Dispatcher $instance */ + return $instance->setQueueResolver($resolver); + } + /** + * Register a custom macro. + * + * @param string $name + * @param object|callable $macro + * @return void + * @static + */ + public static function macro($name, $macro) + { + \Illuminate\Events\Dispatcher::macro($name, $macro); + } + /** + * Mix another object into the class. + * + * @param object $mixin + * @param bool $replace + * @return void + * @throws \ReflectionException + * @static + */ + public static function mixin($mixin, $replace = true) + { + \Illuminate\Events\Dispatcher::mixin($mixin, $replace); + } + /** + * Checks if macro is registered. + * + * @param string $name + * @return bool + * @static + */ + public static function hasMacro($name) + { + return \Illuminate\Events\Dispatcher::hasMacro($name); + } + /** + * Flush the existing macros. + * + * @return void + * @static + */ + public static function flushMacros() + { + \Illuminate\Events\Dispatcher::flushMacros(); + } + /** + * Assert if an event has a listener attached to it. + * + * @param string $expectedEvent + * @param string $expectedListener + * @return void + * @static + */ + public static function assertListening($expectedEvent, $expectedListener) + { + /** @var \Illuminate\Support\Testing\Fakes\EventFake $instance */ + $instance->assertListening($expectedEvent, $expectedListener); + } + /** + * Assert if an event was dispatched based on a truth-test callback. + * + * @param string|\Closure $event + * @param callable|int|null $callback + * @return void + * @static + */ + public static function assertDispatched($event, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\EventFake $instance */ + $instance->assertDispatched($event, $callback); + } + /** + * Assert if an event was dispatched a number of times. + * + * @param string $event + * @param int $times + * @return void + * @static + */ + public static function assertDispatchedTimes($event, $times = 1) + { + /** @var \Illuminate\Support\Testing\Fakes\EventFake $instance */ + $instance->assertDispatchedTimes($event, $times); + } + /** + * Determine if an event was dispatched based on a truth-test callback. + * + * @param string|\Closure $event + * @param callable|null $callback + * @return void + * @static + */ + public static function assertNotDispatched($event, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\EventFake $instance */ + $instance->assertNotDispatched($event, $callback); + } + /** + * Assert that no events were dispatched. + * + * @return void + * @static + */ + public static function assertNothingDispatched() + { + /** @var \Illuminate\Support\Testing\Fakes\EventFake $instance */ + $instance->assertNothingDispatched(); + } + /** + * Get all of the events matching a truth-test callback. + * + * @param string $event + * @param callable|null $callback + * @return \Illuminate\Support\Collection + * @static + */ + public static function dispatched($event, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\EventFake $instance */ + return $instance->dispatched($event, $callback); + } + /** + * Determine if the given event has been dispatched. + * + * @param string $event + * @return bool + * @static + */ + public static function hasDispatched($event) + { + /** @var \Illuminate\Support\Testing\Fakes\EventFake $instance */ + return $instance->hasDispatched($event); + } + + } + /** + * + * + * @see \Illuminate\Filesystem\Filesystem + */ + class File { + /** + * Determine if a file or directory exists. + * + * @param string $path + * @return bool + * @static + */ + public static function exists($path) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->exists($path); + } + /** + * Determine if a file or directory is missing. + * + * @param string $path + * @return bool + * @static + */ + public static function missing($path) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->missing($path); + } + /** + * Get the contents of a file. + * + * @param string $path + * @param bool $lock + * @return string + * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException + * @static + */ + public static function get($path, $lock = false) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->get($path, $lock); + } + /** + * Get contents of a file with shared access. + * + * @param string $path + * @return string + * @static + */ + public static function sharedGet($path) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->sharedGet($path); + } + /** + * Get the returned value of a file. + * + * @param string $path + * @param array $data + * @return mixed + * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException + * @static + */ + public static function getRequire($path, $data = []) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->getRequire($path, $data); + } + /** + * Require the given file once. + * + * @param string $path + * @param array $data + * @return mixed + * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException + * @static + */ + public static function requireOnce($path, $data = []) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->requireOnce($path, $data); + } + /** + * Get the contents of a file one line at a time. + * + * @param string $path + * @return \Illuminate\Support\LazyCollection + * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException + * @static + */ + public static function lines($path) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->lines($path); + } + /** + * Get the MD5 hash of the file at the given path. + * + * @param string $path + * @return string + * @static + */ + public static function hash($path) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->hash($path); + } + /** + * Write the contents of a file. + * + * @param string $path + * @param string $contents + * @param bool $lock + * @return int|bool + * @static + */ + public static function put($path, $contents, $lock = false) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->put($path, $contents, $lock); + } + /** + * Write the contents of a file, replacing it atomically if it already exists. + * + * @param string $path + * @param string $content + * @return void + * @static + */ + public static function replace($path, $content) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + $instance->replace($path, $content); + } + /** + * Replace a given string within a given file. + * + * @param array|string $search + * @param array|string $replace + * @param string $path + * @return void + * @static + */ + public static function replaceInFile($search, $replace, $path) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + $instance->replaceInFile($search, $replace, $path); + } + /** + * Prepend to a file. + * + * @param string $path + * @param string $data + * @return int + * @static + */ + public static function prepend($path, $data) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->prepend($path, $data); + } + /** + * Append to a file. + * + * @param string $path + * @param string $data + * @return int + * @static + */ + public static function append($path, $data) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->append($path, $data); + } + /** + * Get or set UNIX mode of a file or directory. + * + * @param string $path + * @param int|null $mode + * @return mixed + * @static + */ + public static function chmod($path, $mode = null) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->chmod($path, $mode); + } + /** + * Delete the file at a given path. + * + * @param string|array $paths + * @return bool + * @static + */ + public static function delete($paths) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->delete($paths); + } + /** + * Move a file to a new location. + * + * @param string $path + * @param string $target + * @return bool + * @static + */ + public static function move($path, $target) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->move($path, $target); + } + /** + * Copy a file to a new location. + * + * @param string $path + * @param string $target + * @return bool + * @static + */ + public static function copy($path, $target) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->copy($path, $target); + } + /** + * Create a symlink to the target file or directory. On Windows, a hard link is created if the target is a file. + * + * @param string $target + * @param string $link + * @return void + * @static + */ + public static function link($target, $link) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + $instance->link($target, $link); + } + /** + * Create a relative symlink to the target file or directory. + * + * @param string $target + * @param string $link + * @return void + * @throws \RuntimeException + * @static + */ + public static function relativeLink($target, $link) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + $instance->relativeLink($target, $link); + } + /** + * Extract the file name from a file path. + * + * @param string $path + * @return string + * @static + */ + public static function name($path) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->name($path); + } + /** + * Extract the trailing name component from a file path. + * + * @param string $path + * @return string + * @static + */ + public static function basename($path) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->basename($path); + } + /** + * Extract the parent directory from a file path. + * + * @param string $path + * @return string + * @static + */ + public static function dirname($path) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->dirname($path); + } + /** + * Extract the file extension from a file path. + * + * @param string $path + * @return string + * @static + */ + public static function extension($path) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->extension($path); + } + /** + * Guess the file extension from the mime-type of a given file. + * + * @param string $path + * @return string|null + * @throws \RuntimeException + * @static + */ + public static function guessExtension($path) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->guessExtension($path); + } + /** + * Get the file type of a given file. + * + * @param string $path + * @return string + * @static + */ + public static function type($path) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->type($path); + } + /** + * Get the mime-type of a given file. + * + * @param string $path + * @return string|false + * @static + */ + public static function mimeType($path) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->mimeType($path); + } + /** + * Get the file size of a given file. + * + * @param string $path + * @return int + * @static + */ + public static function size($path) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->size($path); + } + /** + * Get the file's last modification time. + * + * @param string $path + * @return int + * @static + */ + public static function lastModified($path) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->lastModified($path); + } + /** + * Determine if the given path is a directory. + * + * @param string $directory + * @return bool + * @static + */ + public static function isDirectory($directory) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->isDirectory($directory); + } + /** + * Determine if the given path is readable. + * + * @param string $path + * @return bool + * @static + */ + public static function isReadable($path) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->isReadable($path); + } + /** + * Determine if the given path is writable. + * + * @param string $path + * @return bool + * @static + */ + public static function isWritable($path) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->isWritable($path); + } + /** + * Determine if the given path is a file. + * + * @param string $file + * @return bool + * @static + */ + public static function isFile($file) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->isFile($file); + } + /** + * Find path names matching a given pattern. + * + * @param string $pattern + * @param int $flags + * @return array + * @static + */ + public static function glob($pattern, $flags = 0) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->glob($pattern, $flags); + } + /** + * Get an array of all files in a directory. + * + * @param string $directory + * @param bool $hidden + * @return \Symfony\Component\Finder\SplFileInfo[] + * @static + */ + public static function files($directory, $hidden = false) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->files($directory, $hidden); + } + /** + * Get all of the files from the given directory (recursive). + * + * @param string $directory + * @param bool $hidden + * @return \Symfony\Component\Finder\SplFileInfo[] + * @static + */ + public static function allFiles($directory, $hidden = false) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->allFiles($directory, $hidden); + } + /** + * Get all of the directories within a given directory. + * + * @param string $directory + * @return array + * @static + */ + public static function directories($directory) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->directories($directory); + } + /** + * Ensure a directory exists. + * + * @param string $path + * @param int $mode + * @param bool $recursive + * @return void + * @static + */ + public static function ensureDirectoryExists($path, $mode = 493, $recursive = true) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + $instance->ensureDirectoryExists($path, $mode, $recursive); + } + /** + * Create a directory. + * + * @param string $path + * @param int $mode + * @param bool $recursive + * @param bool $force + * @return bool + * @static + */ + public static function makeDirectory($path, $mode = 493, $recursive = false, $force = false) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->makeDirectory($path, $mode, $recursive, $force); + } + /** + * Move a directory. + * + * @param string $from + * @param string $to + * @param bool $overwrite + * @return bool + * @static + */ + public static function moveDirectory($from, $to, $overwrite = false) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->moveDirectory($from, $to, $overwrite); + } + /** + * Copy a directory from one location to another. + * + * @param string $directory + * @param string $destination + * @param int|null $options + * @return bool + * @static + */ + public static function copyDirectory($directory, $destination, $options = null) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->copyDirectory($directory, $destination, $options); + } + /** + * Recursively delete a directory. + * + * The directory itself may be optionally preserved. + * + * @param string $directory + * @param bool $preserve + * @return bool + * @static + */ + public static function deleteDirectory($directory, $preserve = false) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->deleteDirectory($directory, $preserve); + } + /** + * Remove all of the directories within a given directory. + * + * @param string $directory + * @return bool + * @static + */ + public static function deleteDirectories($directory) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->deleteDirectories($directory); + } + /** + * Empty the specified directory of all files and folders. + * + * @param string $directory + * @return bool + * @static + */ + public static function cleanDirectory($directory) + { + /** @var \Illuminate\Filesystem\Filesystem $instance */ + return $instance->cleanDirectory($directory); + } + /** + * Register a custom macro. + * + * @param string $name + * @param object|callable $macro + * @return void + * @static + */ + public static function macro($name, $macro) + { + \Illuminate\Filesystem\Filesystem::macro($name, $macro); + } + /** + * Mix another object into the class. + * + * @param object $mixin + * @param bool $replace + * @return void + * @throws \ReflectionException + * @static + */ + public static function mixin($mixin, $replace = true) + { + \Illuminate\Filesystem\Filesystem::mixin($mixin, $replace); + } + /** + * Checks if macro is registered. + * + * @param string $name + * @return bool + * @static + */ + public static function hasMacro($name) + { + return \Illuminate\Filesystem\Filesystem::hasMacro($name); + } + /** + * Flush the existing macros. + * + * @return void + * @static + */ + public static function flushMacros() + { + \Illuminate\Filesystem\Filesystem::flushMacros(); + } + + } + /** + * + * + * @see \Illuminate\Contracts\Auth\Access\Gate + */ + class Gate { + /** + * Determine if a given ability has been defined. + * + * @param string|array $ability + * @return bool + * @static + */ + public static function has($ability) + { + /** @var \Illuminate\Auth\Access\Gate $instance */ + return $instance->has($ability); + } + /** + * Perform an on-demand authorization check. Throw an authorization exception if the condition or callback is false. + * + * @param \Illuminate\Auth\Access\Response|\Closure|bool $condition + * @param string|null $message + * @param string|null $code + * @return \Illuminate\Auth\Access\Response + * @throws \Illuminate\Auth\Access\AuthorizationException + * @static + */ + public static function allowIf($condition, $message = null, $code = null) + { + /** @var \Illuminate\Auth\Access\Gate $instance */ + return $instance->allowIf($condition, $message, $code); + } + /** + * Perform an on-demand authorization check. Throw an authorization exception if the condition or callback is true. + * + * @param \Illuminate\Auth\Access\Response|\Closure|bool $condition + * @param string|null $message + * @param string|null $code + * @return \Illuminate\Auth\Access\Response + * @throws \Illuminate\Auth\Access\AuthorizationException + * @static + */ + public static function denyIf($condition, $message = null, $code = null) + { + /** @var \Illuminate\Auth\Access\Gate $instance */ + return $instance->denyIf($condition, $message, $code); + } + /** + * Define a new ability. + * + * @param string $ability + * @param callable|string $callback + * @return \Illuminate\Auth\Access\Gate + * @throws \InvalidArgumentException + * @static + */ + public static function define($ability, $callback) + { + /** @var \Illuminate\Auth\Access\Gate $instance */ + return $instance->define($ability, $callback); + } + /** + * Define abilities for a resource. + * + * @param string $name + * @param string $class + * @param array|null $abilities + * @return \Illuminate\Auth\Access\Gate + * @static + */ + public static function resource($name, $class, $abilities = null) + { + /** @var \Illuminate\Auth\Access\Gate $instance */ + return $instance->resource($name, $class, $abilities); + } + /** + * Define a policy class for a given class type. + * + * @param string $class + * @param string $policy + * @return \Illuminate\Auth\Access\Gate + * @static + */ + public static function policy($class, $policy) + { + /** @var \Illuminate\Auth\Access\Gate $instance */ + return $instance->policy($class, $policy); + } + /** + * Register a callback to run before all Gate checks. + * + * @param callable $callback + * @return \Illuminate\Auth\Access\Gate + * @static + */ + public static function before($callback) + { + /** @var \Illuminate\Auth\Access\Gate $instance */ + return $instance->before($callback); + } + /** + * Register a callback to run after all Gate checks. + * + * @param callable $callback + * @return \Illuminate\Auth\Access\Gate + * @static + */ + public static function after($callback) + { + /** @var \Illuminate\Auth\Access\Gate $instance */ + return $instance->after($callback); + } + /** + * Determine if the given ability should be granted for the current user. + * + * @param string $ability + * @param array|mixed $arguments + * @return bool + * @static + */ + public static function allows($ability, $arguments = []) + { + /** @var \Illuminate\Auth\Access\Gate $instance */ + return $instance->allows($ability, $arguments); + } + /** + * Determine if the given ability should be denied for the current user. + * + * @param string $ability + * @param array|mixed $arguments + * @return bool + * @static + */ + public static function denies($ability, $arguments = []) + { + /** @var \Illuminate\Auth\Access\Gate $instance */ + return $instance->denies($ability, $arguments); + } + /** + * Determine if all of the given abilities should be granted for the current user. + * + * @param \Illuminate\Auth\Access\iterable|string $abilities + * @param array|mixed $arguments + * @return bool + * @static + */ + public static function check($abilities, $arguments = []) + { + /** @var \Illuminate\Auth\Access\Gate $instance */ + return $instance->check($abilities, $arguments); + } + /** + * Determine if any one of the given abilities should be granted for the current user. + * + * @param \Illuminate\Auth\Access\iterable|string $abilities + * @param array|mixed $arguments + * @return bool + * @static + */ + public static function any($abilities, $arguments = []) + { + /** @var \Illuminate\Auth\Access\Gate $instance */ + return $instance->any($abilities, $arguments); + } + /** + * Determine if all of the given abilities should be denied for the current user. + * + * @param \Illuminate\Auth\Access\iterable|string $abilities + * @param array|mixed $arguments + * @return bool + * @static + */ + public static function none($abilities, $arguments = []) + { + /** @var \Illuminate\Auth\Access\Gate $instance */ + return $instance->none($abilities, $arguments); + } + /** + * Determine if the given ability should be granted for the current user. + * + * @param string $ability + * @param array|mixed $arguments + * @return \Illuminate\Auth\Access\Response + * @throws \Illuminate\Auth\Access\AuthorizationException + * @static + */ + public static function authorize($ability, $arguments = []) + { + /** @var \Illuminate\Auth\Access\Gate $instance */ + return $instance->authorize($ability, $arguments); + } + /** + * Inspect the user for the given ability. + * + * @param string $ability + * @param array|mixed $arguments + * @return \Illuminate\Auth\Access\Response + * @static + */ + public static function inspect($ability, $arguments = []) + { + /** @var \Illuminate\Auth\Access\Gate $instance */ + return $instance->inspect($ability, $arguments); + } + /** + * Get the raw result from the authorization callback. + * + * @param string $ability + * @param array|mixed $arguments + * @return mixed + * @throws \Illuminate\Auth\Access\AuthorizationException + * @static + */ + public static function raw($ability, $arguments = []) + { + /** @var \Illuminate\Auth\Access\Gate $instance */ + return $instance->raw($ability, $arguments); + } + /** + * Get a policy instance for a given class. + * + * @param object|string $class + * @return mixed + * @static + */ + public static function getPolicyFor($class) + { + /** @var \Illuminate\Auth\Access\Gate $instance */ + return $instance->getPolicyFor($class); + } + /** + * Specify a callback to be used to guess policy names. + * + * @param callable $callback + * @return \Illuminate\Auth\Access\Gate + * @static + */ + public static function guessPolicyNamesUsing($callback) + { + /** @var \Illuminate\Auth\Access\Gate $instance */ + return $instance->guessPolicyNamesUsing($callback); + } + /** + * Build a policy class instance of the given type. + * + * @param object|string $class + * @return mixed + * @throws \Illuminate\Contracts\Container\BindingResolutionException + * @static + */ + public static function resolvePolicy($class) + { + /** @var \Illuminate\Auth\Access\Gate $instance */ + return $instance->resolvePolicy($class); + } + /** + * Get a gate instance for the given user. + * + * @param \Illuminate\Contracts\Auth\Authenticatable|mixed $user + * @return static + * @static + */ + public static function forUser($user) + { + /** @var \Illuminate\Auth\Access\Gate $instance */ + return $instance->forUser($user); + } + /** + * Get all of the defined abilities. + * + * @return array + * @static + */ + public static function abilities() + { + /** @var \Illuminate\Auth\Access\Gate $instance */ + return $instance->abilities(); + } + /** + * Get all of the defined policies. + * + * @return array + * @static + */ + public static function policies() + { + /** @var \Illuminate\Auth\Access\Gate $instance */ + return $instance->policies(); + } + /** + * Set the container instance used by the gate. + * + * @param \Illuminate\Contracts\Container\Container $container + * @return \Illuminate\Auth\Access\Gate + * @static + */ + public static function setContainer($container) + { + /** @var \Illuminate\Auth\Access\Gate $instance */ + return $instance->setContainer($container); + } + + } + /** + * + * + * @see \Illuminate\Hashing\HashManager + */ + class Hash { + /** + * Create an instance of the Bcrypt hash Driver. + * + * @return \Illuminate\Hashing\BcryptHasher + * @static + */ + public static function createBcryptDriver() + { + /** @var \Illuminate\Hashing\HashManager $instance */ + return $instance->createBcryptDriver(); + } + /** + * Create an instance of the Argon2i hash Driver. + * + * @return \Illuminate\Hashing\ArgonHasher + * @static + */ + public static function createArgonDriver() + { + /** @var \Illuminate\Hashing\HashManager $instance */ + return $instance->createArgonDriver(); + } + /** + * Create an instance of the Argon2id hash Driver. + * + * @return \Illuminate\Hashing\Argon2IdHasher + * @static + */ + public static function createArgon2idDriver() + { + /** @var \Illuminate\Hashing\HashManager $instance */ + return $instance->createArgon2idDriver(); + } + /** + * Get information about the given hashed value. + * + * @param string $hashedValue + * @return array + * @static + */ + public static function info($hashedValue) + { + /** @var \Illuminate\Hashing\HashManager $instance */ + return $instance->info($hashedValue); + } + /** + * Hash the given value. + * + * @param string $value + * @param array $options + * @return string + * @static + */ + public static function make($value, $options = []) + { + /** @var \Illuminate\Hashing\HashManager $instance */ + return $instance->make($value, $options); + } + /** + * Check the given plain value against a hash. + * + * @param string $value + * @param string $hashedValue + * @param array $options + * @return bool + * @static + */ + public static function check($value, $hashedValue, $options = []) + { + /** @var \Illuminate\Hashing\HashManager $instance */ + return $instance->check($value, $hashedValue, $options); + } + /** + * Check if the given hash has been hashed using the given options. + * + * @param string $hashedValue + * @param array $options + * @return bool + * @static + */ + public static function needsRehash($hashedValue, $options = []) + { + /** @var \Illuminate\Hashing\HashManager $instance */ + return $instance->needsRehash($hashedValue, $options); + } + /** + * Get the default driver name. + * + * @return string + * @static + */ + public static function getDefaultDriver() + { + /** @var \Illuminate\Hashing\HashManager $instance */ + return $instance->getDefaultDriver(); + } + /** + * Get a driver instance. + * + * @param string|null $driver + * @return mixed + * @throws \InvalidArgumentException + * @static + */ + public static function driver($driver = null) + { //Method inherited from \Illuminate\Support\Manager + /** @var \Illuminate\Hashing\HashManager $instance */ + return $instance->driver($driver); + } + /** + * Register a custom driver creator Closure. + * + * @param string $driver + * @param \Closure $callback + * @return \Illuminate\Hashing\HashManager + * @static + */ + public static function extend($driver, $callback) + { //Method inherited from \Illuminate\Support\Manager + /** @var \Illuminate\Hashing\HashManager $instance */ + return $instance->extend($driver, $callback); + } + /** + * Get all of the created "drivers". + * + * @return array + * @static + */ + public static function getDrivers() + { //Method inherited from \Illuminate\Support\Manager + /** @var \Illuminate\Hashing\HashManager $instance */ + return $instance->getDrivers(); + } + /** + * Get the container instance used by the manager. + * + * @return \Illuminate\Contracts\Container\Container + * @static + */ + public static function getContainer() + { //Method inherited from \Illuminate\Support\Manager + /** @var \Illuminate\Hashing\HashManager $instance */ + return $instance->getContainer(); + } + /** + * Set the container instance used by the manager. + * + * @param \Illuminate\Contracts\Container\Container $container + * @return \Illuminate\Hashing\HashManager + * @static + */ + public static function setContainer($container) + { //Method inherited from \Illuminate\Support\Manager + /** @var \Illuminate\Hashing\HashManager $instance */ + return $instance->setContainer($container); + } + /** + * Forget all of the resolved driver instances. + * + * @return \Illuminate\Hashing\HashManager + * @static + */ + public static function forgetDrivers() + { //Method inherited from \Illuminate\Support\Manager + /** @var \Illuminate\Hashing\HashManager $instance */ + return $instance->forgetDrivers(); + } + + } + /** + * + * + * @method static \Illuminate\Http\Client\PendingRequest accept(string $contentType) + * @method static \Illuminate\Http\Client\PendingRequest acceptJson() + * @method static \Illuminate\Http\Client\PendingRequest asForm() + * @method static \Illuminate\Http\Client\PendingRequest asJson() + * @method static \Illuminate\Http\Client\PendingRequest asMultipart() + * @method static \Illuminate\Http\Client\PendingRequest async() + * @method static \Illuminate\Http\Client\PendingRequest attach(string|array $name, string $contents = '', string|null $filename = null, array $headers = []) + * @method static \Illuminate\Http\Client\PendingRequest baseUrl(string $url) + * @method static \Illuminate\Http\Client\PendingRequest beforeSending(callable $callback) + * @method static \Illuminate\Http\Client\PendingRequest bodyFormat(string $format) + * @method static \Illuminate\Http\Client\PendingRequest contentType(string $contentType) + * @method static \Illuminate\Http\Client\PendingRequest dd() + * @method static \Illuminate\Http\Client\PendingRequest dump() + * @method static \Illuminate\Http\Client\PendingRequest retry(int $times, int $sleep = 0, ?callable $when = null) + * @method static \Illuminate\Http\Client\PendingRequest sink(string|resource $to) + * @method static \Illuminate\Http\Client\PendingRequest stub(callable $callback) + * @method static \Illuminate\Http\Client\PendingRequest timeout(int $seconds) + * @method static \Illuminate\Http\Client\PendingRequest withBasicAuth(string $username, string $password) + * @method static \Illuminate\Http\Client\PendingRequest withBody(resource|string $content, string $contentType) + * @method static \Illuminate\Http\Client\PendingRequest withCookies(array $cookies, string $domain) + * @method static \Illuminate\Http\Client\PendingRequest withDigestAuth(string $username, string $password) + * @method static \Illuminate\Http\Client\PendingRequest withHeaders(array $headers) + * @method static \Illuminate\Http\Client\PendingRequest withMiddleware(callable $middleware) + * @method static \Illuminate\Http\Client\PendingRequest withOptions(array $options) + * @method static \Illuminate\Http\Client\PendingRequest withToken(string $token, string $type = 'Bearer') + * @method static \Illuminate\Http\Client\PendingRequest withUserAgent(string $userAgent) + * @method static \Illuminate\Http\Client\PendingRequest withoutRedirecting() + * @method static \Illuminate\Http\Client\PendingRequest withoutVerifying() + * @method static array pool(callable $callback) + * @method static \Illuminate\Http\Client\Response delete(string $url, array $data = []) + * @method static \Illuminate\Http\Client\Response get(string $url, array|string|null $query = null) + * @method static \Illuminate\Http\Client\Response head(string $url, array|string|null $query = null) + * @method static \Illuminate\Http\Client\Response patch(string $url, array $data = []) + * @method static \Illuminate\Http\Client\Response post(string $url, array $data = []) + * @method static \Illuminate\Http\Client\Response put(string $url, array $data = []) + * @method static \Illuminate\Http\Client\Response send(string $method, string $url, array $options = []) + * @see \Illuminate\Http\Client\Factory + */ + class Http { + /** + * Create a new response instance for use during stubbing. + * + * @param array|string $body + * @param int $status + * @param array $headers + * @return \GuzzleHttp\Promise\PromiseInterface + * @static + */ + public static function response($body = null, $status = 200, $headers = []) + { + return \Illuminate\Http\Client\Factory::response($body, $status, $headers); + } + /** + * Get an invokable object that returns a sequence of responses in order for use during stubbing. + * + * @param array $responses + * @return \Illuminate\Http\Client\ResponseSequence + * @static + */ + public static function sequence($responses = []) + { + /** @var \Illuminate\Http\Client\Factory $instance */ + return $instance->sequence($responses); + } + /** + * Register a stub callable that will intercept requests and be able to return stub responses. + * + * @param callable|array $callback + * @return \Illuminate\Http\Client\Factory + * @static + */ + public static function fake($callback = null) + { + /** @var \Illuminate\Http\Client\Factory $instance */ + return $instance->fake($callback); + } + /** + * Register a response sequence for the given URL pattern. + * + * @param string $url + * @return \Illuminate\Http\Client\ResponseSequence + * @static + */ + public static function fakeSequence($url = '*') + { + /** @var \Illuminate\Http\Client\Factory $instance */ + return $instance->fakeSequence($url); + } + /** + * Stub the given URL using the given callback. + * + * @param string $url + * @param \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface|callable $callback + * @return \Illuminate\Http\Client\Factory + * @static + */ + public static function stubUrl($url, $callback) + { + /** @var \Illuminate\Http\Client\Factory $instance */ + return $instance->stubUrl($url, $callback); + } + /** + * Record a request response pair. + * + * @param \Illuminate\Http\Client\Request $request + * @param \Illuminate\Http\Client\Response $response + * @return void + * @static + */ + public static function recordRequestResponsePair($request, $response) + { + /** @var \Illuminate\Http\Client\Factory $instance */ + $instance->recordRequestResponsePair($request, $response); + } + /** + * Assert that a request / response pair was recorded matching a given truth test. + * + * @param callable $callback + * @return void + * @static + */ + public static function assertSent($callback) + { + /** @var \Illuminate\Http\Client\Factory $instance */ + $instance->assertSent($callback); + } + /** + * Assert that the given request was sent in the given order. + * + * @param array $callbacks + * @return void + * @static + */ + public static function assertSentInOrder($callbacks) + { + /** @var \Illuminate\Http\Client\Factory $instance */ + $instance->assertSentInOrder($callbacks); + } + /** + * Assert that a request / response pair was not recorded matching a given truth test. + * + * @param callable $callback + * @return void + * @static + */ + public static function assertNotSent($callback) + { + /** @var \Illuminate\Http\Client\Factory $instance */ + $instance->assertNotSent($callback); + } + /** + * Assert that no request / response pair was recorded. + * + * @return void + * @static + */ + public static function assertNothingSent() + { + /** @var \Illuminate\Http\Client\Factory $instance */ + $instance->assertNothingSent(); + } + /** + * Assert how many requests have been recorded. + * + * @param int $count + * @return void + * @static + */ + public static function assertSentCount($count) + { + /** @var \Illuminate\Http\Client\Factory $instance */ + $instance->assertSentCount($count); + } + /** + * Assert that every created response sequence is empty. + * + * @return void + * @static + */ + public static function assertSequencesAreEmpty() + { + /** @var \Illuminate\Http\Client\Factory $instance */ + $instance->assertSequencesAreEmpty(); + } + /** + * Get a collection of the request / response pairs matching the given truth test. + * + * @param callable $callback + * @return \Illuminate\Support\Collection + * @static + */ + public static function recorded($callback = null) + { + /** @var \Illuminate\Http\Client\Factory $instance */ + return $instance->recorded($callback); + } + /** + * Get the current event dispatcher implementation. + * + * @return \Illuminate\Contracts\Events\Dispatcher|null + * @static + */ + public static function getDispatcher() + { + /** @var \Illuminate\Http\Client\Factory $instance */ + return $instance->getDispatcher(); + } + /** + * Register a custom macro. + * + * @param string $name + * @param object|callable $macro + * @return void + * @static + */ + public static function macro($name, $macro) + { + \Illuminate\Http\Client\Factory::macro($name, $macro); + } + /** + * Mix another object into the class. + * + * @param object $mixin + * @param bool $replace + * @return void + * @throws \ReflectionException + * @static + */ + public static function mixin($mixin, $replace = true) + { + \Illuminate\Http\Client\Factory::mixin($mixin, $replace); + } + /** + * Checks if macro is registered. + * + * @param string $name + * @return bool + * @static + */ + public static function hasMacro($name) + { + return \Illuminate\Http\Client\Factory::hasMacro($name); + } + /** + * Flush the existing macros. + * + * @return void + * @static + */ + public static function flushMacros() + { + \Illuminate\Http\Client\Factory::flushMacros(); + } + /** + * Dynamically handle calls to the class. + * + * @param string $method + * @param array $parameters + * @return mixed + * @throws \BadMethodCallException + * @static + */ + public static function macroCall($method, $parameters) + { + /** @var \Illuminate\Http\Client\Factory $instance */ + return $instance->macroCall($method, $parameters); + } + + } + /** + * + * + * @see \Illuminate\Translation\Translator + */ + class Lang { + /** + * Determine if a translation exists for a given locale. + * + * @param string $key + * @param string|null $locale + * @return bool + * @static + */ + public static function hasForLocale($key, $locale = null) + { + /** @var \Illuminate\Translation\Translator $instance */ + return $instance->hasForLocale($key, $locale); + } + /** + * Determine if a translation exists. + * + * @param string $key + * @param string|null $locale + * @param bool $fallback + * @return bool + * @static + */ + public static function has($key, $locale = null, $fallback = true) + { + /** @var \Illuminate\Translation\Translator $instance */ + return $instance->has($key, $locale, $fallback); + } + /** + * Get the translation for the given key. + * + * @param string $key + * @param array $replace + * @param string|null $locale + * @param bool $fallback + * @return string|array + * @static + */ + public static function get($key, $replace = [], $locale = null, $fallback = true) + { + /** @var \Illuminate\Translation\Translator $instance */ + return $instance->get($key, $replace, $locale, $fallback); + } + /** + * Get a translation according to an integer value. + * + * @param string $key + * @param \Countable|int|array $number + * @param array $replace + * @param string|null $locale + * @return string + * @static + */ + public static function choice($key, $number, $replace = [], $locale = null) + { + /** @var \Illuminate\Translation\Translator $instance */ + return $instance->choice($key, $number, $replace, $locale); + } + /** + * Add translation lines to the given locale. + * + * @param array $lines + * @param string $locale + * @param string $namespace + * @return void + * @static + */ + public static function addLines($lines, $locale, $namespace = '*') + { + /** @var \Illuminate\Translation\Translator $instance */ + $instance->addLines($lines, $locale, $namespace); + } + /** + * Load the specified language group. + * + * @param string $namespace + * @param string $group + * @param string $locale + * @return void + * @static + */ + public static function load($namespace, $group, $locale) + { + /** @var \Illuminate\Translation\Translator $instance */ + $instance->load($namespace, $group, $locale); + } + /** + * Add a new namespace to the loader. + * + * @param string $namespace + * @param string $hint + * @return void + * @static + */ + public static function addNamespace($namespace, $hint) + { + /** @var \Illuminate\Translation\Translator $instance */ + $instance->addNamespace($namespace, $hint); + } + /** + * Add a new JSON path to the loader. + * + * @param string $path + * @return void + * @static + */ + public static function addJsonPath($path) + { + /** @var \Illuminate\Translation\Translator $instance */ + $instance->addJsonPath($path); + } + /** + * Parse a key into namespace, group, and item. + * + * @param string $key + * @return array + * @static + */ + public static function parseKey($key) + { + /** @var \Illuminate\Translation\Translator $instance */ + return $instance->parseKey($key); + } + /** + * Get the message selector instance. + * + * @return \Illuminate\Translation\MessageSelector + * @static + */ + public static function getSelector() + { + /** @var \Illuminate\Translation\Translator $instance */ + return $instance->getSelector(); + } + /** + * Set the message selector instance. + * + * @param \Illuminate\Translation\MessageSelector $selector + * @return void + * @static + */ + public static function setSelector($selector) + { + /** @var \Illuminate\Translation\Translator $instance */ + $instance->setSelector($selector); + } + /** + * Get the language line loader implementation. + * + * @return \Illuminate\Contracts\Translation\Loader + * @static + */ + public static function getLoader() + { + /** @var \Illuminate\Translation\Translator $instance */ + return $instance->getLoader(); + } + /** + * Get the default locale being used. + * + * @return string + * @static + */ + public static function locale() + { + /** @var \Illuminate\Translation\Translator $instance */ + return $instance->locale(); + } + /** + * Get the default locale being used. + * + * @return string + * @static + */ + public static function getLocale() + { + /** @var \Illuminate\Translation\Translator $instance */ + return $instance->getLocale(); + } + /** + * Set the default locale. + * + * @param string $locale + * @return void + * @throws \InvalidArgumentException + * @static + */ + public static function setLocale($locale) + { + /** @var \Illuminate\Translation\Translator $instance */ + $instance->setLocale($locale); + } + /** + * Get the fallback locale being used. + * + * @return string + * @static + */ + public static function getFallback() + { + /** @var \Illuminate\Translation\Translator $instance */ + return $instance->getFallback(); + } + /** + * Set the fallback locale being used. + * + * @param string $fallback + * @return void + * @static + */ + public static function setFallback($fallback) + { + /** @var \Illuminate\Translation\Translator $instance */ + $instance->setFallback($fallback); + } + /** + * Set the loaded translation groups. + * + * @param array $loaded + * @return void + * @static + */ + public static function setLoaded($loaded) + { + /** @var \Illuminate\Translation\Translator $instance */ + $instance->setLoaded($loaded); + } + /** + * Set the parsed value of a key. + * + * @param string $key + * @param array $parsed + * @return void + * @static + */ + public static function setParsedKey($key, $parsed) + { //Method inherited from \Illuminate\Support\NamespacedItemResolver + /** @var \Illuminate\Translation\Translator $instance */ + $instance->setParsedKey($key, $parsed); + } + /** + * Flush the cache of parsed keys. + * + * @return void + * @static + */ + public static function flushParsedKeys() + { //Method inherited from \Illuminate\Support\NamespacedItemResolver + /** @var \Illuminate\Translation\Translator $instance */ + $instance->flushParsedKeys(); + } + /** + * Register a custom macro. + * + * @param string $name + * @param object|callable $macro + * @return void + * @static + */ + public static function macro($name, $macro) + { + \Illuminate\Translation\Translator::macro($name, $macro); + } + /** + * Mix another object into the class. + * + * @param object $mixin + * @param bool $replace + * @return void + * @throws \ReflectionException + * @static + */ + public static function mixin($mixin, $replace = true) + { + \Illuminate\Translation\Translator::mixin($mixin, $replace); + } + /** + * Checks if macro is registered. + * + * @param string $name + * @return bool + * @static + */ + public static function hasMacro($name) + { + return \Illuminate\Translation\Translator::hasMacro($name); + } + /** + * Flush the existing macros. + * + * @return void + * @static + */ + public static function flushMacros() + { + \Illuminate\Translation\Translator::flushMacros(); + } + + } + /** + * + * + * @method static \Illuminate\Log\Logger withContext(array $context = []) + * @method static \Illuminate\Log\Logger withoutContext() + * @method static void write(string $level, string $message, array $context = []) + * @method static void listen(\Closure $callback) + * @see \Illuminate\Log\Logger + */ + class Log { + /** + * Build an on-demand log channel. + * + * @param array $config + * @return \Psr\Log\LoggerInterface + * @static + */ + public static function build($config) + { + /** @var \Illuminate\Log\LogManager $instance */ + return $instance->build($config); + } + /** + * Create a new, on-demand aggregate logger instance. + * + * @param array $channels + * @param string|null $channel + * @return \Psr\Log\LoggerInterface + * @static + */ + public static function stack($channels, $channel = null) + { + /** @var \Illuminate\Log\LogManager $instance */ + return $instance->stack($channels, $channel); + } + /** + * Get a log channel instance. + * + * @param string|null $channel + * @return \Psr\Log\LoggerInterface + * @static + */ + public static function channel($channel = null) + { + /** @var \Illuminate\Log\LogManager $instance */ + return $instance->channel($channel); + } + /** + * Get a log driver instance. + * + * @param string|null $driver + * @return \Psr\Log\LoggerInterface + * @static + */ + public static function driver($driver = null) + { + /** @var \Illuminate\Log\LogManager $instance */ + return $instance->driver($driver); + } + /** + * Get the default log driver name. + * + * @return string|null + * @static + */ + public static function getDefaultDriver() + { + /** @var \Illuminate\Log\LogManager $instance */ + return $instance->getDefaultDriver(); + } + /** + * Set the default log driver name. + * + * @param string $name + * @return void + * @static + */ + public static function setDefaultDriver($name) + { + /** @var \Illuminate\Log\LogManager $instance */ + $instance->setDefaultDriver($name); + } + /** + * Register a custom driver creator Closure. + * + * @param string $driver + * @param \Closure $callback + * @return \Illuminate\Log\LogManager + * @static + */ + public static function extend($driver, $callback) + { + /** @var \Illuminate\Log\LogManager $instance */ + return $instance->extend($driver, $callback); + } + /** + * Unset the given channel instance. + * + * @param string|null $driver + * @return \Illuminate\Log\LogManager + * @static + */ + public static function forgetChannel($driver = null) + { + /** @var \Illuminate\Log\LogManager $instance */ + return $instance->forgetChannel($driver); + } + /** + * Get all of the resolved log channels. + * + * @return array + * @static + */ + public static function getChannels() + { + /** @var \Illuminate\Log\LogManager $instance */ + return $instance->getChannels(); + } + /** + * System is unusable. + * + * @param string $message + * @param array $context + * @return void + * @static + */ + public static function emergency($message, $context = []) + { + /** @var \Illuminate\Log\LogManager $instance */ + $instance->emergency($message, $context); + } + /** + * Action must be taken immediately. + * + * Example: Entire website down, database unavailable, etc. This should + * trigger the SMS alerts and wake you up. + * + * @param string $message + * @param array $context + * @return void + * @static + */ + public static function alert($message, $context = []) + { + /** @var \Illuminate\Log\LogManager $instance */ + $instance->alert($message, $context); + } + /** + * Critical conditions. + * + * Example: Application component unavailable, unexpected exception. + * + * @param string $message + * @param array $context + * @return void + * @static + */ + public static function critical($message, $context = []) + { + /** @var \Illuminate\Log\LogManager $instance */ + $instance->critical($message, $context); + } + /** + * Runtime errors that do not require immediate action but should typically + * be logged and monitored. + * + * @param string $message + * @param array $context + * @return void + * @static + */ + public static function error($message, $context = []) + { + /** @var \Illuminate\Log\LogManager $instance */ + $instance->error($message, $context); + } + /** + * Exceptional occurrences that are not errors. + * + * Example: Use of deprecated APIs, poor use of an API, undesirable things + * that are not necessarily wrong. + * + * @param string $message + * @param array $context + * @return void + * @static + */ + public static function warning($message, $context = []) + { + /** @var \Illuminate\Log\LogManager $instance */ + $instance->warning($message, $context); + } + /** + * Normal but significant events. + * + * @param string $message + * @param array $context + * @return void + * @static + */ + public static function notice($message, $context = []) + { + /** @var \Illuminate\Log\LogManager $instance */ + $instance->notice($message, $context); + } + /** + * Interesting events. + * + * Example: User logs in, SQL logs. + * + * @param string $message + * @param array $context + * @return void + * @static + */ + public static function info($message, $context = []) + { + /** @var \Illuminate\Log\LogManager $instance */ + $instance->info($message, $context); + } + /** + * Detailed debug information. + * + * @param string $message + * @param array $context + * @return void + * @static + */ + public static function debug($message, $context = []) + { + /** @var \Illuminate\Log\LogManager $instance */ + $instance->debug($message, $context); + } + /** + * Logs with an arbitrary level. + * + * @param mixed $level + * @param string $message + * @param array $context + * @return void + * @static + */ + public static function log($level, $message, $context = []) + { + /** @var \Illuminate\Log\LogManager $instance */ + $instance->log($level, $message, $context); + } + + } + /** + * + * + * @method static void alwaysFrom(string $address, string|null $name = null) + * @method static void alwaysReplyTo(string $address, string|null $name = null) + * @method static void alwaysReturnPath(string $address) + * @method static void alwaysTo(string $address, string|null $name = null) + * @method static mixed laterOn(string $queue, \DateTimeInterface|\DateInterval|int $delay, \Illuminate\Contracts\Mail\Mailable|string|array $view) + * @method static mixed queueOn(string $queue, \Illuminate\Contracts\Mail\Mailable|string|array $view) + * @method static void plain(string $view, array $data, $callback) + * @method static void html(string $html, $callback) + * @see \Illuminate\Mail\Mailer + * @see \Illuminate\Support\Testing\Fakes\MailFake + */ + class Mail { + /** + * Get a mailer instance by name. + * + * @param string|null $name + * @return \Illuminate\Contracts\Mail\Mailer + * @static + */ + public static function mailer($name = null) + { + /** @var \Illuminate\Mail\MailManager $instance */ + return $instance->mailer($name); + } + /** + * Get a mailer driver instance. + * + * @param string|null $driver + * @return \Illuminate\Mail\Mailer + * @static + */ + public static function driver($driver = null) + { + /** @var \Illuminate\Mail\MailManager $instance */ + return $instance->driver($driver); + } + /** + * Create a new transport instance. + * + * @param array $config + * @return \Swift_Transport + * @throws \InvalidArgumentException + * @static + */ + public static function createTransport($config) + { + /** @var \Illuminate\Mail\MailManager $instance */ + return $instance->createTransport($config); + } + /** + * Get the default mail driver name. + * + * @return string + * @static + */ + public static function getDefaultDriver() + { + /** @var \Illuminate\Mail\MailManager $instance */ + return $instance->getDefaultDriver(); + } + /** + * Set the default mail driver name. + * + * @param string $name + * @return void + * @static + */ + public static function setDefaultDriver($name) + { + /** @var \Illuminate\Mail\MailManager $instance */ + $instance->setDefaultDriver($name); + } + /** + * Disconnect the given mailer and remove from local cache. + * + * @param string|null $name + * @return void + * @static + */ + public static function purge($name = null) + { + /** @var \Illuminate\Mail\MailManager $instance */ + $instance->purge($name); + } + /** + * Register a custom transport creator Closure. + * + * @param string $driver + * @param \Closure $callback + * @return \Illuminate\Mail\MailManager + * @static + */ + public static function extend($driver, $callback) + { + /** @var \Illuminate\Mail\MailManager $instance */ + return $instance->extend($driver, $callback); + } + /** + * Get the application instance used by the manager. + * + * @return \Illuminate\Contracts\Foundation\Application + * @static + */ + public static function getApplication() + { + /** @var \Illuminate\Mail\MailManager $instance */ + return $instance->getApplication(); + } + /** + * Set the application instance used by the manager. + * + * @param \Illuminate\Contracts\Foundation\Application $app + * @return \Illuminate\Mail\MailManager + * @static + */ + public static function setApplication($app) + { + /** @var \Illuminate\Mail\MailManager $instance */ + return $instance->setApplication($app); + } + /** + * Forget all of the resolved mailer instances. + * + * @return \Illuminate\Mail\MailManager + * @static + */ + public static function forgetMailers() + { + /** @var \Illuminate\Mail\MailManager $instance */ + return $instance->forgetMailers(); + } + /** + * Assert if a mailable was sent based on a truth-test callback. + * + * @param string|\Closure $mailable + * @param callable|int|null $callback + * @return void + * @static + */ + public static function assertSent($mailable, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */ + $instance->assertSent($mailable, $callback); + } + /** + * Determine if a mailable was not sent or queued to be sent based on a truth-test callback. + * + * @param string|\Closure $mailable + * @param callable|null $callback + * @return void + * @static + */ + public static function assertNotOutgoing($mailable, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */ + $instance->assertNotOutgoing($mailable, $callback); + } + /** + * Determine if a mailable was not sent based on a truth-test callback. + * + * @param string|\Closure $mailable + * @param callable|null $callback + * @return void + * @static + */ + public static function assertNotSent($mailable, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */ + $instance->assertNotSent($mailable, $callback); + } + /** + * Assert that no mailables were sent or queued to be sent. + * + * @return void + * @static + */ + public static function assertNothingOutgoing() + { + /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */ + $instance->assertNothingOutgoing(); + } + /** + * Assert that no mailables were sent. + * + * @return void + * @static + */ + public static function assertNothingSent() + { + /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */ + $instance->assertNothingSent(); + } + /** + * Assert if a mailable was queued based on a truth-test callback. + * + * @param string|\Closure $mailable + * @param callable|int|null $callback + * @return void + * @static + */ + public static function assertQueued($mailable, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */ + $instance->assertQueued($mailable, $callback); + } + /** + * Determine if a mailable was not queued based on a truth-test callback. + * + * @param string|\Closure $mailable + * @param callable|null $callback + * @return void + * @static + */ + public static function assertNotQueued($mailable, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */ + $instance->assertNotQueued($mailable, $callback); + } + /** + * Assert that no mailables were queued. + * + * @return void + * @static + */ + public static function assertNothingQueued() + { + /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */ + $instance->assertNothingQueued(); + } + /** + * Get all of the mailables matching a truth-test callback. + * + * @param string|\Closure $mailable + * @param callable|null $callback + * @return \Illuminate\Support\Collection + * @static + */ + public static function sent($mailable, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */ + return $instance->sent($mailable, $callback); + } + /** + * Determine if the given mailable has been sent. + * + * @param string $mailable + * @return bool + * @static + */ + public static function hasSent($mailable) + { + /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */ + return $instance->hasSent($mailable); + } + /** + * Get all of the queued mailables matching a truth-test callback. + * + * @param string|\Closure $mailable + * @param callable|null $callback + * @return \Illuminate\Support\Collection + * @static + */ + public static function queued($mailable, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */ + return $instance->queued($mailable, $callback); + } + /** + * Determine if the given mailable has been queued. + * + * @param string $mailable + * @return bool + * @static + */ + public static function hasQueued($mailable) + { + /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */ + return $instance->hasQueued($mailable); + } + /** + * Begin the process of mailing a mailable class instance. + * + * @param mixed $users + * @return \Illuminate\Mail\PendingMail + * @static + */ + public static function to($users) + { + /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */ + return $instance->to($users); + } + /** + * Begin the process of mailing a mailable class instance. + * + * @param mixed $users + * @return \Illuminate\Mail\PendingMail + * @static + */ + public static function bcc($users) + { + /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */ + return $instance->bcc($users); + } + /** + * Send a new message with only a raw text part. + * + * @param string $text + * @param \Closure|string $callback + * @return void + * @static + */ + public static function raw($text, $callback) + { + /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */ + $instance->raw($text, $callback); + } + /** + * Send a new message using a view. + * + * @param \Illuminate\Contracts\Mail\Mailable|string|array $view + * @param array $data + * @param \Closure|string|null $callback + * @return void + * @static + */ + public static function send($view, $data = [], $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */ + $instance->send($view, $data, $callback); + } + /** + * Queue a new e-mail message for sending. + * + * @param \Illuminate\Contracts\Mail\Mailable|string|array $view + * @param string|null $queue + * @return mixed + * @static + */ + public static function queue($view, $queue = null) + { + /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */ + return $instance->queue($view, $queue); + } + /** + * Queue a new e-mail message for sending after (n) seconds. + * + * @param \DateTimeInterface|\DateInterval|int $delay + * @param \Illuminate\Contracts\Mail\Mailable|string|array $view + * @param string|null $queue + * @return mixed + * @static + */ + public static function later($delay, $view, $queue = null) + { + /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */ + return $instance->later($delay, $view, $queue); + } + /** + * Get the array of failed recipients. + * + * @return array + * @static + */ + public static function failures() + { + /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */ + return $instance->failures(); + } + + } + /** + * + * + * @see \Illuminate\Notifications\ChannelManager + */ + class Notification { + /** + * Send the given notification to the given notifiable entities. + * + * @param \Illuminate\Support\Collection|array|mixed $notifiables + * @param mixed $notification + * @return void + * @static + */ + public static function send($notifiables, $notification) + { + /** @var \Illuminate\Notifications\ChannelManager $instance */ + $instance->send($notifiables, $notification); + } + /** + * Send the given notification immediately. + * + * @param \Illuminate\Support\Collection|array|mixed $notifiables + * @param mixed $notification + * @param array|null $channels + * @return void + * @static + */ + public static function sendNow($notifiables, $notification, $channels = null) + { + /** @var \Illuminate\Notifications\ChannelManager $instance */ + $instance->sendNow($notifiables, $notification, $channels); + } + /** + * Get a channel instance. + * + * @param string|null $name + * @return mixed + * @static + */ + public static function channel($name = null) + { + /** @var \Illuminate\Notifications\ChannelManager $instance */ + return $instance->channel($name); + } + /** + * Get the default channel driver name. + * + * @return string + * @static + */ + public static function getDefaultDriver() + { + /** @var \Illuminate\Notifications\ChannelManager $instance */ + return $instance->getDefaultDriver(); + } + /** + * Get the default channel driver name. + * + * @return string + * @static + */ + public static function deliversVia() + { + /** @var \Illuminate\Notifications\ChannelManager $instance */ + return $instance->deliversVia(); + } + /** + * Set the default channel driver name. + * + * @param string $channel + * @return void + * @static + */ + public static function deliverVia($channel) + { + /** @var \Illuminate\Notifications\ChannelManager $instance */ + $instance->deliverVia($channel); + } + /** + * Set the locale of notifications. + * + * @param string $locale + * @return \Illuminate\Notifications\ChannelManager + * @static + */ + public static function locale($locale) + { + /** @var \Illuminate\Notifications\ChannelManager $instance */ + return $instance->locale($locale); + } + /** + * Get a driver instance. + * + * @param string|null $driver + * @return mixed + * @throws \InvalidArgumentException + * @static + */ + public static function driver($driver = null) + { //Method inherited from \Illuminate\Support\Manager + /** @var \Illuminate\Notifications\ChannelManager $instance */ + return $instance->driver($driver); + } + /** + * Register a custom driver creator Closure. + * + * @param string $driver + * @param \Closure $callback + * @return \Illuminate\Notifications\ChannelManager + * @static + */ + public static function extend($driver, $callback) + { //Method inherited from \Illuminate\Support\Manager + /** @var \Illuminate\Notifications\ChannelManager $instance */ + return $instance->extend($driver, $callback); + } + /** + * Get all of the created "drivers". + * + * @return array + * @static + */ + public static function getDrivers() + { //Method inherited from \Illuminate\Support\Manager + /** @var \Illuminate\Notifications\ChannelManager $instance */ + return $instance->getDrivers(); + } + /** + * Get the container instance used by the manager. + * + * @return \Illuminate\Contracts\Container\Container + * @static + */ + public static function getContainer() + { //Method inherited from \Illuminate\Support\Manager + /** @var \Illuminate\Notifications\ChannelManager $instance */ + return $instance->getContainer(); + } + /** + * Set the container instance used by the manager. + * + * @param \Illuminate\Contracts\Container\Container $container + * @return \Illuminate\Notifications\ChannelManager + * @static + */ + public static function setContainer($container) + { //Method inherited from \Illuminate\Support\Manager + /** @var \Illuminate\Notifications\ChannelManager $instance */ + return $instance->setContainer($container); + } + /** + * Forget all of the resolved driver instances. + * + * @return \Illuminate\Notifications\ChannelManager + * @static + */ + public static function forgetDrivers() + { //Method inherited from \Illuminate\Support\Manager + /** @var \Illuminate\Notifications\ChannelManager $instance */ + return $instance->forgetDrivers(); + } + /** + * Assert if a notification was sent on-demand based on a truth-test callback. + * + * @param string|\Closure $notification + * @param callable|null $callback + * @return void + * @throws \Exception + * @static + */ + public static function assertSentOnDemand($notification, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\NotificationFake $instance */ + $instance->assertSentOnDemand($notification, $callback); + } + /** + * Assert if a notification was sent based on a truth-test callback. + * + * @param mixed $notifiable + * @param string|\Closure $notification + * @param callable|null $callback + * @return void + * @throws \Exception + * @static + */ + public static function assertSentTo($notifiable, $notification, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\NotificationFake $instance */ + $instance->assertSentTo($notifiable, $notification, $callback); + } + /** + * Assert if a notification was sent on-demand a number of times. + * + * @param string $notification + * @param int $times + * @return void + * @static + */ + public static function assertSentOnDemandTimes($notification, $times = 1) + { + /** @var \Illuminate\Support\Testing\Fakes\NotificationFake $instance */ + $instance->assertSentOnDemandTimes($notification, $times); + } + /** + * Assert if a notification was sent a number of times. + * + * @param mixed $notifiable + * @param string $notification + * @param int $times + * @return void + * @static + */ + public static function assertSentToTimes($notifiable, $notification, $times = 1) + { + /** @var \Illuminate\Support\Testing\Fakes\NotificationFake $instance */ + $instance->assertSentToTimes($notifiable, $notification, $times); + } + /** + * Determine if a notification was sent based on a truth-test callback. + * + * @param mixed $notifiable + * @param string|\Closure $notification + * @param callable|null $callback + * @return void + * @throws \Exception + * @static + */ + public static function assertNotSentTo($notifiable, $notification, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\NotificationFake $instance */ + $instance->assertNotSentTo($notifiable, $notification, $callback); + } + /** + * Assert that no notifications were sent. + * + * @return void + * @static + */ + public static function assertNothingSent() + { + /** @var \Illuminate\Support\Testing\Fakes\NotificationFake $instance */ + $instance->assertNothingSent(); + } + /** + * Assert the total amount of times a notification was sent. + * + * @param string $notification + * @param int $expectedCount + * @return void + * @static + */ + public static function assertSentTimes($notification, $expectedCount) + { + /** @var \Illuminate\Support\Testing\Fakes\NotificationFake $instance */ + $instance->assertSentTimes($notification, $expectedCount); + } + /** + * Assert the total amount of times a notification was sent. + * + * @param int $expectedCount + * @param string $notification + * @return void + * @deprecated Use the assertSentTimes method instead + * @static + */ + public static function assertTimesSent($expectedCount, $notification) + { + /** @var \Illuminate\Support\Testing\Fakes\NotificationFake $instance */ + $instance->assertTimesSent($expectedCount, $notification); + } + /** + * Get all of the notifications matching a truth-test callback. + * + * @param mixed $notifiable + * @param string $notification + * @param callable|null $callback + * @return \Illuminate\Support\Collection + * @static + */ + public static function sent($notifiable, $notification, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\NotificationFake $instance */ + return $instance->sent($notifiable, $notification, $callback); + } + /** + * Determine if there are more notifications left to inspect. + * + * @param mixed $notifiable + * @param string $notification + * @return bool + * @static + */ + public static function hasSent($notifiable, $notification) + { + /** @var \Illuminate\Support\Testing\Fakes\NotificationFake $instance */ + return $instance->hasSent($notifiable, $notification); + } + /** + * Register a custom macro. + * + * @param string $name + * @param object|callable $macro + * @return void + * @static + */ + public static function macro($name, $macro) + { + \Illuminate\Support\Testing\Fakes\NotificationFake::macro($name, $macro); + } + /** + * Mix another object into the class. + * + * @param object $mixin + * @param bool $replace + * @return void + * @throws \ReflectionException + * @static + */ + public static function mixin($mixin, $replace = true) + { + \Illuminate\Support\Testing\Fakes\NotificationFake::mixin($mixin, $replace); + } + /** + * Checks if macro is registered. + * + * @param string $name + * @return bool + * @static + */ + public static function hasMacro($name) + { + return \Illuminate\Support\Testing\Fakes\NotificationFake::hasMacro($name); + } + /** + * Flush the existing macros. + * + * @return void + * @static + */ + public static function flushMacros() + { + \Illuminate\Support\Testing\Fakes\NotificationFake::flushMacros(); + } + + } + /** + * + * + * @method static mixed reset(array $credentials, \Closure $callback) + * @method static string sendResetLink(array $credentials, \Closure $callback = null) + * @method static \Illuminate\Contracts\Auth\CanResetPassword getUser(array $credentials) + * @method static string createToken(\Illuminate\Contracts\Auth\CanResetPassword $user) + * @method static void deleteToken(\Illuminate\Contracts\Auth\CanResetPassword $user) + * @method static bool tokenExists(\Illuminate\Contracts\Auth\CanResetPassword $user, string $token) + * @method static \Illuminate\Auth\Passwords\TokenRepositoryInterface getRepository() + * @see \Illuminate\Auth\Passwords\PasswordBroker + */ + class Password { + /** + * Attempt to get the broker from the local cache. + * + * @param string|null $name + * @return \Illuminate\Contracts\Auth\PasswordBroker + * @static + */ + public static function broker($name = null) + { + /** @var \Illuminate\Auth\Passwords\PasswordBrokerManager $instance */ + return $instance->broker($name); + } + /** + * Get the default password broker name. + * + * @return string + * @static + */ + public static function getDefaultDriver() + { + /** @var \Illuminate\Auth\Passwords\PasswordBrokerManager $instance */ + return $instance->getDefaultDriver(); + } + /** + * Set the default password broker name. + * + * @param string $name + * @return void + * @static + */ + public static function setDefaultDriver($name) + { + /** @var \Illuminate\Auth\Passwords\PasswordBrokerManager $instance */ + $instance->setDefaultDriver($name); + } + + } + /** + * + * + * @see \Illuminate\Queue\QueueManager + * @see \Illuminate\Queue\Queue + */ + class Queue { + /** + * Register an event listener for the before job event. + * + * @param mixed $callback + * @return void + * @static + */ + public static function before($callback) + { + /** @var \Illuminate\Queue\QueueManager $instance */ + $instance->before($callback); + } + /** + * Register an event listener for the after job event. + * + * @param mixed $callback + * @return void + * @static + */ + public static function after($callback) + { + /** @var \Illuminate\Queue\QueueManager $instance */ + $instance->after($callback); + } + /** + * Register an event listener for the exception occurred job event. + * + * @param mixed $callback + * @return void + * @static + */ + public static function exceptionOccurred($callback) + { + /** @var \Illuminate\Queue\QueueManager $instance */ + $instance->exceptionOccurred($callback); + } + /** + * Register an event listener for the daemon queue loop. + * + * @param mixed $callback + * @return void + * @static + */ + public static function looping($callback) + { + /** @var \Illuminate\Queue\QueueManager $instance */ + $instance->looping($callback); + } + /** + * Register an event listener for the failed job event. + * + * @param mixed $callback + * @return void + * @static + */ + public static function failing($callback) + { + /** @var \Illuminate\Queue\QueueManager $instance */ + $instance->failing($callback); + } + /** + * Register an event listener for the daemon queue stopping. + * + * @param mixed $callback + * @return void + * @static + */ + public static function stopping($callback) + { + /** @var \Illuminate\Queue\QueueManager $instance */ + $instance->stopping($callback); + } + /** + * Determine if the driver is connected. + * + * @param string|null $name + * @return bool + * @static + */ + public static function connected($name = null) + { + /** @var \Illuminate\Queue\QueueManager $instance */ + return $instance->connected($name); + } + /** + * Resolve a queue connection instance. + * + * @param string|null $name + * @return \Illuminate\Contracts\Queue\Queue + * @static + */ + public static function connection($name = null) + { + /** @var \Illuminate\Queue\QueueManager $instance */ + return $instance->connection($name); + } + /** + * Add a queue connection resolver. + * + * @param string $driver + * @param \Closure $resolver + * @return void + * @static + */ + public static function extend($driver, $resolver) + { + /** @var \Illuminate\Queue\QueueManager $instance */ + $instance->extend($driver, $resolver); + } + /** + * Add a queue connection resolver. + * + * @param string $driver + * @param \Closure $resolver + * @return void + * @static + */ + public static function addConnector($driver, $resolver) + { + /** @var \Illuminate\Queue\QueueManager $instance */ + $instance->addConnector($driver, $resolver); + } + /** + * Get the name of the default queue connection. + * + * @return string + * @static + */ + public static function getDefaultDriver() + { + /** @var \Illuminate\Queue\QueueManager $instance */ + return $instance->getDefaultDriver(); + } + /** + * Set the name of the default queue connection. + * + * @param string $name + * @return void + * @static + */ + public static function setDefaultDriver($name) + { + /** @var \Illuminate\Queue\QueueManager $instance */ + $instance->setDefaultDriver($name); + } + /** + * Get the full name for the given connection. + * + * @param string|null $connection + * @return string + * @static + */ + public static function getName($connection = null) + { + /** @var \Illuminate\Queue\QueueManager $instance */ + return $instance->getName($connection); + } + /** + * Get the application instance used by the manager. + * + * @return \Illuminate\Contracts\Foundation\Application + * @static + */ + public static function getApplication() + { + /** @var \Illuminate\Queue\QueueManager $instance */ + return $instance->getApplication(); + } + /** + * Set the application instance used by the manager. + * + * @param \Illuminate\Contracts\Foundation\Application $app + * @return \Illuminate\Queue\QueueManager + * @static + */ + public static function setApplication($app) + { + /** @var \Illuminate\Queue\QueueManager $instance */ + return $instance->setApplication($app); + } + /** + * Assert if a job was pushed based on a truth-test callback. + * + * @param string|\Closure $job + * @param callable|int|null $callback + * @return void + * @static + */ + public static function assertPushed($job, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */ + $instance->assertPushed($job, $callback); + } + /** + * Assert if a job was pushed based on a truth-test callback. + * + * @param string $queue + * @param string|\Closure $job + * @param callable|null $callback + * @return void + * @static + */ + public static function assertPushedOn($queue, $job, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */ + $instance->assertPushedOn($queue, $job, $callback); + } + /** + * Assert if a job was pushed with chained jobs based on a truth-test callback. + * + * @param string $job + * @param array $expectedChain + * @param callable|null $callback + * @return void + * @static + */ + public static function assertPushedWithChain($job, $expectedChain = [], $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */ + $instance->assertPushedWithChain($job, $expectedChain, $callback); + } + /** + * Assert if a job was pushed with an empty chain based on a truth-test callback. + * + * @param string $job + * @param callable|null $callback + * @return void + * @static + */ + public static function assertPushedWithoutChain($job, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */ + $instance->assertPushedWithoutChain($job, $callback); + } + /** + * Determine if a job was pushed based on a truth-test callback. + * + * @param string|\Closure $job + * @param callable|null $callback + * @return void + * @static + */ + public static function assertNotPushed($job, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */ + $instance->assertNotPushed($job, $callback); + } + /** + * Assert that no jobs were pushed. + * + * @return void + * @static + */ + public static function assertNothingPushed() + { + /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */ + $instance->assertNothingPushed(); + } + /** + * Get all of the jobs matching a truth-test callback. + * + * @param string $job + * @param callable|null $callback + * @return \Illuminate\Support\Collection + * @static + */ + public static function pushed($job, $callback = null) + { + /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */ + return $instance->pushed($job, $callback); + } + /** + * Determine if there are any stored jobs for a given class. + * + * @param string $job + * @return bool + * @static + */ + public static function hasPushed($job) + { + /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */ + return $instance->hasPushed($job); + } + /** + * Get the size of the queue. + * + * @param string|null $queue + * @return int + * @static + */ + public static function size($queue = null) + { + /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */ + return $instance->size($queue); + } + /** + * Push a new job onto the queue. + * + * @param string|object $job + * @param mixed $data + * @param string|null $queue + * @return mixed + * @static + */ + public static function push($job, $data = '', $queue = null) + { + /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */ + return $instance->push($job, $data, $queue); + } + /** + * Push a raw payload onto the queue. + * + * @param string $payload + * @param string|null $queue + * @param array $options + * @return mixed + * @static + */ + public static function pushRaw($payload, $queue = null, $options = []) + { + /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */ + return $instance->pushRaw($payload, $queue, $options); + } + /** + * Push a new job onto the queue after a delay. + * + * @param \DateTimeInterface|\DateInterval|int $delay + * @param string|object $job + * @param mixed $data + * @param string|null $queue + * @return mixed + * @static + */ + public static function later($delay, $job, $data = '', $queue = null) + { + /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */ + return $instance->later($delay, $job, $data, $queue); + } + /** + * Push a new job onto the queue. + * + * @param string $queue + * @param string|object $job + * @param mixed $data + * @return mixed + * @static + */ + public static function pushOn($queue, $job, $data = '') + { + /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */ + return $instance->pushOn($queue, $job, $data); + } + /** + * Push a new job onto the queue after a delay. + * + * @param string $queue + * @param \DateTimeInterface|\DateInterval|int $delay + * @param string|object $job + * @param mixed $data + * @return mixed + * @static + */ + public static function laterOn($queue, $delay, $job, $data = '') + { + /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */ + return $instance->laterOn($queue, $delay, $job, $data); + } + /** + * Pop the next job off of the queue. + * + * @param string|null $queue + * @return \Illuminate\Contracts\Queue\Job|null + * @static + */ + public static function pop($queue = null) + { + /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */ + return $instance->pop($queue); + } + /** + * Push an array of jobs onto the queue. + * + * @param array $jobs + * @param mixed $data + * @param string|null $queue + * @return mixed + * @static + */ + public static function bulk($jobs, $data = '', $queue = null) + { + /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */ + return $instance->bulk($jobs, $data, $queue); + } + /** + * Get the jobs that have been pushed. + * + * @return array + * @static + */ + public static function pushedJobs() + { + /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */ + return $instance->pushedJobs(); + } + /** + * Get the connection name for the queue. + * + * @return string + * @static + */ + public static function getConnectionName() + { + /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */ + return $instance->getConnectionName(); + } + /** + * Set the connection name for the queue. + * + * @param string $name + * @return \Illuminate\Support\Testing\Fakes\QueueFake + * @static + */ + public static function setConnectionName($name) + { + /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */ + return $instance->setConnectionName($name); + } + /** + * Get the backoff for an object-based queue handler. + * + * @param mixed $job + * @return mixed + * @static + */ + public static function getJobBackoff($job) + { //Method inherited from \Illuminate\Queue\Queue + /** @var \Illuminate\Queue\SyncQueue $instance */ + return $instance->getJobBackoff($job); + } + /** + * Get the expiration timestamp for an object-based queue handler. + * + * @param mixed $job + * @return mixed + * @static + */ + public static function getJobExpiration($job) + { //Method inherited from \Illuminate\Queue\Queue + /** @var \Illuminate\Queue\SyncQueue $instance */ + return $instance->getJobExpiration($job); + } + /** + * Register a callback to be executed when creating job payloads. + * + * @param callable|null $callback + * @return void + * @static + */ + public static function createPayloadUsing($callback) + { //Method inherited from \Illuminate\Queue\Queue + \Illuminate\Queue\SyncQueue::createPayloadUsing($callback); + } + /** + * Get the container instance being used by the connection. + * + * @return \Illuminate\Container\Container + * @static + */ + public static function getContainer() + { //Method inherited from \Illuminate\Queue\Queue + /** @var \Illuminate\Queue\SyncQueue $instance */ + return $instance->getContainer(); + } + /** + * Set the IoC container instance. + * + * @param \Illuminate\Container\Container $container + * @return void + * @static + */ + public static function setContainer($container) + { //Method inherited from \Illuminate\Queue\Queue + /** @var \Illuminate\Queue\SyncQueue $instance */ + $instance->setContainer($container); + } + + } + /** + * + * + * @see \Illuminate\Routing\Redirector + */ + class Redirect { + /** + * Create a new redirect response to the "home" route. + * + * @param int $status + * @return \Illuminate\Http\RedirectResponse + * @static + */ + public static function home($status = 302) + { + /** @var \Illuminate\Routing\Redirector $instance */ + return $instance->home($status); + } + /** + * Create a new redirect response to the previous location. + * + * @param int $status + * @param array $headers + * @param mixed $fallback + * @return \Illuminate\Http\RedirectResponse + * @static + */ + public static function back($status = 302, $headers = [], $fallback = false) + { + /** @var \Illuminate\Routing\Redirector $instance */ + return $instance->back($status, $headers, $fallback); + } + /** + * Create a new redirect response to the current URI. + * + * @param int $status + * @param array $headers + * @return \Illuminate\Http\RedirectResponse + * @static + */ + public static function refresh($status = 302, $headers = []) + { + /** @var \Illuminate\Routing\Redirector $instance */ + return $instance->refresh($status, $headers); + } + /** + * Create a new redirect response, while putting the current URL in the session. + * + * @param string $path + * @param int $status + * @param array $headers + * @param bool|null $secure + * @return \Illuminate\Http\RedirectResponse + * @static + */ + public static function guest($path, $status = 302, $headers = [], $secure = null) + { + /** @var \Illuminate\Routing\Redirector $instance */ + return $instance->guest($path, $status, $headers, $secure); + } + /** + * Create a new redirect response to the previously intended location. + * + * @param string $default + * @param int $status + * @param array $headers + * @param bool|null $secure + * @return \Illuminate\Http\RedirectResponse + * @static + */ + public static function intended($default = '/', $status = 302, $headers = [], $secure = null) + { + /** @var \Illuminate\Routing\Redirector $instance */ + return $instance->intended($default, $status, $headers, $secure); + } + /** + * Set the intended url. + * + * @param string $url + * @return void + * @static + */ + public static function setIntendedUrl($url) + { + /** @var \Illuminate\Routing\Redirector $instance */ + $instance->setIntendedUrl($url); + } + /** + * Create a new redirect response to the given path. + * + * @param string $path + * @param int $status + * @param array $headers + * @param bool|null $secure + * @return \Illuminate\Http\RedirectResponse + * @static + */ + public static function to($path, $status = 302, $headers = [], $secure = null) + { + /** @var \Illuminate\Routing\Redirector $instance */ + return $instance->to($path, $status, $headers, $secure); + } + /** + * Create a new redirect response to an external URL (no validation). + * + * @param string $path + * @param int $status + * @param array $headers + * @return \Illuminate\Http\RedirectResponse + * @static + */ + public static function away($path, $status = 302, $headers = []) + { + /** @var \Illuminate\Routing\Redirector $instance */ + return $instance->away($path, $status, $headers); + } + /** + * Create a new redirect response to the given HTTPS path. + * + * @param string $path + * @param int $status + * @param array $headers + * @return \Illuminate\Http\RedirectResponse + * @static + */ + public static function secure($path, $status = 302, $headers = []) + { + /** @var \Illuminate\Routing\Redirector $instance */ + return $instance->secure($path, $status, $headers); + } + /** + * Create a new redirect response to a named route. + * + * @param string $route + * @param mixed $parameters + * @param int $status + * @param array $headers + * @return \Illuminate\Http\RedirectResponse + * @static + */ + public static function route($route, $parameters = [], $status = 302, $headers = []) + { + /** @var \Illuminate\Routing\Redirector $instance */ + return $instance->route($route, $parameters, $status, $headers); + } + /** + * Create a new redirect response to a signed named route. + * + * @param string $route + * @param mixed $parameters + * @param \DateTimeInterface|\DateInterval|int|null $expiration + * @param int $status + * @param array $headers + * @return \Illuminate\Http\RedirectResponse + * @static + */ + public static function signedRoute($route, $parameters = [], $expiration = null, $status = 302, $headers = []) + { + /** @var \Illuminate\Routing\Redirector $instance */ + return $instance->signedRoute($route, $parameters, $expiration, $status, $headers); + } + /** + * Create a new redirect response to a signed named route. + * + * @param string $route + * @param \DateTimeInterface|\DateInterval|int|null $expiration + * @param mixed $parameters + * @param int $status + * @param array $headers + * @return \Illuminate\Http\RedirectResponse + * @static + */ + public static function temporarySignedRoute($route, $expiration, $parameters = [], $status = 302, $headers = []) + { + /** @var \Illuminate\Routing\Redirector $instance */ + return $instance->temporarySignedRoute($route, $expiration, $parameters, $status, $headers); + } + /** + * Create a new redirect response to a controller action. + * + * @param string|array $action + * @param mixed $parameters + * @param int $status + * @param array $headers + * @return \Illuminate\Http\RedirectResponse + * @static + */ + public static function action($action, $parameters = [], $status = 302, $headers = []) + { + /** @var \Illuminate\Routing\Redirector $instance */ + return $instance->action($action, $parameters, $status, $headers); + } + /** + * Get the URL generator instance. + * + * @return \Illuminate\Routing\UrlGenerator + * @static + */ + public static function getUrlGenerator() + { + /** @var \Illuminate\Routing\Redirector $instance */ + return $instance->getUrlGenerator(); + } + /** + * Set the active session store. + * + * @param \Illuminate\Session\Store $session + * @return void + * @static + */ + public static function setSession($session) + { + /** @var \Illuminate\Routing\Redirector $instance */ + $instance->setSession($session); + } + /** + * Register a custom macro. + * + * @param string $name + * @param object|callable $macro + * @return void + * @static + */ + public static function macro($name, $macro) + { + \Illuminate\Routing\Redirector::macro($name, $macro); + } + /** + * Mix another object into the class. + * + * @param object $mixin + * @param bool $replace + * @return void + * @throws \ReflectionException + * @static + */ + public static function mixin($mixin, $replace = true) + { + \Illuminate\Routing\Redirector::mixin($mixin, $replace); + } + /** + * Checks if macro is registered. + * + * @param string $name + * @return bool + * @static + */ + public static function hasMacro($name) + { + return \Illuminate\Routing\Redirector::hasMacro($name); + } + /** + * Flush the existing macros. + * + * @return void + * @static + */ + public static function flushMacros() + { + \Illuminate\Routing\Redirector::flushMacros(); + } + + } + /** + * + * + * @method static mixed filterFiles(mixed $files) + * @see \Illuminate\Http\Request + */ + class Request { + /** + * Create a new Illuminate HTTP request from server variables. + * + * @return static + * @static + */ + public static function capture() + { + return \Illuminate\Http\Request::capture(); + } + /** + * Return the Request instance. + * + * @return \Illuminate\Http\Request + * @static + */ + public static function instance() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->instance(); + } + /** + * Get the request method. + * + * @return string + * @static + */ + public static function method() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->method(); + } + /** + * Get the root URL for the application. + * + * @return string + * @static + */ + public static function root() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->root(); + } + /** + * Get the URL (no query string) for the request. + * + * @return string + * @static + */ + public static function url() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->url(); + } + /** + * Get the full URL for the request. + * + * @return string + * @static + */ + public static function fullUrl() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->fullUrl(); + } + /** + * Get the full URL for the request with the added query string parameters. + * + * @param array $query + * @return string + * @static + */ + public static function fullUrlWithQuery($query) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->fullUrlWithQuery($query); + } + /** + * Get the full URL for the request without the given query string parameters. + * + * @param array|string $query + * @return string + * @static + */ + public static function fullUrlWithoutQuery($keys) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->fullUrlWithoutQuery($keys); + } + /** + * Get the current path info for the request. + * + * @return string + * @static + */ + public static function path() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->path(); + } + /** + * Get the current decoded path info for the request. + * + * @return string + * @static + */ + public static function decodedPath() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->decodedPath(); + } + /** + * Get a segment from the URI (1 based index). + * + * @param int $index + * @param string|null $default + * @return string|null + * @static + */ + public static function segment($index, $default = null) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->segment($index, $default); + } + /** + * Get all of the segments for the request path. + * + * @return array + * @static + */ + public static function segments() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->segments(); + } + /** + * Determine if the current request URI matches a pattern. + * + * @param mixed $patterns + * @return bool + * @static + */ + public static function is(...$patterns) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->is(...$patterns); + } + /** + * Determine if the route name matches a given pattern. + * + * @param mixed $patterns + * @return bool + * @static + */ + public static function routeIs(...$patterns) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->routeIs(...$patterns); + } + /** + * Determine if the current request URL and query string match a pattern. + * + * @param mixed $patterns + * @return bool + * @static + */ + public static function fullUrlIs(...$patterns) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->fullUrlIs(...$patterns); + } + /** + * Determine if the request is the result of an AJAX call. + * + * @return bool + * @static + */ + public static function ajax() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->ajax(); + } + /** + * Determine if the request is the result of a PJAX call. + * + * @return bool + * @static + */ + public static function pjax() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->pjax(); + } + /** + * Determine if the request is the result of a prefetch call. + * + * @return bool + * @static + */ + public static function prefetch() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->prefetch(); + } + /** + * Determine if the request is over HTTPS. + * + * @return bool + * @static + */ + public static function secure() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->secure(); + } + /** + * Get the client IP address. + * + * @return string|null + * @static + */ + public static function ip() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->ip(); + } + /** + * Get the client IP addresses. + * + * @return array + * @static + */ + public static function ips() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->ips(); + } + /** + * Get the client user agent. + * + * @return string|null + * @static + */ + public static function userAgent() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->userAgent(); + } + /** + * Merge new input into the current request's input array. + * + * @param array $input + * @return \Illuminate\Http\Request + * @static + */ + public static function merge($input) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->merge($input); + } + /** + * Merge new input into the request's input, but only when that key is missing from the request. + * + * @param array $input + * @return \Illuminate\Http\Request + * @static + */ + public static function mergeIfMissing($input) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->mergeIfMissing($input); + } + /** + * Replace the input for the current request. + * + * @param array $input + * @return \Illuminate\Http\Request + * @static + */ + public static function replace($input) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->replace($input); + } + /** + * This method belongs to Symfony HttpFoundation and is not usually needed when using Laravel. + * + * Instead, you may use the "input" method. + * + * @param string $key + * @param mixed $default + * @return mixed + * @static + */ + public static function get($key, $default = null) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->get($key, $default); + } + /** + * Get the JSON payload for the request. + * + * @param string|null $key + * @param mixed $default + * @return \Symfony\Component\HttpFoundation\ParameterBag|mixed + * @static + */ + public static function json($key = null, $default = null) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->json($key, $default); + } + /** + * Create a new request instance from the given Laravel request. + * + * @param \Illuminate\Http\Request $from + * @param \Illuminate\Http\Request|null $to + * @return static + * @static + */ + public static function createFrom($from, $to = null) + { + return \Illuminate\Http\Request::createFrom($from, $to); + } + /** + * Create an Illuminate request from a Symfony instance. + * + * @param \Symfony\Component\HttpFoundation\Request $request + * @return static + * @static + */ + public static function createFromBase($request) + { + return \Illuminate\Http\Request::createFromBase($request); + } + /** + * Clones a request and overrides some of its parameters. + * + * @return static + * @param array $query The GET parameters + * @param array $request The POST parameters + * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) + * @param array $cookies The COOKIE parameters + * @param array $files The FILES parameters + * @param array $server The SERVER parameters + * @return static + * @static + */ + public static function duplicate($query = null, $request = null, $attributes = null, $cookies = null, $files = null, $server = null) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->duplicate($query, $request, $attributes, $cookies, $files, $server); + } + /** + * Get the session associated with the request. + * + * @return \Illuminate\Session\Store + * @throws \RuntimeException + * @static + */ + public static function session() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->session(); + } + /** + * Get the session associated with the request. + * + * @return \Illuminate\Session\Store|null + * @static + */ + public static function getSession() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->getSession(); + } + /** + * Set the session instance on the request. + * + * @param \Illuminate\Contracts\Session\Session $session + * @return void + * @static + */ + public static function setLaravelSession($session) + { + /** @var \Illuminate\Http\Request $instance */ + $instance->setLaravelSession($session); + } + /** + * Get the user making the request. + * + * @param string|null $guard + * @return mixed + * @static + */ + public static function user($guard = null) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->user($guard); + } + /** + * Get the route handling the request. + * + * @param string|null $param + * @param mixed $default + * @return \Illuminate\Routing\Route|object|string|null + * @static + */ + public static function route($param = null, $default = null) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->route($param, $default); + } + /** + * Get a unique fingerprint for the request / route / IP address. + * + * @return string + * @throws \RuntimeException + * @static + */ + public static function fingerprint() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->fingerprint(); + } + /** + * Set the JSON payload for the request. + * + * @param \Symfony\Component\HttpFoundation\ParameterBag $json + * @return \Illuminate\Http\Request + * @static + */ + public static function setJson($json) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->setJson($json); + } + /** + * Get the user resolver callback. + * + * @return \Closure + * @static + */ + public static function getUserResolver() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->getUserResolver(); + } + /** + * Set the user resolver callback. + * + * @param \Closure $callback + * @return \Illuminate\Http\Request + * @static + */ + public static function setUserResolver($callback) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->setUserResolver($callback); + } + /** + * Get the route resolver callback. + * + * @return \Closure + * @static + */ + public static function getRouteResolver() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->getRouteResolver(); + } + /** + * Set the route resolver callback. + * + * @param \Closure $callback + * @return \Illuminate\Http\Request + * @static + */ + public static function setRouteResolver($callback) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->setRouteResolver($callback); + } + /** + * Get all of the input and files for the request. + * + * @return array + * @static + */ + public static function toArray() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->toArray(); + } + /** + * Determine if the given offset exists. + * + * @param string $offset + * @return bool + * @static + */ + public static function offsetExists($offset) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->offsetExists($offset); + } + /** + * Get the value at the given offset. + * + * @param string $offset + * @return mixed + * @static + */ + public static function offsetGet($offset) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->offsetGet($offset); + } + /** + * Set the value at the given offset. + * + * @param string $offset + * @param mixed $value + * @return void + * @static + */ + public static function offsetSet($offset, $value) + { + /** @var \Illuminate\Http\Request $instance */ + $instance->offsetSet($offset, $value); + } + /** + * Remove the value at the given offset. + * + * @param string $offset + * @return void + * @static + */ + public static function offsetUnset($offset) + { + /** @var \Illuminate\Http\Request $instance */ + $instance->offsetUnset($offset); + } + /** + * Sets the parameters for this request. + * + * This method also re-initializes all properties. + * + * @param array $query The GET parameters + * @param array $request The POST parameters + * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) + * @param array $cookies The COOKIE parameters + * @param array $files The FILES parameters + * @param array $server The SERVER parameters + * @param string|resource|null $content The raw body data + * @static + */ + public static function initialize($query = [], $request = [], $attributes = [], $cookies = [], $files = [], $server = [], $content = null) + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->initialize($query, $request, $attributes, $cookies, $files, $server, $content); + } + /** + * Creates a new request with values from PHP's super globals. + * + * @return static + * @static + */ + public static function createFromGlobals() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + return \Illuminate\Http\Request::createFromGlobals(); + } + /** + * Creates a Request based on a given URI and configuration. + * + * The information contained in the URI always take precedence + * over the other information (server and parameters). + * + * @param string $uri The URI + * @param string $method The HTTP method + * @param array $parameters The query (GET) or request (POST) parameters + * @param array $cookies The request cookies ($_COOKIE) + * @param array $files The request files ($_FILES) + * @param array $server The server parameters ($_SERVER) + * @param string|resource|null $content The raw body data + * @return static + * @static + */ + public static function create($uri, $method = 'GET', $parameters = [], $cookies = [], $files = [], $server = [], $content = null) + { //Method inherited from \Symfony\Component\HttpFoundation\Request + return \Illuminate\Http\Request::create($uri, $method, $parameters, $cookies, $files, $server, $content); + } + /** + * Sets a callable able to create a Request instance. + * + * This is mainly useful when you need to override the Request class + * to keep BC with an existing system. It should not be used for any + * other purpose. + * + * @static + */ + public static function setFactory($callable) + { //Method inherited from \Symfony\Component\HttpFoundation\Request + return \Illuminate\Http\Request::setFactory($callable); + } + /** + * Overrides the PHP global variables according to this request instance. + * + * It overrides $_GET, $_POST, $_REQUEST, $_SERVER, $_COOKIE. + * $_FILES is never overridden, see rfc1867 + * + * @static + */ + public static function overrideGlobals() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->overrideGlobals(); + } + /** + * Sets a list of trusted proxies. + * + * You should only list the reverse proxies that you manage directly. + * + * @param array $proxies A list of trusted proxies, the string 'REMOTE_ADDR' will be replaced with $_SERVER['REMOTE_ADDR'] + * @param int $trustedHeaderSet A bit field of Request::HEADER_*, to set which headers to trust from your proxies + * @static + */ + public static function setTrustedProxies($proxies, $trustedHeaderSet) + { //Method inherited from \Symfony\Component\HttpFoundation\Request + return \Illuminate\Http\Request::setTrustedProxies($proxies, $trustedHeaderSet); + } + /** + * Gets the list of trusted proxies. + * + * @return array + * @static + */ + public static function getTrustedProxies() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + return \Illuminate\Http\Request::getTrustedProxies(); + } + /** + * Gets the set of trusted headers from trusted proxies. + * + * @return int A bit field of Request::HEADER_* that defines which headers are trusted from your proxies + * @static + */ + public static function getTrustedHeaderSet() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + return \Illuminate\Http\Request::getTrustedHeaderSet(); + } + /** + * Sets a list of trusted host patterns. + * + * You should only list the hosts you manage using regexs. + * + * @param array $hostPatterns A list of trusted host patterns + * @static + */ + public static function setTrustedHosts($hostPatterns) + { //Method inherited from \Symfony\Component\HttpFoundation\Request + return \Illuminate\Http\Request::setTrustedHosts($hostPatterns); + } + /** + * Gets the list of trusted host patterns. + * + * @return array + * @static + */ + public static function getTrustedHosts() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + return \Illuminate\Http\Request::getTrustedHosts(); + } + /** + * Normalizes a query string. + * + * It builds a normalized query string, where keys/value pairs are alphabetized, + * have consistent escaping and unneeded delimiters are removed. + * + * @return string + * @static + */ + public static function normalizeQueryString($qs) + { //Method inherited from \Symfony\Component\HttpFoundation\Request + return \Illuminate\Http\Request::normalizeQueryString($qs); + } + /** + * Enables support for the _method request parameter to determine the intended HTTP method. + * + * Be warned that enabling this feature might lead to CSRF issues in your code. + * Check that you are using CSRF tokens when required. + * If the HTTP method parameter override is enabled, an html-form with method "POST" can be altered + * and used to send a "PUT" or "DELETE" request via the _method request parameter. + * If these methods are not protected against CSRF, this presents a possible vulnerability. + * + * The HTTP method can only be overridden when the real HTTP method is POST. + * + * @static + */ + public static function enableHttpMethodParameterOverride() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + return \Illuminate\Http\Request::enableHttpMethodParameterOverride(); + } + /** + * Checks whether support for the _method request parameter is enabled. + * + * @return bool + * @static + */ + public static function getHttpMethodParameterOverride() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + return \Illuminate\Http\Request::getHttpMethodParameterOverride(); + } + /** + * Whether the request contains a Session which was started in one of the + * previous requests. + * + * @return bool + * @static + */ + public static function hasPreviousSession() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->hasPreviousSession(); + } + /** + * Whether the request contains a Session object. + * + * This method does not give any information about the state of the session object, + * like whether the session is started or not. It is just a way to check if this Request + * is associated with a Session instance. + * + * @param bool $skipIfUninitialized When true, ignores factories injected by `setSessionFactory` + * @return bool + * @static + */ + public static function hasSession() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->hasSession(); + } + /** + * + * + * @static + */ + public static function setSession($session) + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->setSession($session); + } + /** + * + * + * @internal + * @param \Symfony\Component\HttpFoundation\callable(): SessionInterface $factory + * @static + */ + public static function setSessionFactory($factory) + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->setSessionFactory($factory); + } + /** + * Returns the client IP addresses. + * + * In the returned array the most trusted IP address is first, and the + * least trusted one last. The "real" client IP address is the last one, + * but this is also the least trusted one. Trusted proxies are stripped. + * + * Use this method carefully; you should use getClientIp() instead. + * + * @return array + * @see getClientIp() + * @static + */ + public static function getClientIps() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getClientIps(); + } + /** + * Returns the client IP address. + * + * This method can read the client IP address from the "X-Forwarded-For" header + * when trusted proxies were set via "setTrustedProxies()". The "X-Forwarded-For" + * header value is a comma+space separated list of IP addresses, the left-most + * being the original client, and each successive proxy that passed the request + * adding the IP address where it received the request from. + * + * If your reverse proxy uses a different header name than "X-Forwarded-For", + * ("Client-Ip" for instance), configure it via the $trustedHeaderSet + * argument of the Request::setTrustedProxies() method instead. + * + * @return string|null + * @see getClientIps() + * @see https://wikipedia.org/wiki/X-Forwarded-For + * @static + */ + public static function getClientIp() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getClientIp(); + } + /** + * Returns current script name. + * + * @return string + * @static + */ + public static function getScriptName() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getScriptName(); + } + /** + * Returns the path being requested relative to the executed script. + * + * The path info always starts with a /. + * + * Suppose this request is instantiated from /mysite on localhost: + * + * * http://localhost/mysite returns an empty string + * * http://localhost/mysite/about returns '/about' + * * http://localhost/mysite/enco%20ded returns '/enco%20ded' + * * http://localhost/mysite/about?var=1 returns '/about' + * + * @return string The raw path (i.e. not urldecoded) + * @static + */ + public static function getPathInfo() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getPathInfo(); + } + /** + * Returns the root path from which this request is executed. + * + * Suppose that an index.php file instantiates this request object: + * + * * http://localhost/index.php returns an empty string + * * http://localhost/index.php/page returns an empty string + * * http://localhost/web/index.php returns '/web' + * * http://localhost/we%20b/index.php returns '/we%20b' + * + * @return string The raw path (i.e. not urldecoded) + * @static + */ + public static function getBasePath() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getBasePath(); + } + /** + * Returns the root URL from which this request is executed. + * + * The base URL never ends with a /. + * + * This is similar to getBasePath(), except that it also includes the + * script filename (e.g. index.php) if one exists. + * + * @return string The raw URL (i.e. not urldecoded) + * @static + */ + public static function getBaseUrl() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getBaseUrl(); + } + /** + * Gets the request's scheme. + * + * @return string + * @static + */ + public static function getScheme() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getScheme(); + } + /** + * Returns the port on which the request is made. + * + * This method can read the client port from the "X-Forwarded-Port" header + * when trusted proxies were set via "setTrustedProxies()". + * + * The "X-Forwarded-Port" header must contain the client port. + * + * @return int|string|null Can be a string if fetched from the server bag + * @static + */ + public static function getPort() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getPort(); + } + /** + * Returns the user. + * + * @return string|null + * @static + */ + public static function getUser() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getUser(); + } + /** + * Returns the password. + * + * @return string|null + * @static + */ + public static function getPassword() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getPassword(); + } + /** + * Gets the user info. + * + * @return string|null A user name if any and, optionally, scheme-specific information about how to gain authorization to access the server + * @static + */ + public static function getUserInfo() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getUserInfo(); + } + /** + * Returns the HTTP host being requested. + * + * The port name will be appended to the host if it's non-standard. + * + * @return string + * @static + */ + public static function getHttpHost() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getHttpHost(); + } + /** + * Returns the requested URI (path and query string). + * + * @return string The raw URI (i.e. not URI decoded) + * @static + */ + public static function getRequestUri() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getRequestUri(); + } + /** + * Gets the scheme and HTTP host. + * + * If the URL was called with basic authentication, the user + * and the password are not added to the generated string. + * + * @return string + * @static + */ + public static function getSchemeAndHttpHost() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getSchemeAndHttpHost(); + } + /** + * Generates a normalized URI (URL) for the Request. + * + * @return string + * @see getQueryString() + * @static + */ + public static function getUri() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getUri(); + } + /** + * Generates a normalized URI for the given path. + * + * @param string $path A path to use instead of the current one + * @return string + * @static + */ + public static function getUriForPath($path) + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getUriForPath($path); + } + /** + * Returns the path as relative reference from the current Request path. + * + * Only the URIs path component (no schema, host etc.) is relevant and must be given. + * Both paths must be absolute and not contain relative parts. + * Relative URLs from one resource to another are useful when generating self-contained downloadable document archives. + * Furthermore, they can be used to reduce the link size in documents. + * + * Example target paths, given a base path of "/a/b/c/d": + * - "/a/b/c/d" -> "" + * - "/a/b/c/" -> "./" + * - "/a/b/" -> "../" + * - "/a/b/c/other" -> "other" + * - "/a/x/y" -> "../../x/y" + * + * @return string + * @static + */ + public static function getRelativeUriForPath($path) + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getRelativeUriForPath($path); + } + /** + * Generates the normalized query string for the Request. + * + * It builds a normalized query string, where keys/value pairs are alphabetized + * and have consistent escaping. + * + * @return string|null + * @static + */ + public static function getQueryString() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getQueryString(); + } + /** + * Checks whether the request is secure or not. + * + * This method can read the client protocol from the "X-Forwarded-Proto" header + * when trusted proxies were set via "setTrustedProxies()". + * + * The "X-Forwarded-Proto" header must contain the protocol: "https" or "http". + * + * @return bool + * @static + */ + public static function isSecure() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->isSecure(); + } + /** + * Returns the host name. + * + * This method can read the client host name from the "X-Forwarded-Host" header + * when trusted proxies were set via "setTrustedProxies()". + * + * The "X-Forwarded-Host" header must contain the client host name. + * + * @return string + * @throws SuspiciousOperationException when the host name is invalid or not trusted + * @static + */ + public static function getHost() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getHost(); + } + /** + * Sets the request method. + * + * @static + */ + public static function setMethod($method) + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->setMethod($method); + } + /** + * Gets the request "intended" method. + * + * If the X-HTTP-Method-Override header is set, and if the method is a POST, + * then it is used to determine the "real" intended HTTP method. + * + * The _method request parameter can also be used to determine the HTTP method, + * but only if enableHttpMethodParameterOverride() has been called. + * + * The method is always an uppercased string. + * + * @return string + * @see getRealMethod() + * @static + */ + public static function getMethod() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getMethod(); + } + /** + * Gets the "real" request method. + * + * @return string + * @see getMethod() + * @static + */ + public static function getRealMethod() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getRealMethod(); + } + /** + * Gets the mime type associated with the format. + * + * @return string|null + * @static + */ + public static function getMimeType($format) + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getMimeType($format); + } + /** + * Gets the mime types associated with the format. + * + * @return array + * @static + */ + public static function getMimeTypes($format) + { //Method inherited from \Symfony\Component\HttpFoundation\Request + return \Illuminate\Http\Request::getMimeTypes($format); + } + /** + * Gets the format associated with the mime type. + * + * @return string|null + * @static + */ + public static function getFormat($mimeType) + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getFormat($mimeType); + } + /** + * Associates a format with mime types. + * + * @param string|array $mimeTypes The associated mime types (the preferred one must be the first as it will be used as the content type) + * @static + */ + public static function setFormat($format, $mimeTypes) + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->setFormat($format, $mimeTypes); + } + /** + * Gets the request format. + * + * Here is the process to determine the format: + * + * * format defined by the user (with setRequestFormat()) + * * _format request attribute + * * $default + * + * @see getPreferredFormat + * @return string|null + * @static + */ + public static function getRequestFormat($default = 'html') + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getRequestFormat($default); + } + /** + * Sets the request format. + * + * @static + */ + public static function setRequestFormat($format) + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->setRequestFormat($format); + } + /** + * Gets the format associated with the request. + * + * @return string|null + * @static + */ + public static function getContentType() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getContentType(); + } + /** + * Sets the default locale. + * + * @static + */ + public static function setDefaultLocale($locale) + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->setDefaultLocale($locale); + } + /** + * Get the default locale. + * + * @return string + * @static + */ + public static function getDefaultLocale() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getDefaultLocale(); + } + /** + * Sets the locale. + * + * @static + */ + public static function setLocale($locale) + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->setLocale($locale); + } + /** + * Get the locale. + * + * @return string + * @static + */ + public static function getLocale() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getLocale(); + } + /** + * Checks if the request method is of specified type. + * + * @param string $method Uppercase request method (GET, POST etc) + * @return bool + * @static + */ + public static function isMethod($method) + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->isMethod($method); + } + /** + * Checks whether or not the method is safe. + * + * @see https://tools.ietf.org/html/rfc7231#section-4.2.1 + * @return bool + * @static + */ + public static function isMethodSafe() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->isMethodSafe(); + } + /** + * Checks whether or not the method is idempotent. + * + * @return bool + * @static + */ + public static function isMethodIdempotent() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->isMethodIdempotent(); + } + /** + * Checks whether the method is cacheable or not. + * + * @see https://tools.ietf.org/html/rfc7231#section-4.2.3 + * @return bool + * @static + */ + public static function isMethodCacheable() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->isMethodCacheable(); + } + /** + * Returns the protocol version. + * + * If the application is behind a proxy, the protocol version used in the + * requests between the client and the proxy and between the proxy and the + * server might be different. This returns the former (from the "Via" header) + * if the proxy is trusted (see "setTrustedProxies()"), otherwise it returns + * the latter (from the "SERVER_PROTOCOL" server parameter). + * + * @return string|null + * @static + */ + public static function getProtocolVersion() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getProtocolVersion(); + } + /** + * Returns the request body content. + * + * @param bool $asResource If true, a resource will be returned + * @return string|resource + * @static + */ + public static function getContent($asResource = false) + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getContent($asResource); + } + /** + * Gets the Etags. + * + * @return array + * @static + */ + public static function getETags() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getETags(); + } + /** + * + * + * @return bool + * @static + */ + public static function isNoCache() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->isNoCache(); + } + /** + * Gets the preferred format for the response by inspecting, in the following order: + * * the request format set using setRequestFormat; + * * the values of the Accept HTTP header. + * + * Note that if you use this method, you should send the "Vary: Accept" header + * in the response to prevent any issues with intermediary HTTP caches. + * + * @static + */ + public static function getPreferredFormat($default = 'html') + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getPreferredFormat($default); + } + /** + * Returns the preferred language. + * + * @param string[] $locales An array of ordered available locales + * @return string|null + * @static + */ + public static function getPreferredLanguage($locales = null) + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getPreferredLanguage($locales); + } + /** + * Gets a list of languages acceptable by the client browser ordered in the user browser preferences. + * + * @return array + * @static + */ + public static function getLanguages() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getLanguages(); + } + /** + * Gets a list of charsets acceptable by the client browser in preferable order. + * + * @return array + * @static + */ + public static function getCharsets() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getCharsets(); + } + /** + * Gets a list of encodings acceptable by the client browser in preferable order. + * + * @return array + * @static + */ + public static function getEncodings() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getEncodings(); + } + /** + * Gets a list of content types acceptable by the client browser in preferable order. + * + * @return array + * @static + */ + public static function getAcceptableContentTypes() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->getAcceptableContentTypes(); + } + /** + * Returns true if the request is an XMLHttpRequest. + * + * It works if your JavaScript library sets an X-Requested-With HTTP header. + * It is known to work with common JavaScript frameworks: + * + * @see https://wikipedia.org/wiki/List_of_Ajax_frameworks#JavaScript + * @return bool + * @static + */ + public static function isXmlHttpRequest() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->isXmlHttpRequest(); + } + /** + * Checks whether the client browser prefers safe content or not according to RFC8674. + * + * @see https://tools.ietf.org/html/rfc8674 + * @static + */ + public static function preferSafeContent() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->preferSafeContent(); + } + /** + * Indicates whether this request originated from a trusted proxy. + * + * This can be useful to determine whether or not to trust the + * contents of a proxy-specific header. + * + * @return bool + * @static + */ + public static function isFromTrustedProxy() + { //Method inherited from \Symfony\Component\HttpFoundation\Request + /** @var \Illuminate\Http\Request $instance */ + return $instance->isFromTrustedProxy(); + } + /** + * Determine if the request is sending JSON. + * + * @return bool + * @static + */ + public static function isJson() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->isJson(); + } + /** + * Determine if the current request probably expects a JSON response. + * + * @return bool + * @static + */ + public static function expectsJson() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->expectsJson(); + } + /** + * Determine if the current request is asking for JSON. + * + * @return bool + * @static + */ + public static function wantsJson() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->wantsJson(); + } + /** + * Determines whether the current requests accepts a given content type. + * + * @param string|array $contentTypes + * @return bool + * @static + */ + public static function accepts($contentTypes) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->accepts($contentTypes); + } + /** + * Return the most suitable content type from the given array based on content negotiation. + * + * @param string|array $contentTypes + * @return string|null + * @static + */ + public static function prefers($contentTypes) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->prefers($contentTypes); + } + /** + * Determine if the current request accepts any content type. + * + * @return bool + * @static + */ + public static function acceptsAnyContentType() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->acceptsAnyContentType(); + } + /** + * Determines whether a request accepts JSON. + * + * @return bool + * @static + */ + public static function acceptsJson() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->acceptsJson(); + } + /** + * Determines whether a request accepts HTML. + * + * @return bool + * @static + */ + public static function acceptsHtml() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->acceptsHtml(); + } + /** + * Determine if the given content types match. + * + * @param string $actual + * @param string $type + * @return bool + * @static + */ + public static function matchesType($actual, $type) + { + return \Illuminate\Http\Request::matchesType($actual, $type); + } + /** + * Get the data format expected in the response. + * + * @param string $default + * @return string + * @static + */ + public static function format($default = 'html') + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->format($default); + } + /** + * Retrieve an old input item. + * + * @param string|null $key + * @param string|array|null $default + * @return string|array|null + * @static + */ + public static function old($key = null, $default = null) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->old($key, $default); + } + /** + * Flash the input for the current request to the session. + * + * @return void + * @static + */ + public static function flash() + { + /** @var \Illuminate\Http\Request $instance */ + $instance->flash(); + } + /** + * Flash only some of the input to the session. + * + * @param array|mixed $keys + * @return void + * @static + */ + public static function flashOnly($keys) + { + /** @var \Illuminate\Http\Request $instance */ + $instance->flashOnly($keys); + } + /** + * Flash only some of the input to the session. + * + * @param array|mixed $keys + * @return void + * @static + */ + public static function flashExcept($keys) + { + /** @var \Illuminate\Http\Request $instance */ + $instance->flashExcept($keys); + } + /** + * Flush all of the old input from the session. + * + * @return void + * @static + */ + public static function flush() + { + /** @var \Illuminate\Http\Request $instance */ + $instance->flush(); + } + /** + * Retrieve a server variable from the request. + * + * @param string|null $key + * @param string|array|null $default + * @return string|array|null + * @static + */ + public static function server($key = null, $default = null) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->server($key, $default); + } + /** + * Determine if a header is set on the request. + * + * @param string $key + * @return bool + * @static + */ + public static function hasHeader($key) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->hasHeader($key); + } + /** + * Retrieve a header from the request. + * + * @param string|null $key + * @param string|array|null $default + * @return string|array|null + * @static + */ + public static function header($key = null, $default = null) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->header($key, $default); + } + /** + * Get the bearer token from the request headers. + * + * @return string|null + * @static + */ + public static function bearerToken() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->bearerToken(); + } + /** + * Determine if the request contains a given input item key. + * + * @param string|array $key + * @return bool + * @static + */ + public static function exists($key) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->exists($key); + } + /** + * Determine if the request contains a given input item key. + * + * @param string|array $key + * @return bool + * @static + */ + public static function has($key) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->has($key); + } + /** + * Determine if the request contains any of the given inputs. + * + * @param string|array $keys + * @return bool + * @static + */ + public static function hasAny($keys) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->hasAny($keys); + } + /** + * Apply the callback if the request contains the given input item key. + * + * @param string $key + * @param callable $callback + * @param callable|null $default + * @return $this|mixed + * @static + */ + public static function whenHas($key, $callback, $default = null) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->whenHas($key, $callback, $default); + } + /** + * Determine if the request contains a non-empty value for an input item. + * + * @param string|array $key + * @return bool + * @static + */ + public static function filled($key) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->filled($key); + } + /** + * Determine if the request contains an empty value for an input item. + * + * @param string|array $key + * @return bool + * @static + */ + public static function isNotFilled($key) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->isNotFilled($key); + } + /** + * Determine if the request contains a non-empty value for any of the given inputs. + * + * @param string|array $keys + * @return bool + * @static + */ + public static function anyFilled($keys) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->anyFilled($keys); + } + /** + * Apply the callback if the request contains a non-empty value for the given input item key. + * + * @param string $key + * @param callable $callback + * @param callable|null $default + * @return $this|mixed + * @static + */ + public static function whenFilled($key, $callback, $default = null) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->whenFilled($key, $callback, $default); + } + /** + * Determine if the request is missing a given input item key. + * + * @param string|array $key + * @return bool + * @static + */ + public static function missing($key) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->missing($key); + } + /** + * Get the keys for all of the input and files. + * + * @return array + * @static + */ + public static function keys() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->keys(); + } + /** + * Get all of the input and files for the request. + * + * @param array|mixed|null $keys + * @return array + * @static + */ + public static function all($keys = null) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->all($keys); + } + /** + * Retrieve an input item from the request. + * + * @param string|null $key + * @param mixed $default + * @return mixed + * @static + */ + public static function input($key = null, $default = null) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->input($key, $default); + } + /** + * Retrieve input as a boolean value. + * + * Returns true when value is "1", "true", "on", and "yes". Otherwise, returns false. + * + * @param string|null $key + * @param bool $default + * @return bool + * @static + */ + public static function boolean($key = null, $default = false) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->boolean($key, $default); + } + /** + * Retrieve input from the request as a Carbon instance. + * + * @param string $key + * @param string|null $format + * @param string|null $tz + * @return \Illuminate\Support\Carbon|null + * @static + */ + public static function date($key, $format = null, $tz = null) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->date($key, $format, $tz); + } + /** + * Retrieve input from the request as a collection. + * + * @param array|string|null $key + * @return \Illuminate\Support\Collection + * @static + */ + public static function collect($key = null) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->collect($key); + } + /** + * Get a subset containing the provided keys with values from the input data. + * + * @param array|mixed $keys + * @return array + * @static + */ + public static function only($keys) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->only($keys); + } + /** + * Get all of the input except for a specified array of items. + * + * @param array|mixed $keys + * @return array + * @static + */ + public static function except($keys) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->except($keys); + } + /** + * Retrieve a query string item from the request. + * + * @param string|null $key + * @param string|array|null $default + * @return string|array|null + * @static + */ + public static function query($key = null, $default = null) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->query($key, $default); + } + /** + * Retrieve a request payload item from the request. + * + * @param string|null $key + * @param string|array|null $default + * @return string|array|null + * @static + */ + public static function post($key = null, $default = null) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->post($key, $default); + } + /** + * Determine if a cookie is set on the request. + * + * @param string $key + * @return bool + * @static + */ + public static function hasCookie($key) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->hasCookie($key); + } + /** + * Retrieve a cookie from the request. + * + * @param string|null $key + * @param string|array|null $default + * @return string|array|null + * @static + */ + public static function cookie($key = null, $default = null) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->cookie($key, $default); + } + /** + * Get an array of all of the files on the request. + * + * @return array + * @static + */ + public static function allFiles() + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->allFiles(); + } + /** + * Determine if the uploaded data contains a file. + * + * @param string $key + * @return bool + * @static + */ + public static function hasFile($key) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->hasFile($key); + } + /** + * Retrieve a file from the request. + * + * @param string|null $key + * @param mixed $default + * @return \Illuminate\Http\UploadedFile|\Illuminate\Http\UploadedFile[]|array|null + * @static + */ + public static function file($key = null, $default = null) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->file($key, $default); + } + /** + * Dump the request items and end the script. + * + * @param mixed $keys + * @return void + * @static + */ + public static function dd(...$keys) + { + /** @var \Illuminate\Http\Request $instance */ + $instance->dd(...$keys); + } + /** + * Dump the items. + * + * @param mixed $keys + * @return \Illuminate\Http\Request + * @static + */ + public static function dump($keys = []) + { + /** @var \Illuminate\Http\Request $instance */ + return $instance->dump($keys); + } + /** + * Register a custom macro. + * + * @param string $name + * @param object|callable $macro + * @return void + * @static + */ + public static function macro($name, $macro) + { + \Illuminate\Http\Request::macro($name, $macro); + } + /** + * Mix another object into the class. + * + * @param object $mixin + * @param bool $replace + * @return void + * @throws \ReflectionException + * @static + */ + public static function mixin($mixin, $replace = true) + { + \Illuminate\Http\Request::mixin($mixin, $replace); + } + /** + * Checks if macro is registered. + * + * @param string $name + * @return bool + * @static + */ + public static function hasMacro($name) + { + return \Illuminate\Http\Request::hasMacro($name); + } + /** + * Flush the existing macros. + * + * @return void + * @static + */ + public static function flushMacros() + { + \Illuminate\Http\Request::flushMacros(); + } + /** + * + * + * @see \Illuminate\Foundation\Providers\FoundationServiceProvider::registerRequestValidation() + * @param array $rules + * @param mixed $params + * @static + */ + public static function validate($rules, ...$params) + { + return \Illuminate\Http\Request::validate($rules, ...$params); + } + /** + * + * + * @see \Illuminate\Foundation\Providers\FoundationServiceProvider::registerRequestValidation() + * @param string $errorBag + * @param array $rules + * @param mixed $params + * @static + */ + public static function validateWithBag($errorBag, $rules, ...$params) + { + return \Illuminate\Http\Request::validateWithBag($errorBag, $rules, ...$params); + } + /** + * + * + * @see \Illuminate\Foundation\Providers\FoundationServiceProvider::registerRequestSignatureValidation() + * @param mixed $absolute + * @static + */ + public static function hasValidSignature($absolute = true) + { + return \Illuminate\Http\Request::hasValidSignature($absolute); + } + /** + * + * + * @see \Illuminate\Foundation\Providers\FoundationServiceProvider::registerRequestSignatureValidation() + * @static + */ + public static function hasValidRelativeSignature() + { + return \Illuminate\Http\Request::hasValidRelativeSignature(); + } + + } + /** + * + * + * @see \Illuminate\Contracts\Routing\ResponseFactory + */ + class Response { + /** + * Create a new response instance. + * + * @param mixed $content + * @param int $status + * @param array $headers + * @return \Illuminate\Http\Response + * @static + */ + public static function make($content = '', $status = 200, $headers = []) + { + /** @var \Illuminate\Routing\ResponseFactory $instance */ + return $instance->make($content, $status, $headers); + } + /** + * Create a new "no content" response. + * + * @param int $status + * @param array $headers + * @return \Illuminate\Http\Response + * @static + */ + public static function noContent($status = 204, $headers = []) + { + /** @var \Illuminate\Routing\ResponseFactory $instance */ + return $instance->noContent($status, $headers); + } + /** + * Create a new response for a given view. + * + * @param string|array $view + * @param array $data + * @param int $status + * @param array $headers + * @return \Illuminate\Http\Response + * @static + */ + public static function view($view, $data = [], $status = 200, $headers = []) + { + /** @var \Illuminate\Routing\ResponseFactory $instance */ + return $instance->view($view, $data, $status, $headers); + } + /** + * Create a new JSON response instance. + * + * @param mixed $data + * @param int $status + * @param array $headers + * @param int $options + * @return \Illuminate\Http\JsonResponse + * @static + */ + public static function json($data = [], $status = 200, $headers = [], $options = 0) + { + /** @var \Illuminate\Routing\ResponseFactory $instance */ + return $instance->json($data, $status, $headers, $options); + } + /** + * Create a new JSONP response instance. + * + * @param string $callback + * @param mixed $data + * @param int $status + * @param array $headers + * @param int $options + * @return \Illuminate\Http\JsonResponse + * @static + */ + public static function jsonp($callback, $data = [], $status = 200, $headers = [], $options = 0) + { + /** @var \Illuminate\Routing\ResponseFactory $instance */ + return $instance->jsonp($callback, $data, $status, $headers, $options); + } + /** + * Create a new streamed response instance. + * + * @param \Closure $callback + * @param int $status + * @param array $headers + * @return \Symfony\Component\HttpFoundation\StreamedResponse + * @static + */ + public static function stream($callback, $status = 200, $headers = []) + { + /** @var \Illuminate\Routing\ResponseFactory $instance */ + return $instance->stream($callback, $status, $headers); + } + /** + * Create a new streamed response instance as a file download. + * + * @param \Closure $callback + * @param string|null $name + * @param array $headers + * @param string|null $disposition + * @return \Symfony\Component\HttpFoundation\StreamedResponse + * @static + */ + public static function streamDownload($callback, $name = null, $headers = [], $disposition = 'attachment') + { + /** @var \Illuminate\Routing\ResponseFactory $instance */ + return $instance->streamDownload($callback, $name, $headers, $disposition); + } + /** + * Create a new file download response. + * + * @param \SplFileInfo|string $file + * @param string|null $name + * @param array $headers + * @param string|null $disposition + * @return \Symfony\Component\HttpFoundation\BinaryFileResponse + * @static + */ + public static function download($file, $name = null, $headers = [], $disposition = 'attachment') + { + /** @var \Illuminate\Routing\ResponseFactory $instance */ + return $instance->download($file, $name, $headers, $disposition); + } + /** + * Return the raw contents of a binary file. + * + * @param \SplFileInfo|string $file + * @param array $headers + * @return \Symfony\Component\HttpFoundation\BinaryFileResponse + * @static + */ + public static function file($file, $headers = []) + { + /** @var \Illuminate\Routing\ResponseFactory $instance */ + return $instance->file($file, $headers); + } + /** + * Create a new redirect response to the given path. + * + * @param string $path + * @param int $status + * @param array $headers + * @param bool|null $secure + * @return \Illuminate\Http\RedirectResponse + * @static + */ + public static function redirectTo($path, $status = 302, $headers = [], $secure = null) + { + /** @var \Illuminate\Routing\ResponseFactory $instance */ + return $instance->redirectTo($path, $status, $headers, $secure); + } + /** + * Create a new redirect response to a named route. + * + * @param string $route + * @param mixed $parameters + * @param int $status + * @param array $headers + * @return \Illuminate\Http\RedirectResponse + * @static + */ + public static function redirectToRoute($route, $parameters = [], $status = 302, $headers = []) + { + /** @var \Illuminate\Routing\ResponseFactory $instance */ + return $instance->redirectToRoute($route, $parameters, $status, $headers); + } + /** + * Create a new redirect response to a controller action. + * + * @param string $action + * @param mixed $parameters + * @param int $status + * @param array $headers + * @return \Illuminate\Http\RedirectResponse + * @static + */ + public static function redirectToAction($action, $parameters = [], $status = 302, $headers = []) + { + /** @var \Illuminate\Routing\ResponseFactory $instance */ + return $instance->redirectToAction($action, $parameters, $status, $headers); + } + /** + * Create a new redirect response, while putting the current URL in the session. + * + * @param string $path + * @param int $status + * @param array $headers + * @param bool|null $secure + * @return \Illuminate\Http\RedirectResponse + * @static + */ + public static function redirectGuest($path, $status = 302, $headers = [], $secure = null) + { + /** @var \Illuminate\Routing\ResponseFactory $instance */ + return $instance->redirectGuest($path, $status, $headers, $secure); + } + /** + * Create a new redirect response to the previously intended location. + * + * @param string $default + * @param int $status + * @param array $headers + * @param bool|null $secure + * @return \Illuminate\Http\RedirectResponse + * @static + */ + public static function redirectToIntended($default = '/', $status = 302, $headers = [], $secure = null) + { + /** @var \Illuminate\Routing\ResponseFactory $instance */ + return $instance->redirectToIntended($default, $status, $headers, $secure); + } + /** + * Register a custom macro. + * + * @param string $name + * @param object|callable $macro + * @return void + * @static + */ + public static function macro($name, $macro) + { + \Illuminate\Routing\ResponseFactory::macro($name, $macro); + } + /** + * Mix another object into the class. + * + * @param object $mixin + * @param bool $replace + * @return void + * @throws \ReflectionException + * @static + */ + public static function mixin($mixin, $replace = true) + { + \Illuminate\Routing\ResponseFactory::mixin($mixin, $replace); + } + /** + * Checks if macro is registered. + * + * @param string $name + * @return bool + * @static + */ + public static function hasMacro($name) + { + return \Illuminate\Routing\ResponseFactory::hasMacro($name); + } + /** + * Flush the existing macros. + * + * @return void + * @static + */ + public static function flushMacros() + { + \Illuminate\Routing\ResponseFactory::flushMacros(); + } + + } + /** + * + * + * @method static \Illuminate\Routing\RouteRegistrar as(string $value) + * @method static \Illuminate\Routing\RouteRegistrar controller(string $controller) + * @method static \Illuminate\Routing\RouteRegistrar domain(string $value) + * @method static \Illuminate\Routing\RouteRegistrar middleware(array|string|null $middleware) + * @method static \Illuminate\Routing\RouteRegistrar name(string $value) + * @method static \Illuminate\Routing\RouteRegistrar namespace(string|null $value) + * @method static \Illuminate\Routing\RouteRegistrar prefix(string $prefix) + * @method static \Illuminate\Routing\RouteRegistrar scopeBindings() + * @method static \Illuminate\Routing\RouteRegistrar where(array $where) + * @method static \Illuminate\Routing\RouteRegistrar withoutMiddleware(array|string $middleware) + * @see \Illuminate\Routing\Router + */ + class Route { + /** + * Register a new GET route with the router. + * + * @param string $uri + * @param array|string|callable|null $action + * @return \Illuminate\Routing\Route + * @static + */ + public static function get($uri, $action = null) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->get($uri, $action); + } + /** + * Register a new POST route with the router. + * + * @param string $uri + * @param array|string|callable|null $action + * @return \Illuminate\Routing\Route + * @static + */ + public static function post($uri, $action = null) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->post($uri, $action); + } + /** + * Register a new PUT route with the router. + * + * @param string $uri + * @param array|string|callable|null $action + * @return \Illuminate\Routing\Route + * @static + */ + public static function put($uri, $action = null) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->put($uri, $action); + } + /** + * Register a new PATCH route with the router. + * + * @param string $uri + * @param array|string|callable|null $action + * @return \Illuminate\Routing\Route + * @static + */ + public static function patch($uri, $action = null) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->patch($uri, $action); + } + /** + * Register a new DELETE route with the router. + * + * @param string $uri + * @param array|string|callable|null $action + * @return \Illuminate\Routing\Route + * @static + */ + public static function delete($uri, $action = null) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->delete($uri, $action); + } + /** + * Register a new OPTIONS route with the router. + * + * @param string $uri + * @param array|string|callable|null $action + * @return \Illuminate\Routing\Route + * @static + */ + public static function options($uri, $action = null) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->options($uri, $action); + } + /** + * Register a new route responding to all verbs. + * + * @param string $uri + * @param array|string|callable|null $action + * @return \Illuminate\Routing\Route + * @static + */ + public static function any($uri, $action = null) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->any($uri, $action); + } + /** + * Register a new Fallback route with the router. + * + * @param array|string|callable|null $action + * @return \Illuminate\Routing\Route + * @static + */ + public static function fallback($action) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->fallback($action); + } + /** + * Create a redirect from one URI to another. + * + * @param string $uri + * @param string $destination + * @param int $status + * @return \Illuminate\Routing\Route + * @static + */ + public static function redirect($uri, $destination, $status = 302) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->redirect($uri, $destination, $status); + } + /** + * Create a permanent redirect from one URI to another. + * + * @param string $uri + * @param string $destination + * @return \Illuminate\Routing\Route + * @static + */ + public static function permanentRedirect($uri, $destination) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->permanentRedirect($uri, $destination); + } + /** + * Register a new route that returns a view. + * + * @param string $uri + * @param string $view + * @param array $data + * @param int|array $status + * @param array $headers + * @return \Illuminate\Routing\Route + * @static + */ + public static function view($uri, $view, $data = [], $status = 200, $headers = []) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->view($uri, $view, $data, $status, $headers); + } + /** + * Register a new route with the given verbs. + * + * @param array|string $methods + * @param string $uri + * @param array|string|callable|null $action + * @return \Illuminate\Routing\Route + * @static + */ + public static function match($methods, $uri, $action = null) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->match($methods, $uri, $action); + } + /** + * Register an array of resource controllers. + * + * @param array $resources + * @param array $options + * @return void + * @static + */ + public static function resources($resources, $options = []) + { + /** @var \Illuminate\Routing\Router $instance */ + $instance->resources($resources, $options); + } + /** + * Route a resource to a controller. + * + * @param string $name + * @param string $controller + * @param array $options + * @return \Illuminate\Routing\PendingResourceRegistration + * @static + */ + public static function resource($name, $controller, $options = []) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->resource($name, $controller, $options); + } + /** + * Register an array of API resource controllers. + * + * @param array $resources + * @param array $options + * @return void + * @static + */ + public static function apiResources($resources, $options = []) + { + /** @var \Illuminate\Routing\Router $instance */ + $instance->apiResources($resources, $options); + } + /** + * Route an API resource to a controller. + * + * @param string $name + * @param string $controller + * @param array $options + * @return \Illuminate\Routing\PendingResourceRegistration + * @static + */ + public static function apiResource($name, $controller, $options = []) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->apiResource($name, $controller, $options); + } + /** + * Create a route group with shared attributes. + * + * @param array $attributes + * @param \Closure|string $routes + * @return void + * @static + */ + public static function group($attributes, $routes) + { + /** @var \Illuminate\Routing\Router $instance */ + $instance->group($attributes, $routes); + } + /** + * Merge the given array with the last group stack. + * + * @param array $new + * @param bool $prependExistingPrefix + * @return array + * @static + */ + public static function mergeWithLastGroup($new, $prependExistingPrefix = true) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->mergeWithLastGroup($new, $prependExistingPrefix); + } + /** + * Get the prefix from the last group on the stack. + * + * @return string + * @static + */ + public static function getLastGroupPrefix() + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->getLastGroupPrefix(); + } + /** + * Add a route to the underlying route collection. + * + * @param array|string $methods + * @param string $uri + * @param array|string|callable|null $action + * @return \Illuminate\Routing\Route + * @static + */ + public static function addRoute($methods, $uri, $action) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->addRoute($methods, $uri, $action); + } + /** + * Create a new Route object. + * + * @param array|string $methods + * @param string $uri + * @param mixed $action + * @return \Illuminate\Routing\Route + * @static + */ + public static function newRoute($methods, $uri, $action) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->newRoute($methods, $uri, $action); + } + /** + * Return the response returned by the given route. + * + * @param string $name + * @return \Symfony\Component\HttpFoundation\Response + * @static + */ + public static function respondWithRoute($name) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->respondWithRoute($name); + } + /** + * Dispatch the request to the application. + * + * @param \Illuminate\Http\Request $request + * @return \Symfony\Component\HttpFoundation\Response + * @static + */ + public static function dispatch($request) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->dispatch($request); + } + /** + * Dispatch the request to a route and return the response. + * + * @param \Illuminate\Http\Request $request + * @return \Symfony\Component\HttpFoundation\Response + * @static + */ + public static function dispatchToRoute($request) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->dispatchToRoute($request); + } + /** + * Gather the middleware for the given route with resolved class names. + * + * @param \Illuminate\Routing\Route $route + * @return array + * @static + */ + public static function gatherRouteMiddleware($route) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->gatherRouteMiddleware($route); + } + /** + * Create a response instance from the given value. + * + * @param \Symfony\Component\HttpFoundation\Request $request + * @param mixed $response + * @return \Symfony\Component\HttpFoundation\Response + * @static + */ + public static function prepareResponse($request, $response) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->prepareResponse($request, $response); + } + /** + * Static version of prepareResponse. + * + * @param \Symfony\Component\HttpFoundation\Request $request + * @param mixed $response + * @return \Symfony\Component\HttpFoundation\Response + * @static + */ + public static function toResponse($request, $response) + { + return \Illuminate\Routing\Router::toResponse($request, $response); + } + /** + * Substitute the route bindings onto the route. + * + * @param \Illuminate\Routing\Route $route + * @return \Illuminate\Routing\Route + * @throws \Illuminate\Database\Eloquent\ModelNotFoundException + * @static + */ + public static function substituteBindings($route) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->substituteBindings($route); + } + /** + * Substitute the implicit Eloquent model bindings for the route. + * + * @param \Illuminate\Routing\Route $route + * @return void + * @throws \Illuminate\Database\Eloquent\ModelNotFoundException + * @static + */ + public static function substituteImplicitBindings($route) + { + /** @var \Illuminate\Routing\Router $instance */ + $instance->substituteImplicitBindings($route); + } + /** + * Register a route matched event listener. + * + * @param string|callable $callback + * @return void + * @static + */ + public static function matched($callback) + { + /** @var \Illuminate\Routing\Router $instance */ + $instance->matched($callback); + } + /** + * Get all of the defined middleware short-hand names. + * + * @return array + * @static + */ + public static function getMiddleware() + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->getMiddleware(); + } + /** + * Register a short-hand name for a middleware. + * + * @param string $name + * @param string $class + * @return \Illuminate\Routing\Router + * @static + */ + public static function aliasMiddleware($name, $class) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->aliasMiddleware($name, $class); + } + /** + * Check if a middlewareGroup with the given name exists. + * + * @param string $name + * @return bool + * @static + */ + public static function hasMiddlewareGroup($name) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->hasMiddlewareGroup($name); + } + /** + * Get all of the defined middleware groups. + * + * @return array + * @static + */ + public static function getMiddlewareGroups() + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->getMiddlewareGroups(); + } + /** + * Register a group of middleware. + * + * @param string $name + * @param array $middleware + * @return \Illuminate\Routing\Router + * @static + */ + public static function middlewareGroup($name, $middleware) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->middlewareGroup($name, $middleware); + } + /** + * Add a middleware to the beginning of a middleware group. + * + * If the middleware is already in the group, it will not be added again. + * + * @param string $group + * @param string $middleware + * @return \Illuminate\Routing\Router + * @static + */ + public static function prependMiddlewareToGroup($group, $middleware) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->prependMiddlewareToGroup($group, $middleware); + } + /** + * Add a middleware to the end of a middleware group. + * + * If the middleware is already in the group, it will not be added again. + * + * @param string $group + * @param string $middleware + * @return \Illuminate\Routing\Router + * @static + */ + public static function pushMiddlewareToGroup($group, $middleware) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->pushMiddlewareToGroup($group, $middleware); + } + /** + * Flush the router's middleware groups. + * + * @return \Illuminate\Routing\Router + * @static + */ + public static function flushMiddlewareGroups() + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->flushMiddlewareGroups(); + } + /** + * Add a new route parameter binder. + * + * @param string $key + * @param string|callable $binder + * @return void + * @static + */ + public static function bind($key, $binder) + { + /** @var \Illuminate\Routing\Router $instance */ + $instance->bind($key, $binder); + } + /** + * Register a model binder for a wildcard. + * + * @param string $key + * @param string $class + * @param \Closure|null $callback + * @return void + * @static + */ + public static function model($key, $class, $callback = null) + { + /** @var \Illuminate\Routing\Router $instance */ + $instance->model($key, $class, $callback); + } + /** + * Get the binding callback for a given binding. + * + * @param string $key + * @return \Closure|null + * @static + */ + public static function getBindingCallback($key) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->getBindingCallback($key); + } + /** + * Get the global "where" patterns. + * + * @return array + * @static + */ + public static function getPatterns() + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->getPatterns(); + } + /** + * Set a global where pattern on all routes. + * + * @param string $key + * @param string $pattern + * @return void + * @static + */ + public static function pattern($key, $pattern) + { + /** @var \Illuminate\Routing\Router $instance */ + $instance->pattern($key, $pattern); + } + /** + * Set a group of global where patterns on all routes. + * + * @param array $patterns + * @return void + * @static + */ + public static function patterns($patterns) + { + /** @var \Illuminate\Routing\Router $instance */ + $instance->patterns($patterns); + } + /** + * Determine if the router currently has a group stack. + * + * @return bool + * @static + */ + public static function hasGroupStack() + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->hasGroupStack(); + } + /** + * Get the current group stack for the router. + * + * @return array + * @static + */ + public static function getGroupStack() + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->getGroupStack(); + } + /** + * Get a route parameter for the current route. + * + * @param string $key + * @param string|null $default + * @return mixed + * @static + */ + public static function input($key, $default = null) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->input($key, $default); + } + /** + * Get the request currently being dispatched. + * + * @return \Illuminate\Http\Request + * @static + */ + public static function getCurrentRequest() + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->getCurrentRequest(); + } + /** + * Get the currently dispatched route instance. + * + * @return \Illuminate\Routing\Route|null + * @static + */ + public static function getCurrentRoute() + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->getCurrentRoute(); + } + /** + * Get the currently dispatched route instance. + * + * @return \Illuminate\Routing\Route|null + * @static + */ + public static function current() + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->current(); + } + /** + * Check if a route with the given name exists. + * + * @param string $name + * @return bool + * @static + */ + public static function has($name) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->has($name); + } + /** + * Get the current route name. + * + * @return string|null + * @static + */ + public static function currentRouteName() + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->currentRouteName(); + } + /** + * Alias for the "currentRouteNamed" method. + * + * @param mixed $patterns + * @return bool + * @static + */ + public static function is(...$patterns) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->is(...$patterns); + } + /** + * Determine if the current route matches a pattern. + * + * @param mixed $patterns + * @return bool + * @static + */ + public static function currentRouteNamed(...$patterns) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->currentRouteNamed(...$patterns); + } + /** + * Get the current route action. + * + * @return string|null + * @static + */ + public static function currentRouteAction() + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->currentRouteAction(); + } + /** + * Alias for the "currentRouteUses" method. + * + * @param array $patterns + * @return bool + * @static + */ + public static function uses(...$patterns) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->uses(...$patterns); + } + /** + * Determine if the current route action matches a given action. + * + * @param string $action + * @return bool + * @static + */ + public static function currentRouteUses($action) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->currentRouteUses($action); + } + /** + * Set the unmapped global resource parameters to singular. + * + * @param bool $singular + * @return void + * @static + */ + public static function singularResourceParameters($singular = true) + { + /** @var \Illuminate\Routing\Router $instance */ + $instance->singularResourceParameters($singular); + } + /** + * Set the global resource parameter mapping. + * + * @param array $parameters + * @return void + * @static + */ + public static function resourceParameters($parameters = []) + { + /** @var \Illuminate\Routing\Router $instance */ + $instance->resourceParameters($parameters); + } + /** + * Get or set the verbs used in the resource URIs. + * + * @param array $verbs + * @return array|null + * @static + */ + public static function resourceVerbs($verbs = []) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->resourceVerbs($verbs); + } + /** + * Get the underlying route collection. + * + * @return \Illuminate\Routing\RouteCollectionInterface + * @static + */ + public static function getRoutes() + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->getRoutes(); + } + /** + * Set the route collection instance. + * + * @param \Illuminate\Routing\RouteCollection $routes + * @return void + * @static + */ + public static function setRoutes($routes) + { + /** @var \Illuminate\Routing\Router $instance */ + $instance->setRoutes($routes); + } + /** + * Set the compiled route collection instance. + * + * @param array $routes + * @return void + * @static + */ + public static function setCompiledRoutes($routes) + { + /** @var \Illuminate\Routing\Router $instance */ + $instance->setCompiledRoutes($routes); + } + /** + * Remove any duplicate middleware from the given array. + * + * @param array $middleware + * @return array + * @static + */ + public static function uniqueMiddleware($middleware) + { + return \Illuminate\Routing\Router::uniqueMiddleware($middleware); + } + /** + * Set the container instance used by the router. + * + * @param \Illuminate\Container\Container $container + * @return \Illuminate\Routing\Router + * @static + */ + public static function setContainer($container) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->setContainer($container); + } + /** + * Register a custom macro. + * + * @param string $name + * @param object|callable $macro + * @return void + * @static + */ + public static function macro($name, $macro) + { + \Illuminate\Routing\Router::macro($name, $macro); + } + /** + * Mix another object into the class. + * + * @param object $mixin + * @param bool $replace + * @return void + * @throws \ReflectionException + * @static + */ + public static function mixin($mixin, $replace = true) + { + \Illuminate\Routing\Router::mixin($mixin, $replace); + } + /** + * Checks if macro is registered. + * + * @param string $name + * @return bool + * @static + */ + public static function hasMacro($name) + { + return \Illuminate\Routing\Router::hasMacro($name); + } + /** + * Flush the existing macros. + * + * @return void + * @static + */ + public static function flushMacros() + { + \Illuminate\Routing\Router::flushMacros(); + } + /** + * Dynamically handle calls to the class. + * + * @param string $method + * @param array $parameters + * @return mixed + * @throws \BadMethodCallException + * @static + */ + public static function macroCall($method, $parameters) + { + /** @var \Illuminate\Routing\Router $instance */ + return $instance->macroCall($method, $parameters); + } + /** + * + * + * @see \Laravel\Ui\AuthRouteMethods::auth() + * @param mixed $options + * @static + */ + public static function auth($options = []) + { + return \Illuminate\Routing\Router::auth($options); + } + /** + * + * + * @see \Laravel\Ui\AuthRouteMethods::resetPassword() + * @static + */ + public static function resetPassword() + { + return \Illuminate\Routing\Router::resetPassword(); + } + /** + * + * + * @see \Laravel\Ui\AuthRouteMethods::confirmPassword() + * @static + */ + public static function confirmPassword() + { + return \Illuminate\Routing\Router::confirmPassword(); + } + /** + * + * + * @see \Laravel\Ui\AuthRouteMethods::emailVerification() + * @static + */ + public static function emailVerification() + { + return \Illuminate\Routing\Router::emailVerification(); + } + + } + /** + * + * + * @see \Illuminate\Database\Schema\Builder + */ + class Schema { + /** + * Create a database in the schema. + * + * @param string $name + * @return bool + * @static + */ + public static function createDatabase($name) + { + /** @var \Illuminate\Database\Schema\SQLiteBuilder $instance */ + return $instance->createDatabase($name); + } + /** + * Drop a database from the schema if the database exists. + * + * @param string $name + * @return bool + * @static + */ + public static function dropDatabaseIfExists($name) + { + /** @var \Illuminate\Database\Schema\SQLiteBuilder $instance */ + return $instance->dropDatabaseIfExists($name); + } + /** + * Drop all tables from the database. + * + * @return void + * @static + */ + public static function dropAllTables() + { + /** @var \Illuminate\Database\Schema\SQLiteBuilder $instance */ + $instance->dropAllTables(); + } + /** + * Drop all views from the database. + * + * @return void + * @static + */ + public static function dropAllViews() + { + /** @var \Illuminate\Database\Schema\SQLiteBuilder $instance */ + $instance->dropAllViews(); + } + /** + * Empty the database file. + * + * @return void + * @static + */ + public static function refreshDatabaseFile() + { + /** @var \Illuminate\Database\Schema\SQLiteBuilder $instance */ + $instance->refreshDatabaseFile(); + } + /** + * Set the default string length for migrations. + * + * @param int $length + * @return void + * @static + */ + public static function defaultStringLength($length) + { //Method inherited from \Illuminate\Database\Schema\Builder + \Illuminate\Database\Schema\SQLiteBuilder::defaultStringLength($length); + } + /** + * Set the default morph key type for migrations. + * + * @param string $type + * @return void + * @throws \InvalidArgumentException + * @static + */ + public static function defaultMorphKeyType($type) + { //Method inherited from \Illuminate\Database\Schema\Builder + \Illuminate\Database\Schema\SQLiteBuilder::defaultMorphKeyType($type); + } + /** + * Set the default morph key type for migrations to UUIDs. + * + * @return void + * @static + */ + public static function morphUsingUuids() + { //Method inherited from \Illuminate\Database\Schema\Builder + \Illuminate\Database\Schema\SQLiteBuilder::morphUsingUuids(); + } + /** + * Determine if the given table exists. + * + * @param string $table + * @return bool + * @static + */ + public static function hasTable($table) + { //Method inherited from \Illuminate\Database\Schema\Builder + /** @var \Illuminate\Database\Schema\SQLiteBuilder $instance */ + return $instance->hasTable($table); + } + /** + * Determine if the given table has a given column. + * + * @param string $table + * @param string $column + * @return bool + * @static + */ + public static function hasColumn($table, $column) + { //Method inherited from \Illuminate\Database\Schema\Builder + /** @var \Illuminate\Database\Schema\SQLiteBuilder $instance */ + return $instance->hasColumn($table, $column); + } + /** + * Determine if the given table has given columns. + * + * @param string $table + * @param array $columns + * @return bool + * @static + */ + public static function hasColumns($table, $columns) + { //Method inherited from \Illuminate\Database\Schema\Builder + /** @var \Illuminate\Database\Schema\SQLiteBuilder $instance */ + return $instance->hasColumns($table, $columns); + } + /** + * Get the data type for the given column name. + * + * @param string $table + * @param string $column + * @return string + * @static + */ + public static function getColumnType($table, $column) + { //Method inherited from \Illuminate\Database\Schema\Builder + /** @var \Illuminate\Database\Schema\SQLiteBuilder $instance */ + return $instance->getColumnType($table, $column); + } + /** + * Get the column listing for a given table. + * + * @param string $table + * @return array + * @static + */ + public static function getColumnListing($table) + { //Method inherited from \Illuminate\Database\Schema\Builder + /** @var \Illuminate\Database\Schema\SQLiteBuilder $instance */ + return $instance->getColumnListing($table); + } + /** + * Modify a table on the schema. + * + * @param string $table + * @param \Closure $callback + * @return void + * @static + */ + public static function table($table, $callback) + { //Method inherited from \Illuminate\Database\Schema\Builder + /** @var \Illuminate\Database\Schema\SQLiteBuilder $instance */ + $instance->table($table, $callback); + } + /** + * Create a new table on the schema. + * + * @param string $table + * @param \Closure $callback + * @return void + * @static + */ + public static function create($table, $callback) + { //Method inherited from \Illuminate\Database\Schema\Builder + /** @var \Illuminate\Database\Schema\SQLiteBuilder $instance */ + $instance->create($table, $callback); + } + /** + * Drop a table from the schema. + * + * @param string $table + * @return void + * @static + */ + public static function drop($table) + { //Method inherited from \Illuminate\Database\Schema\Builder + /** @var \Illuminate\Database\Schema\SQLiteBuilder $instance */ + $instance->drop($table); + } + /** + * Drop a table from the schema if it exists. + * + * @param string $table + * @return void + * @static + */ + public static function dropIfExists($table) + { //Method inherited from \Illuminate\Database\Schema\Builder + /** @var \Illuminate\Database\Schema\SQLiteBuilder $instance */ + $instance->dropIfExists($table); + } + /** + * Drop columns from a table schema. + * + * @param string $table + * @param string|array $columns + * @return void + * @static + */ + public static function dropColumns($table, $columns) + { //Method inherited from \Illuminate\Database\Schema\Builder + /** @var \Illuminate\Database\Schema\SQLiteBuilder $instance */ + $instance->dropColumns($table, $columns); + } + /** + * Drop all types from the database. + * + * @return void + * @throws \LogicException + * @static + */ + public static function dropAllTypes() + { //Method inherited from \Illuminate\Database\Schema\Builder + /** @var \Illuminate\Database\Schema\SQLiteBuilder $instance */ + $instance->dropAllTypes(); + } + /** + * Get all of the table names for the database. + * + * @return void + * @throws \LogicException + * @static + */ + public static function getAllTables() + { //Method inherited from \Illuminate\Database\Schema\Builder + /** @var \Illuminate\Database\Schema\SQLiteBuilder $instance */ + $instance->getAllTables(); + } + /** + * Rename a table on the schema. + * + * @param string $from + * @param string $to + * @return void + * @static + */ + public static function rename($from, $to) + { //Method inherited from \Illuminate\Database\Schema\Builder + /** @var \Illuminate\Database\Schema\SQLiteBuilder $instance */ + $instance->rename($from, $to); + } + /** + * Enable foreign key constraints. + * + * @return bool + * @static + */ + public static function enableForeignKeyConstraints() + { //Method inherited from \Illuminate\Database\Schema\Builder + /** @var \Illuminate\Database\Schema\SQLiteBuilder $instance */ + return $instance->enableForeignKeyConstraints(); + } + /** + * Disable foreign key constraints. + * + * @return bool + * @static + */ + public static function disableForeignKeyConstraints() + { //Method inherited from \Illuminate\Database\Schema\Builder + /** @var \Illuminate\Database\Schema\SQLiteBuilder $instance */ + return $instance->disableForeignKeyConstraints(); + } + /** + * Register a custom Doctrine mapping type. + * + * @param string $class + * @param string $name + * @param string $type + * @return void + * @static + */ + public static function registerCustomDoctrineType($class, $name, $type) + { //Method inherited from \Illuminate\Database\Schema\Builder + /** @var \Illuminate\Database\Schema\SQLiteBuilder $instance */ + $instance->registerCustomDoctrineType($class, $name, $type); + } + /** + * Get the database connection instance. + * + * @return \Illuminate\Database\Connection + * @static + */ + public static function getConnection() + { //Method inherited from \Illuminate\Database\Schema\Builder + /** @var \Illuminate\Database\Schema\SQLiteBuilder $instance */ + return $instance->getConnection(); + } + /** + * Set the database connection instance. + * + * @param \Illuminate\Database\Connection $connection + * @return \Illuminate\Database\Schema\SQLiteBuilder + * @static + */ + public static function setConnection($connection) + { //Method inherited from \Illuminate\Database\Schema\Builder + /** @var \Illuminate\Database\Schema\SQLiteBuilder $instance */ + return $instance->setConnection($connection); + } + /** + * Set the Schema Blueprint resolver callback. + * + * @param \Closure $resolver + * @return void + * @static + */ + public static function blueprintResolver($resolver) + { //Method inherited from \Illuminate\Database\Schema\Builder + /** @var \Illuminate\Database\Schema\SQLiteBuilder $instance */ + $instance->blueprintResolver($resolver); + } + + } + /** + * + * + * @see \Illuminate\Session\SessionManager + * @see \Illuminate\Session\Store + */ + class Session { + /** + * Determine if requests for the same session should wait for each to finish before executing. + * + * @return bool + * @static + */ + public static function shouldBlock() + { + /** @var \Illuminate\Session\SessionManager $instance */ + return $instance->shouldBlock(); + } + /** + * Get the name of the cache store / driver that should be used to acquire session locks. + * + * @return string|null + * @static + */ + public static function blockDriver() + { + /** @var \Illuminate\Session\SessionManager $instance */ + return $instance->blockDriver(); + } + /** + * Get the session configuration. + * + * @return array + * @static + */ + public static function getSessionConfig() + { + /** @var \Illuminate\Session\SessionManager $instance */ + return $instance->getSessionConfig(); + } + /** + * Get the default session driver name. + * + * @return string + * @static + */ + public static function getDefaultDriver() + { + /** @var \Illuminate\Session\SessionManager $instance */ + return $instance->getDefaultDriver(); + } + /** + * Set the default session driver name. + * + * @param string $name + * @return void + * @static + */ + public static function setDefaultDriver($name) + { + /** @var \Illuminate\Session\SessionManager $instance */ + $instance->setDefaultDriver($name); + } + /** + * Get a driver instance. + * + * @param string|null $driver + * @return mixed + * @throws \InvalidArgumentException + * @static + */ + public static function driver($driver = null) + { //Method inherited from \Illuminate\Support\Manager + /** @var \Illuminate\Session\SessionManager $instance */ + return $instance->driver($driver); + } + /** + * Register a custom driver creator Closure. + * + * @param string $driver + * @param \Closure $callback + * @return \Illuminate\Session\SessionManager + * @static + */ + public static function extend($driver, $callback) + { //Method inherited from \Illuminate\Support\Manager + /** @var \Illuminate\Session\SessionManager $instance */ + return $instance->extend($driver, $callback); + } + /** + * Get all of the created "drivers". + * + * @return array + * @static + */ + public static function getDrivers() + { //Method inherited from \Illuminate\Support\Manager + /** @var \Illuminate\Session\SessionManager $instance */ + return $instance->getDrivers(); + } + /** + * Get the container instance used by the manager. + * + * @return \Illuminate\Contracts\Container\Container + * @static + */ + public static function getContainer() + { //Method inherited from \Illuminate\Support\Manager + /** @var \Illuminate\Session\SessionManager $instance */ + return $instance->getContainer(); + } + /** + * Set the container instance used by the manager. + * + * @param \Illuminate\Contracts\Container\Container $container + * @return \Illuminate\Session\SessionManager + * @static + */ + public static function setContainer($container) + { //Method inherited from \Illuminate\Support\Manager + /** @var \Illuminate\Session\SessionManager $instance */ + return $instance->setContainer($container); + } + /** + * Forget all of the resolved driver instances. + * + * @return \Illuminate\Session\SessionManager + * @static + */ + public static function forgetDrivers() + { //Method inherited from \Illuminate\Support\Manager + /** @var \Illuminate\Session\SessionManager $instance */ + return $instance->forgetDrivers(); + } + /** + * Start the session, reading the data from a handler. + * + * @return bool + * @static + */ + public static function start() + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->start(); + } + /** + * Save the session data to storage. + * + * @return void + * @static + */ + public static function save() + { + /** @var \Illuminate\Session\Store $instance */ + $instance->save(); + } + /** + * Age the flash data for the session. + * + * @return void + * @static + */ + public static function ageFlashData() + { + /** @var \Illuminate\Session\Store $instance */ + $instance->ageFlashData(); + } + /** + * Get all of the session data. + * + * @return array + * @static + */ + public static function all() + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->all(); + } + /** + * Get a subset of the session data. + * + * @param array $keys + * @return array + * @static + */ + public static function only($keys) + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->only($keys); + } + /** + * Checks if a key exists. + * + * @param string|array $key + * @return bool + * @static + */ + public static function exists($key) + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->exists($key); + } + /** + * Determine if the given key is missing from the session data. + * + * @param string|array $key + * @return bool + * @static + */ + public static function missing($key) + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->missing($key); + } + /** + * Checks if a key is present and not null. + * + * @param string|array $key + * @return bool + * @static + */ + public static function has($key) + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->has($key); + } + /** + * Get an item from the session. + * + * @param string $key + * @param mixed $default + * @return mixed + * @static + */ + public static function get($key, $default = null) + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->get($key, $default); + } + /** + * Get the value of a given key and then forget it. + * + * @param string $key + * @param mixed $default + * @return mixed + * @static + */ + public static function pull($key, $default = null) + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->pull($key, $default); + } + /** + * Determine if the session contains old input. + * + * @param string|null $key + * @return bool + * @static + */ + public static function hasOldInput($key = null) + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->hasOldInput($key); + } + /** + * Get the requested item from the flashed input array. + * + * @param string|null $key + * @param mixed $default + * @return mixed + * @static + */ + public static function getOldInput($key = null, $default = null) + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->getOldInput($key, $default); + } + /** + * Replace the given session attributes entirely. + * + * @param array $attributes + * @return void + * @static + */ + public static function replace($attributes) + { + /** @var \Illuminate\Session\Store $instance */ + $instance->replace($attributes); + } + /** + * Put a key / value pair or array of key / value pairs in the session. + * + * @param string|array $key + * @param mixed $value + * @return void + * @static + */ + public static function put($key, $value = null) + { + /** @var \Illuminate\Session\Store $instance */ + $instance->put($key, $value); + } + /** + * Get an item from the session, or store the default value. + * + * @param string $key + * @param \Closure $callback + * @return mixed + * @static + */ + public static function remember($key, $callback) + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->remember($key, $callback); + } + /** + * Push a value onto a session array. + * + * @param string $key + * @param mixed $value + * @return void + * @static + */ + public static function push($key, $value) + { + /** @var \Illuminate\Session\Store $instance */ + $instance->push($key, $value); + } + /** + * Increment the value of an item in the session. + * + * @param string $key + * @param int $amount + * @return mixed + * @static + */ + public static function increment($key, $amount = 1) + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->increment($key, $amount); + } + /** + * Decrement the value of an item in the session. + * + * @param string $key + * @param int $amount + * @return int + * @static + */ + public static function decrement($key, $amount = 1) + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->decrement($key, $amount); + } + /** + * Flash a key / value pair to the session. + * + * @param string $key + * @param mixed $value + * @return void + * @static + */ + public static function flash($key, $value = true) + { + /** @var \Illuminate\Session\Store $instance */ + $instance->flash($key, $value); + } + /** + * Flash a key / value pair to the session for immediate use. + * + * @param string $key + * @param mixed $value + * @return void + * @static + */ + public static function now($key, $value) + { + /** @var \Illuminate\Session\Store $instance */ + $instance->now($key, $value); + } + /** + * Reflash all of the session flash data. + * + * @return void + * @static + */ + public static function reflash() + { + /** @var \Illuminate\Session\Store $instance */ + $instance->reflash(); + } + /** + * Reflash a subset of the current flash data. + * + * @param array|mixed $keys + * @return void + * @static + */ + public static function keep($keys = null) + { + /** @var \Illuminate\Session\Store $instance */ + $instance->keep($keys); + } + /** + * Flash an input array to the session. + * + * @param array $value + * @return void + * @static + */ + public static function flashInput($value) + { + /** @var \Illuminate\Session\Store $instance */ + $instance->flashInput($value); + } + /** + * Remove an item from the session, returning its value. + * + * @param string $key + * @return mixed + * @static + */ + public static function remove($key) + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->remove($key); + } + /** + * Remove one or many items from the session. + * + * @param string|array $keys + * @return void + * @static + */ + public static function forget($keys) + { + /** @var \Illuminate\Session\Store $instance */ + $instance->forget($keys); + } + /** + * Remove all of the items from the session. + * + * @return void + * @static + */ + public static function flush() + { + /** @var \Illuminate\Session\Store $instance */ + $instance->flush(); + } + /** + * Flush the session data and regenerate the ID. + * + * @return bool + * @static + */ + public static function invalidate() + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->invalidate(); + } + /** + * Generate a new session identifier. + * + * @param bool $destroy + * @return bool + * @static + */ + public static function regenerate($destroy = false) + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->regenerate($destroy); + } + /** + * Generate a new session ID for the session. + * + * @param bool $destroy + * @return bool + * @static + */ + public static function migrate($destroy = false) + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->migrate($destroy); + } + /** + * Determine if the session has been started. + * + * @return bool + * @static + */ + public static function isStarted() + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->isStarted(); + } + /** + * Get the name of the session. + * + * @return string + * @static + */ + public static function getName() + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->getName(); + } + /** + * Set the name of the session. + * + * @param string $name + * @return void + * @static + */ + public static function setName($name) + { + /** @var \Illuminate\Session\Store $instance */ + $instance->setName($name); + } + /** + * Get the current session ID. + * + * @return string + * @static + */ + public static function getId() + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->getId(); + } + /** + * Set the session ID. + * + * @param string $id + * @return void + * @static + */ + public static function setId($id) + { + /** @var \Illuminate\Session\Store $instance */ + $instance->setId($id); + } + /** + * Determine if this is a valid session ID. + * + * @param string $id + * @return bool + * @static + */ + public static function isValidId($id) + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->isValidId($id); + } + /** + * Set the existence of the session on the handler if applicable. + * + * @param bool $value + * @return void + * @static + */ + public static function setExists($value) + { + /** @var \Illuminate\Session\Store $instance */ + $instance->setExists($value); + } + /** + * Get the CSRF token value. + * + * @return string + * @static + */ + public static function token() + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->token(); + } + /** + * Regenerate the CSRF token value. + * + * @return void + * @static + */ + public static function regenerateToken() + { + /** @var \Illuminate\Session\Store $instance */ + $instance->regenerateToken(); + } + /** + * Get the previous URL from the session. + * + * @return string|null + * @static + */ + public static function previousUrl() + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->previousUrl(); + } + /** + * Set the "previous" URL in the session. + * + * @param string $url + * @return void + * @static + */ + public static function setPreviousUrl($url) + { + /** @var \Illuminate\Session\Store $instance */ + $instance->setPreviousUrl($url); + } + /** + * Specify that the user has confirmed their password. + * + * @return void + * @static + */ + public static function passwordConfirmed() + { + /** @var \Illuminate\Session\Store $instance */ + $instance->passwordConfirmed(); + } + /** + * Get the underlying session handler implementation. + * + * @return \SessionHandlerInterface + * @static + */ + public static function getHandler() + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->getHandler(); + } + /** + * Determine if the session handler needs a request. + * + * @return bool + * @static + */ + public static function handlerNeedsRequest() + { + /** @var \Illuminate\Session\Store $instance */ + return $instance->handlerNeedsRequest(); + } + /** + * Set the request on the handler instance. + * + * @param \Illuminate\Http\Request $request + * @return void + * @static + */ + public static function setRequestOnHandler($request) + { + /** @var \Illuminate\Session\Store $instance */ + $instance->setRequestOnHandler($request); + } + + } + /** + * + * + * @see \Illuminate\Filesystem\FilesystemManager + */ + class Storage { + /** + * Get a filesystem instance. + * + * @param string|null $name + * @return \Illuminate\Filesystem\FilesystemAdapter + * @static + */ + public static function drive($name = null) + { + /** @var \Illuminate\Filesystem\FilesystemManager $instance */ + return $instance->drive($name); + } + /** + * Get a filesystem instance. + * + * @param string|null $name + * @return \Illuminate\Filesystem\FilesystemAdapter + * @static + */ + public static function disk($name = null) + { + /** @var \Illuminate\Filesystem\FilesystemManager $instance */ + return $instance->disk($name); + } + /** + * Get a default cloud filesystem instance. + * + * @return \Illuminate\Filesystem\FilesystemAdapter + * @static + */ + public static function cloud() + { + /** @var \Illuminate\Filesystem\FilesystemManager $instance */ + return $instance->cloud(); + } + /** + * Build an on-demand disk. + * + * @param string|array $config + * @return \Illuminate\Filesystem\FilesystemAdapter + * @static + */ + public static function build($config) + { + /** @var \Illuminate\Filesystem\FilesystemManager $instance */ + return $instance->build($config); + } + /** + * Create an instance of the local driver. + * + * @param array $config + * @return \Illuminate\Filesystem\FilesystemAdapter + * @static + */ + public static function createLocalDriver($config) + { + /** @var \Illuminate\Filesystem\FilesystemManager $instance */ + return $instance->createLocalDriver($config); + } + /** + * Create an instance of the ftp driver. + * + * @param array $config + * @return \Illuminate\Filesystem\FilesystemAdapter + * @static + */ + public static function createFtpDriver($config) + { + /** @var \Illuminate\Filesystem\FilesystemManager $instance */ + return $instance->createFtpDriver($config); + } + /** + * Create an instance of the sftp driver. + * + * @param array $config + * @return \Illuminate\Filesystem\FilesystemAdapter + * @static + */ + public static function createSftpDriver($config) + { + /** @var \Illuminate\Filesystem\FilesystemManager $instance */ + return $instance->createSftpDriver($config); + } + /** + * Create an instance of the Amazon S3 driver. + * + * @param array $config + * @return \Illuminate\Contracts\Filesystem\Cloud + * @static + */ + public static function createS3Driver($config) + { + /** @var \Illuminate\Filesystem\FilesystemManager $instance */ + return $instance->createS3Driver($config); + } + /** + * Set the given disk instance. + * + * @param string $name + * @param mixed $disk + * @return \Illuminate\Filesystem\FilesystemManager + * @static + */ + public static function set($name, $disk) + { + /** @var \Illuminate\Filesystem\FilesystemManager $instance */ + return $instance->set($name, $disk); + } + /** + * Get the default driver name. + * + * @return string + * @static + */ + public static function getDefaultDriver() + { + /** @var \Illuminate\Filesystem\FilesystemManager $instance */ + return $instance->getDefaultDriver(); + } + /** + * Get the default cloud driver name. + * + * @return string + * @static + */ + public static function getDefaultCloudDriver() + { + /** @var \Illuminate\Filesystem\FilesystemManager $instance */ + return $instance->getDefaultCloudDriver(); + } + /** + * Unset the given disk instances. + * + * @param array|string $disk + * @return \Illuminate\Filesystem\FilesystemManager + * @static + */ + public static function forgetDisk($disk) + { + /** @var \Illuminate\Filesystem\FilesystemManager $instance */ + return $instance->forgetDisk($disk); + } + /** + * Disconnect the given disk and remove from local cache. + * + * @param string|null $name + * @return void + * @static + */ + public static function purge($name = null) + { + /** @var \Illuminate\Filesystem\FilesystemManager $instance */ + $instance->purge($name); + } + /** + * Register a custom driver creator Closure. + * + * @param string $driver + * @param \Closure $callback + * @return \Illuminate\Filesystem\FilesystemManager + * @static + */ + public static function extend($driver, $callback) + { + /** @var \Illuminate\Filesystem\FilesystemManager $instance */ + return $instance->extend($driver, $callback); + } + /** + * Set the application instance used by the manager. + * + * @param \Illuminate\Contracts\Foundation\Application $app + * @return \Illuminate\Filesystem\FilesystemManager + * @static + */ + public static function setApplication($app) + { + /** @var \Illuminate\Filesystem\FilesystemManager $instance */ + return $instance->setApplication($app); + } + /** + * Assert that the given file exists. + * + * @param string|array $path + * @param string|null $content + * @return \Illuminate\Filesystem\FilesystemAdapter + * @static + */ + public static function assertExists($path, $content = null) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->assertExists($path, $content); + } + /** + * Assert that the given file does not exist. + * + * @param string|array $path + * @return \Illuminate\Filesystem\FilesystemAdapter + * @static + */ + public static function assertMissing($path) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->assertMissing($path); + } + /** + * Determine if a file exists. + * + * @param string $path + * @return bool + * @static + */ + public static function exists($path) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->exists($path); + } + /** + * Determine if a file or directory is missing. + * + * @param string $path + * @return bool + * @static + */ + public static function missing($path) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->missing($path); + } + /** + * Get the full path for the file at the given "short" path. + * + * @param string $path + * @return string + * @static + */ + public static function path($path) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->path($path); + } + /** + * Get the contents of a file. + * + * @param string $path + * @return string + * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException + * @static + */ + public static function get($path) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->get($path); + } + /** + * Create a streamed response for a given file. + * + * @param string $path + * @param string|null $name + * @param array|null $headers + * @param string|null $disposition + * @return \Symfony\Component\HttpFoundation\StreamedResponse + * @static + */ + public static function response($path, $name = null, $headers = [], $disposition = 'inline') + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->response($path, $name, $headers, $disposition); + } + /** + * Create a streamed download response for a given file. + * + * @param string $path + * @param string|null $name + * @param array|null $headers + * @return \Symfony\Component\HttpFoundation\StreamedResponse + * @static + */ + public static function download($path, $name = null, $headers = []) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->download($path, $name, $headers); + } + /** + * Write the contents of a file. + * + * @param string $path + * @param \Psr\Http\Message\StreamInterface|\Illuminate\Http\File|\Illuminate\Http\UploadedFile|string|resource $contents + * @param mixed $options + * @return bool + * @static + */ + public static function put($path, $contents, $options = []) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->put($path, $contents, $options); + } + /** + * Store the uploaded file on the disk. + * + * @param string $path + * @param \Illuminate\Http\File|\Illuminate\Http\UploadedFile|string $file + * @param mixed $options + * @return string|false + * @static + */ + public static function putFile($path, $file, $options = []) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->putFile($path, $file, $options); + } + /** + * Store the uploaded file on the disk with a given name. + * + * @param string $path + * @param \Illuminate\Http\File|\Illuminate\Http\UploadedFile|string $file + * @param string $name + * @param mixed $options + * @return string|false + * @static + */ + public static function putFileAs($path, $file, $name, $options = []) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->putFileAs($path, $file, $name, $options); + } + /** + * Get the visibility for the given path. + * + * @param string $path + * @return string + * @static + */ + public static function getVisibility($path) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->getVisibility($path); + } + /** + * Set the visibility for the given path. + * + * @param string $path + * @param string $visibility + * @return bool + * @static + */ + public static function setVisibility($path, $visibility) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->setVisibility($path, $visibility); + } + /** + * Prepend to a file. + * + * @param string $path + * @param string $data + * @param string $separator + * @return bool + * @static + */ + public static function prepend($path, $data, $separator = ' +') + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->prepend($path, $data, $separator); + } + /** + * Append to a file. + * + * @param string $path + * @param string $data + * @param string $separator + * @return bool + * @static + */ + public static function append($path, $data, $separator = ' +') + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->append($path, $data, $separator); + } + /** + * Delete the file at a given path. + * + * @param string|array $paths + * @return bool + * @static + */ + public static function delete($paths) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->delete($paths); + } + /** + * Copy a file to a new location. + * + * @param string $from + * @param string $to + * @return bool + * @static + */ + public static function copy($from, $to) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->copy($from, $to); + } + /** + * Move a file to a new location. + * + * @param string $from + * @param string $to + * @return bool + * @static + */ + public static function move($from, $to) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->move($from, $to); + } + /** + * Get the file size of a given file. + * + * @param string $path + * @return int + * @static + */ + public static function size($path) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->size($path); + } + /** + * Get the mime-type of a given file. + * + * @param string $path + * @return string|false + * @static + */ + public static function mimeType($path) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->mimeType($path); + } + /** + * Get the file's last modification time. + * + * @param string $path + * @return int + * @static + */ + public static function lastModified($path) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->lastModified($path); + } + /** + * Get the URL for the file at the given path. + * + * @param string $path + * @return string + * @throws \RuntimeException + * @static + */ + public static function url($path) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->url($path); + } + /** + * Get a resource to read the file. + * + * @param string $path + * @return resource|null The path resource or null on failure. + * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException + * @static + */ + public static function readStream($path) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->readStream($path); + } + /** + * Write a new file using a stream. + * + * @param string $path + * @param resource $resource + * @param array $options + * @return bool + * @throws \InvalidArgumentException If $resource is not a file handle. + * @throws \Illuminate\Contracts\Filesystem\FileExistsException + * @static + */ + public static function writeStream($path, $resource, $options = []) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->writeStream($path, $resource, $options); + } + /** + * Get a temporary URL for the file at the given path. + * + * @param string $path + * @param \DateTimeInterface $expiration + * @param array $options + * @return string + * @throws \RuntimeException + * @static + */ + public static function temporaryUrl($path, $expiration, $options = []) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->temporaryUrl($path, $expiration, $options); + } + /** + * Get a temporary URL for the file at the given path. + * + * @param \League\Flysystem\AwsS3v3\AwsS3Adapter $adapter + * @param string $path + * @param \DateTimeInterface $expiration + * @param array $options + * @return string + * @static + */ + public static function getAwsTemporaryUrl($adapter, $path, $expiration, $options) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->getAwsTemporaryUrl($adapter, $path, $expiration, $options); + } + /** + * Get an array of all files in a directory. + * + * @param string|null $directory + * @param bool $recursive + * @return array + * @static + */ + public static function files($directory = null, $recursive = false) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->files($directory, $recursive); + } + /** + * Get all of the files from the given directory (recursive). + * + * @param string|null $directory + * @return array + * @static + */ + public static function allFiles($directory = null) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->allFiles($directory); + } + /** + * Get all of the directories within a given directory. + * + * @param string|null $directory + * @param bool $recursive + * @return array + * @static + */ + public static function directories($directory = null, $recursive = false) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->directories($directory, $recursive); + } + /** + * Get all (recursive) of the directories within a given directory. + * + * @param string|null $directory + * @return array + * @static + */ + public static function allDirectories($directory = null) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->allDirectories($directory); + } + /** + * Create a directory. + * + * @param string $path + * @return bool + * @static + */ + public static function makeDirectory($path) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->makeDirectory($path); + } + /** + * Recursively delete a directory. + * + * @param string $directory + * @return bool + * @static + */ + public static function deleteDirectory($directory) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->deleteDirectory($directory); + } + /** + * Flush the Flysystem cache. + * + * @return void + * @static + */ + public static function flushCache() + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + $instance->flushCache(); + } + /** + * Get the Flysystem driver. + * + * @return \League\Flysystem\FilesystemInterface + * @static + */ + public static function getDriver() + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->getDriver(); + } + /** + * Define a custom temporary URL builder callback. + * + * @param \Closure $callback + * @return void + * @static + */ + public static function buildTemporaryUrlsUsing($callback) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + $instance->buildTemporaryUrlsUsing($callback); + } + /** + * Register a custom macro. + * + * @param string $name + * @param object|callable $macro + * @return void + * @static + */ + public static function macro($name, $macro) + { + \Illuminate\Filesystem\FilesystemAdapter::macro($name, $macro); + } + /** + * Mix another object into the class. + * + * @param object $mixin + * @param bool $replace + * @return void + * @throws \ReflectionException + * @static + */ + public static function mixin($mixin, $replace = true) + { + \Illuminate\Filesystem\FilesystemAdapter::mixin($mixin, $replace); + } + /** + * Checks if macro is registered. + * + * @param string $name + * @return bool + * @static + */ + public static function hasMacro($name) + { + return \Illuminate\Filesystem\FilesystemAdapter::hasMacro($name); + } + /** + * Flush the existing macros. + * + * @return void + * @static + */ + public static function flushMacros() + { + \Illuminate\Filesystem\FilesystemAdapter::flushMacros(); + } + /** + * Dynamically handle calls to the class. + * + * @param string $method + * @param array $parameters + * @return mixed + * @throws \BadMethodCallException + * @static + */ + public static function macroCall($method, $parameters) + { + /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */ + return $instance->macroCall($method, $parameters); + } + + } + /** + * + * + * @see \Illuminate\Routing\UrlGenerator + */ + class URL { + /** + * Get the full URL for the current request. + * + * @return string + * @static + */ + public static function full() + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->full(); + } + /** + * Get the current URL for the request. + * + * @return string + * @static + */ + public static function current() + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->current(); + } + /** + * Get the URL for the previous request. + * + * @param mixed $fallback + * @return string + * @static + */ + public static function previous($fallback = false) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->previous($fallback); + } + /** + * Generate an absolute URL to the given path. + * + * @param string $path + * @param mixed $extra + * @param bool|null $secure + * @return string + * @static + */ + public static function to($path, $extra = [], $secure = null) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->to($path, $extra, $secure); + } + /** + * Generate a secure, absolute URL to the given path. + * + * @param string $path + * @param array $parameters + * @return string + * @static + */ + public static function secure($path, $parameters = []) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->secure($path, $parameters); + } + /** + * Generate the URL to an application asset. + * + * @param string $path + * @param bool|null $secure + * @return string + * @static + */ + public static function asset($path, $secure = null) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->asset($path, $secure); + } + /** + * Generate the URL to a secure asset. + * + * @param string $path + * @return string + * @static + */ + public static function secureAsset($path) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->secureAsset($path); + } + /** + * Generate the URL to an asset from a custom root domain such as CDN, etc. + * + * @param string $root + * @param string $path + * @param bool|null $secure + * @return string + * @static + */ + public static function assetFrom($root, $path, $secure = null) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->assetFrom($root, $path, $secure); + } + /** + * Get the default scheme for a raw URL. + * + * @param bool|null $secure + * @return string + * @static + */ + public static function formatScheme($secure = null) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->formatScheme($secure); + } + /** + * Create a signed route URL for a named route. + * + * @param string $name + * @param mixed $parameters + * @param \DateTimeInterface|\DateInterval|int|null $expiration + * @param bool $absolute + * @return string + * @throws \InvalidArgumentException + * @static + */ + public static function signedRoute($name, $parameters = [], $expiration = null, $absolute = true) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->signedRoute($name, $parameters, $expiration, $absolute); + } + /** + * Create a temporary signed route URL for a named route. + * + * @param string $name + * @param \DateTimeInterface|\DateInterval|int $expiration + * @param array $parameters + * @param bool $absolute + * @return string + * @static + */ + public static function temporarySignedRoute($name, $expiration, $parameters = [], $absolute = true) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->temporarySignedRoute($name, $expiration, $parameters, $absolute); + } + /** + * Determine if the given request has a valid signature. + * + * @param \Illuminate\Http\Request $request + * @param bool $absolute + * @return bool + * @static + */ + public static function hasValidSignature($request, $absolute = true) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->hasValidSignature($request, $absolute); + } + /** + * Determine if the given request has a valid signature for a relative URL. + * + * @param \Illuminate\Http\Request $request + * @return bool + * @static + */ + public static function hasValidRelativeSignature($request) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->hasValidRelativeSignature($request); + } + /** + * Determine if the signature from the given request matches the URL. + * + * @param \Illuminate\Http\Request $request + * @param bool $absolute + * @return bool + * @static + */ + public static function hasCorrectSignature($request, $absolute = true) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->hasCorrectSignature($request, $absolute); + } + /** + * Determine if the expires timestamp from the given request is not from the past. + * + * @param \Illuminate\Http\Request $request + * @return bool + * @static + */ + public static function signatureHasNotExpired($request) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->signatureHasNotExpired($request); + } + /** + * Get the URL to a named route. + * + * @param string $name + * @param mixed $parameters + * @param bool $absolute + * @return string + * @throws \Symfony\Component\Routing\Exception\RouteNotFoundException + * @static + */ + public static function route($name, $parameters = [], $absolute = true) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->route($name, $parameters, $absolute); + } + /** + * Get the URL for a given route instance. + * + * @param \Illuminate\Routing\Route $route + * @param mixed $parameters + * @param bool $absolute + * @return string + * @throws \Illuminate\Routing\Exceptions\UrlGenerationException + * @static + */ + public static function toRoute($route, $parameters, $absolute) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->toRoute($route, $parameters, $absolute); + } + /** + * Get the URL to a controller action. + * + * @param string|array $action + * @param mixed $parameters + * @param bool $absolute + * @return string + * @throws \InvalidArgumentException + * @static + */ + public static function action($action, $parameters = [], $absolute = true) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->action($action, $parameters, $absolute); + } + /** + * Format the array of URL parameters. + * + * @param mixed|array $parameters + * @return array + * @static + */ + public static function formatParameters($parameters) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->formatParameters($parameters); + } + /** + * Get the base URL for the request. + * + * @param string $scheme + * @param string|null $root + * @return string + * @static + */ + public static function formatRoot($scheme, $root = null) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->formatRoot($scheme, $root); + } + /** + * Format the given URL segments into a single URL. + * + * @param string $root + * @param string $path + * @param \Illuminate\Routing\Route|null $route + * @return string + * @static + */ + public static function format($root, $path, $route = null) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->format($root, $path, $route); + } + /** + * Determine if the given path is a valid URL. + * + * @param string $path + * @return bool + * @static + */ + public static function isValidUrl($path) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->isValidUrl($path); + } + /** + * Set the default named parameters used by the URL generator. + * + * @param array $defaults + * @return void + * @static + */ + public static function defaults($defaults) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + $instance->defaults($defaults); + } + /** + * Get the default named parameters used by the URL generator. + * + * @return array + * @static + */ + public static function getDefaultParameters() + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->getDefaultParameters(); + } + /** + * Force the scheme for URLs. + * + * @param string|null $scheme + * @return void + * @static + */ + public static function forceScheme($scheme) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + $instance->forceScheme($scheme); + } + /** + * Set the forced root URL. + * + * @param string|null $root + * @return void + * @static + */ + public static function forceRootUrl($root) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + $instance->forceRootUrl($root); + } + /** + * Set a callback to be used to format the host of generated URLs. + * + * @param \Closure $callback + * @return \Illuminate\Routing\UrlGenerator + * @static + */ + public static function formatHostUsing($callback) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->formatHostUsing($callback); + } + /** + * Set a callback to be used to format the path of generated URLs. + * + * @param \Closure $callback + * @return \Illuminate\Routing\UrlGenerator + * @static + */ + public static function formatPathUsing($callback) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->formatPathUsing($callback); + } + /** + * Get the path formatter being used by the URL generator. + * + * @return \Closure + * @static + */ + public static function pathFormatter() + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->pathFormatter(); + } + /** + * Get the request instance. + * + * @return \Illuminate\Http\Request + * @static + */ + public static function getRequest() + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->getRequest(); + } + /** + * Set the current request instance. + * + * @param \Illuminate\Http\Request $request + * @return void + * @static + */ + public static function setRequest($request) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + $instance->setRequest($request); + } + /** + * Set the route collection. + * + * @param \Illuminate\Routing\RouteCollectionInterface $routes + * @return \Illuminate\Routing\UrlGenerator + * @static + */ + public static function setRoutes($routes) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->setRoutes($routes); + } + /** + * Set the session resolver for the generator. + * + * @param callable $sessionResolver + * @return \Illuminate\Routing\UrlGenerator + * @static + */ + public static function setSessionResolver($sessionResolver) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->setSessionResolver($sessionResolver); + } + /** + * Set the encryption key resolver. + * + * @param callable $keyResolver + * @return \Illuminate\Routing\UrlGenerator + * @static + */ + public static function setKeyResolver($keyResolver) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->setKeyResolver($keyResolver); + } + /** + * Set the root controller namespace. + * + * @param string $rootNamespace + * @return \Illuminate\Routing\UrlGenerator + * @static + */ + public static function setRootControllerNamespace($rootNamespace) + { + /** @var \Illuminate\Routing\UrlGenerator $instance */ + return $instance->setRootControllerNamespace($rootNamespace); + } + /** + * Register a custom macro. + * + * @param string $name + * @param object|callable $macro + * @return void + * @static + */ + public static function macro($name, $macro) + { + \Illuminate\Routing\UrlGenerator::macro($name, $macro); + } + /** + * Mix another object into the class. + * + * @param object $mixin + * @param bool $replace + * @return void + * @throws \ReflectionException + * @static + */ + public static function mixin($mixin, $replace = true) + { + \Illuminate\Routing\UrlGenerator::mixin($mixin, $replace); + } + /** + * Checks if macro is registered. + * + * @param string $name + * @return bool + * @static + */ + public static function hasMacro($name) + { + return \Illuminate\Routing\UrlGenerator::hasMacro($name); + } + /** + * Flush the existing macros. + * + * @return void + * @static + */ + public static function flushMacros() + { + \Illuminate\Routing\UrlGenerator::flushMacros(); + } + + } + /** + * + * + * @see \Illuminate\Validation\Factory + */ + class Validator { + /** + * Create a new Validator instance. + * + * @param array $data + * @param array $rules + * @param array $messages + * @param array $customAttributes + * @return \Illuminate\Validation\Validator + * @static + */ + public static function make($data, $rules, $messages = [], $customAttributes = []) + { + /** @var \Illuminate\Validation\Factory $instance */ + return $instance->make($data, $rules, $messages, $customAttributes); + } + /** + * Validate the given data against the provided rules. + * + * @param array $data + * @param array $rules + * @param array $messages + * @param array $customAttributes + * @return array + * @throws \Illuminate\Validation\ValidationException + * @static + */ + public static function validate($data, $rules, $messages = [], $customAttributes = []) + { + /** @var \Illuminate\Validation\Factory $instance */ + return $instance->validate($data, $rules, $messages, $customAttributes); + } + /** + * Register a custom validator extension. + * + * @param string $rule + * @param \Closure|string $extension + * @param string|null $message + * @return void + * @static + */ + public static function extend($rule, $extension, $message = null) + { + /** @var \Illuminate\Validation\Factory $instance */ + $instance->extend($rule, $extension, $message); + } + /** + * Register a custom implicit validator extension. + * + * @param string $rule + * @param \Closure|string $extension + * @param string|null $message + * @return void + * @static + */ + public static function extendImplicit($rule, $extension, $message = null) + { + /** @var \Illuminate\Validation\Factory $instance */ + $instance->extendImplicit($rule, $extension, $message); + } + /** + * Register a custom dependent validator extension. + * + * @param string $rule + * @param \Closure|string $extension + * @param string|null $message + * @return void + * @static + */ + public static function extendDependent($rule, $extension, $message = null) + { + /** @var \Illuminate\Validation\Factory $instance */ + $instance->extendDependent($rule, $extension, $message); + } + /** + * Register a custom validator message replacer. + * + * @param string $rule + * @param \Closure|string $replacer + * @return void + * @static + */ + public static function replacer($rule, $replacer) + { + /** @var \Illuminate\Validation\Factory $instance */ + $instance->replacer($rule, $replacer); + } + /** + * Indicate that unvalidated array keys should be excluded, even if the parent array was validated. + * + * @return void + * @static + */ + public static function excludeUnvalidatedArrayKeys() + { + /** @var \Illuminate\Validation\Factory $instance */ + $instance->excludeUnvalidatedArrayKeys(); + } + /** + * Set the Validator instance resolver. + * + * @param \Closure $resolver + * @return void + * @static + */ + public static function resolver($resolver) + { + /** @var \Illuminate\Validation\Factory $instance */ + $instance->resolver($resolver); + } + /** + * Get the Translator implementation. + * + * @return \Illuminate\Contracts\Translation\Translator + * @static + */ + public static function getTranslator() + { + /** @var \Illuminate\Validation\Factory $instance */ + return $instance->getTranslator(); + } + /** + * Get the Presence Verifier implementation. + * + * @return \Illuminate\Validation\PresenceVerifierInterface + * @static + */ + public static function getPresenceVerifier() + { + /** @var \Illuminate\Validation\Factory $instance */ + return $instance->getPresenceVerifier(); + } + /** + * Set the Presence Verifier implementation. + * + * @param \Illuminate\Validation\PresenceVerifierInterface $presenceVerifier + * @return void + * @static + */ + public static function setPresenceVerifier($presenceVerifier) + { + /** @var \Illuminate\Validation\Factory $instance */ + $instance->setPresenceVerifier($presenceVerifier); + } + /** + * Get the container instance used by the validation factory. + * + * @return \Illuminate\Contracts\Container\Container + * @static + */ + public static function getContainer() + { + /** @var \Illuminate\Validation\Factory $instance */ + return $instance->getContainer(); + } + /** + * Set the container instance used by the validation factory. + * + * @param \Illuminate\Contracts\Container\Container $container + * @return \Illuminate\Validation\Factory + * @static + */ + public static function setContainer($container) + { + /** @var \Illuminate\Validation\Factory $instance */ + return $instance->setContainer($container); + } + + } + /** + * + * + * @see \Illuminate\View\Factory + */ + class View { + /** + * Get the evaluated view contents for the given view. + * + * @param string $path + * @param \Illuminate\Contracts\Support\Arrayable|array $data + * @param array $mergeData + * @return \Illuminate\Contracts\View\View + * @static + */ + public static function file($path, $data = [], $mergeData = []) + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->file($path, $data, $mergeData); + } + /** + * Get the evaluated view contents for the given view. + * + * @param string $view + * @param \Illuminate\Contracts\Support\Arrayable|array $data + * @param array $mergeData + * @return \Illuminate\Contracts\View\View + * @static + */ + public static function make($view, $data = [], $mergeData = []) + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->make($view, $data, $mergeData); + } + /** + * Get the first view that actually exists from the given list. + * + * @param array $views + * @param \Illuminate\Contracts\Support\Arrayable|array $data + * @param array $mergeData + * @return \Illuminate\Contracts\View\View + * @throws \InvalidArgumentException + * @static + */ + public static function first($views, $data = [], $mergeData = []) + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->first($views, $data, $mergeData); + } + /** + * Get the rendered content of the view based on a given condition. + * + * @param bool $condition + * @param string $view + * @param \Illuminate\Contracts\Support\Arrayable|array $data + * @param array $mergeData + * @return string + * @static + */ + public static function renderWhen($condition, $view, $data = [], $mergeData = []) + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->renderWhen($condition, $view, $data, $mergeData); + } + /** + * Get the rendered content of the view based on the negation of a given condition. + * + * @param bool $condition + * @param string $view + * @param \Illuminate\Contracts\Support\Arrayable|array $data + * @param array $mergeData + * @return string + * @static + */ + public static function renderUnless($condition, $view, $data = [], $mergeData = []) + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->renderUnless($condition, $view, $data, $mergeData); + } + /** + * Get the rendered contents of a partial from a loop. + * + * @param string $view + * @param array $data + * @param string $iterator + * @param string $empty + * @return string + * @static + */ + public static function renderEach($view, $data, $iterator, $empty = 'raw|') + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->renderEach($view, $data, $iterator, $empty); + } + /** + * Determine if a given view exists. + * + * @param string $view + * @return bool + * @static + */ + public static function exists($view) + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->exists($view); + } + /** + * Get the appropriate view engine for the given path. + * + * @param string $path + * @return \Illuminate\Contracts\View\Engine + * @throws \InvalidArgumentException + * @static + */ + public static function getEngineFromPath($path) + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->getEngineFromPath($path); + } + /** + * Add a piece of shared data to the environment. + * + * @param array|string $key + * @param mixed|null $value + * @return mixed + * @static + */ + public static function share($key, $value = null) + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->share($key, $value); + } + /** + * Increment the rendering counter. + * + * @return void + * @static + */ + public static function incrementRender() + { + /** @var \Illuminate\View\Factory $instance */ + $instance->incrementRender(); + } + /** + * Decrement the rendering counter. + * + * @return void + * @static + */ + public static function decrementRender() + { + /** @var \Illuminate\View\Factory $instance */ + $instance->decrementRender(); + } + /** + * Check if there are no active render operations. + * + * @return bool + * @static + */ + public static function doneRendering() + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->doneRendering(); + } + /** + * Determine if the given once token has been rendered. + * + * @param string $id + * @return bool + * @static + */ + public static function hasRenderedOnce($id) + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->hasRenderedOnce($id); + } + /** + * Mark the given once token as having been rendered. + * + * @param string $id + * @return void + * @static + */ + public static function markAsRenderedOnce($id) + { + /** @var \Illuminate\View\Factory $instance */ + $instance->markAsRenderedOnce($id); + } + /** + * Add a location to the array of view locations. + * + * @param string $location + * @return void + * @static + */ + public static function addLocation($location) + { + /** @var \Illuminate\View\Factory $instance */ + $instance->addLocation($location); + } + /** + * Add a new namespace to the loader. + * + * @param string $namespace + * @param string|array $hints + * @return \Illuminate\View\Factory + * @static + */ + public static function addNamespace($namespace, $hints) + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->addNamespace($namespace, $hints); + } + /** + * Prepend a new namespace to the loader. + * + * @param string $namespace + * @param string|array $hints + * @return \Illuminate\View\Factory + * @static + */ + public static function prependNamespace($namespace, $hints) + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->prependNamespace($namespace, $hints); + } + /** + * Replace the namespace hints for the given namespace. + * + * @param string $namespace + * @param string|array $hints + * @return \Illuminate\View\Factory + * @static + */ + public static function replaceNamespace($namespace, $hints) + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->replaceNamespace($namespace, $hints); + } + /** + * Register a valid view extension and its engine. + * + * @param string $extension + * @param string $engine + * @param \Closure|null $resolver + * @return void + * @static + */ + public static function addExtension($extension, $engine, $resolver = null) + { + /** @var \Illuminate\View\Factory $instance */ + $instance->addExtension($extension, $engine, $resolver); + } + /** + * Flush all of the factory state like sections and stacks. + * + * @return void + * @static + */ + public static function flushState() + { + /** @var \Illuminate\View\Factory $instance */ + $instance->flushState(); + } + /** + * Flush all of the section contents if done rendering. + * + * @return void + * @static + */ + public static function flushStateIfDoneRendering() + { + /** @var \Illuminate\View\Factory $instance */ + $instance->flushStateIfDoneRendering(); + } + /** + * Get the extension to engine bindings. + * + * @return array + * @static + */ + public static function getExtensions() + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->getExtensions(); + } + /** + * Get the engine resolver instance. + * + * @return \Illuminate\View\Engines\EngineResolver + * @static + */ + public static function getEngineResolver() + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->getEngineResolver(); + } + /** + * Get the view finder instance. + * + * @return \Illuminate\View\ViewFinderInterface + * @static + */ + public static function getFinder() + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->getFinder(); + } + /** + * Set the view finder instance. + * + * @param \Illuminate\View\ViewFinderInterface $finder + * @return void + * @static + */ + public static function setFinder($finder) + { + /** @var \Illuminate\View\Factory $instance */ + $instance->setFinder($finder); + } + /** + * Flush the cache of views located by the finder. + * + * @return void + * @static + */ + public static function flushFinderCache() + { + /** @var \Illuminate\View\Factory $instance */ + $instance->flushFinderCache(); + } + /** + * Get the event dispatcher instance. + * + * @return \Illuminate\Contracts\Events\Dispatcher + * @static + */ + public static function getDispatcher() + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->getDispatcher(); + } + /** + * Set the event dispatcher instance. + * + * @param \Illuminate\Contracts\Events\Dispatcher $events + * @return void + * @static + */ + public static function setDispatcher($events) + { + /** @var \Illuminate\View\Factory $instance */ + $instance->setDispatcher($events); + } + /** + * Get the IoC container instance. + * + * @return \Illuminate\Contracts\Container\Container + * @static + */ + public static function getContainer() + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->getContainer(); + } + /** + * Set the IoC container instance. + * + * @param \Illuminate\Contracts\Container\Container $container + * @return void + * @static + */ + public static function setContainer($container) + { + /** @var \Illuminate\View\Factory $instance */ + $instance->setContainer($container); + } + /** + * Get an item from the shared data. + * + * @param string $key + * @param mixed $default + * @return mixed + * @static + */ + public static function shared($key, $default = null) + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->shared($key, $default); + } + /** + * Get all of the shared data for the environment. + * + * @return array + * @static + */ + public static function getShared() + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->getShared(); + } + /** + * Register a custom macro. + * + * @param string $name + * @param object|callable $macro + * @return void + * @static + */ + public static function macro($name, $macro) + { + \Illuminate\View\Factory::macro($name, $macro); + } + /** + * Mix another object into the class. + * + * @param object $mixin + * @param bool $replace + * @return void + * @throws \ReflectionException + * @static + */ + public static function mixin($mixin, $replace = true) + { + \Illuminate\View\Factory::mixin($mixin, $replace); + } + /** + * Checks if macro is registered. + * + * @param string $name + * @return bool + * @static + */ + public static function hasMacro($name) + { + return \Illuminate\View\Factory::hasMacro($name); + } + /** + * Flush the existing macros. + * + * @return void + * @static + */ + public static function flushMacros() + { + \Illuminate\View\Factory::flushMacros(); + } + /** + * Start a component rendering process. + * + * @param \Illuminate\Contracts\View\View|\Illuminate\Contracts\Support\Htmlable|\Closure|string $view + * @param array $data + * @return void + * @static + */ + public static function startComponent($view, $data = []) + { + /** @var \Illuminate\View\Factory $instance */ + $instance->startComponent($view, $data); + } + /** + * Get the first view that actually exists from the given list, and start a component. + * + * @param array $names + * @param array $data + * @return void + * @static + */ + public static function startComponentFirst($names, $data = []) + { + /** @var \Illuminate\View\Factory $instance */ + $instance->startComponentFirst($names, $data); + } + /** + * Render the current component. + * + * @return string + * @static + */ + public static function renderComponent() + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->renderComponent(); + } + /** + * Get an item from the component data that exists above the current component. + * + * @param string $key + * @param mixed $default + * @return mixed|null + * @static + */ + public static function getConsumableComponentData($key, $default = null) + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->getConsumableComponentData($key, $default); + } + /** + * Start the slot rendering process. + * + * @param string $name + * @param string|null $content + * @param array $attributes + * @return void + * @static + */ + public static function slot($name, $content = null, $attributes = []) + { + /** @var \Illuminate\View\Factory $instance */ + $instance->slot($name, $content, $attributes); + } + /** + * Save the slot content for rendering. + * + * @return void + * @static + */ + public static function endSlot() + { + /** @var \Illuminate\View\Factory $instance */ + $instance->endSlot(); + } + /** + * Register a view creator event. + * + * @param array|string $views + * @param \Closure|string $callback + * @return array + * @static + */ + public static function creator($views, $callback) + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->creator($views, $callback); + } + /** + * Register multiple view composers via an array. + * + * @param array $composers + * @return array + * @static + */ + public static function composers($composers) + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->composers($composers); + } + /** + * Register a view composer event. + * + * @param array|string $views + * @param \Closure|string $callback + * @return array + * @static + */ + public static function composer($views, $callback) + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->composer($views, $callback); + } + /** + * Call the composer for a given view. + * + * @param \Illuminate\Contracts\View\View $view + * @return void + * @static + */ + public static function callComposer($view) + { + /** @var \Illuminate\View\Factory $instance */ + $instance->callComposer($view); + } + /** + * Call the creator for a given view. + * + * @param \Illuminate\Contracts\View\View $view + * @return void + * @static + */ + public static function callCreator($view) + { + /** @var \Illuminate\View\Factory $instance */ + $instance->callCreator($view); + } + /** + * Start injecting content into a section. + * + * @param string $section + * @param string|null $content + * @return void + * @static + */ + public static function startSection($section, $content = null) + { + /** @var \Illuminate\View\Factory $instance */ + $instance->startSection($section, $content); + } + /** + * Inject inline content into a section. + * + * @param string $section + * @param string $content + * @return void + * @static + */ + public static function inject($section, $content) + { + /** @var \Illuminate\View\Factory $instance */ + $instance->inject($section, $content); + } + /** + * Stop injecting content into a section and return its contents. + * + * @return string + * @static + */ + public static function yieldSection() + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->yieldSection(); + } + /** + * Stop injecting content into a section. + * + * @param bool $overwrite + * @return string + * @throws \InvalidArgumentException + * @static + */ + public static function stopSection($overwrite = false) + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->stopSection($overwrite); + } + /** + * Stop injecting content into a section and append it. + * + * @return string + * @throws \InvalidArgumentException + * @static + */ + public static function appendSection() + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->appendSection(); + } + /** + * Get the string contents of a section. + * + * @param string $section + * @param string $default + * @return string + * @static + */ + public static function yieldContent($section, $default = '') + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->yieldContent($section, $default); + } + /** + * Get the parent placeholder for the current request. + * + * @param string $section + * @return string + * @static + */ + public static function parentPlaceholder($section = '') + { + return \Illuminate\View\Factory::parentPlaceholder($section); + } + /** + * Check if section exists. + * + * @param string $name + * @return bool + * @static + */ + public static function hasSection($name) + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->hasSection($name); + } + /** + * Check if section does not exist. + * + * @param string $name + * @return bool + * @static + */ + public static function sectionMissing($name) + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->sectionMissing($name); + } + /** + * Get the contents of a section. + * + * @param string $name + * @param string|null $default + * @return mixed + * @static + */ + public static function getSection($name, $default = null) + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->getSection($name, $default); + } + /** + * Get the entire array of sections. + * + * @return array + * @static + */ + public static function getSections() + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->getSections(); + } + /** + * Flush all of the sections. + * + * @return void + * @static + */ + public static function flushSections() + { + /** @var \Illuminate\View\Factory $instance */ + $instance->flushSections(); + } + /** + * Add new loop to the stack. + * + * @param \Countable|array $data + * @return void + * @static + */ + public static function addLoop($data) + { + /** @var \Illuminate\View\Factory $instance */ + $instance->addLoop($data); + } + /** + * Increment the top loop's indices. + * + * @return void + * @static + */ + public static function incrementLoopIndices() + { + /** @var \Illuminate\View\Factory $instance */ + $instance->incrementLoopIndices(); + } + /** + * Pop a loop from the top of the loop stack. + * + * @return void + * @static + */ + public static function popLoop() + { + /** @var \Illuminate\View\Factory $instance */ + $instance->popLoop(); + } + /** + * Get an instance of the last loop in the stack. + * + * @return \stdClass|null + * @static + */ + public static function getLastLoop() + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->getLastLoop(); + } + /** + * Get the entire loop stack. + * + * @return array + * @static + */ + public static function getLoopStack() + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->getLoopStack(); + } + /** + * Start injecting content into a push section. + * + * @param string $section + * @param string $content + * @return void + * @static + */ + public static function startPush($section, $content = '') + { + /** @var \Illuminate\View\Factory $instance */ + $instance->startPush($section, $content); + } + /** + * Stop injecting content into a push section. + * + * @return string + * @throws \InvalidArgumentException + * @static + */ + public static function stopPush() + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->stopPush(); + } + /** + * Start prepending content into a push section. + * + * @param string $section + * @param string $content + * @return void + * @static + */ + public static function startPrepend($section, $content = '') + { + /** @var \Illuminate\View\Factory $instance */ + $instance->startPrepend($section, $content); + } + /** + * Stop prepending content into a push section. + * + * @return string + * @throws \InvalidArgumentException + * @static + */ + public static function stopPrepend() + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->stopPrepend(); + } + /** + * Get the string contents of a push section. + * + * @param string $section + * @param string $default + * @return string + * @static + */ + public static function yieldPushContent($section, $default = '') + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->yieldPushContent($section, $default); + } + /** + * Flush all of the stacks. + * + * @return void + * @static + */ + public static function flushStacks() + { + /** @var \Illuminate\View\Factory $instance */ + $instance->flushStacks(); + } + /** + * Start a translation block. + * + * @param array $replacements + * @return void + * @static + */ + public static function startTranslation($replacements = []) + { + /** @var \Illuminate\View\Factory $instance */ + $instance->startTranslation($replacements); + } + /** + * Render the current translation. + * + * @return string + * @static + */ + public static function renderTranslation() + { + /** @var \Illuminate\View\Factory $instance */ + return $instance->renderTranslation(); + } + + } + +} + + namespace Illuminate\Support { + /** + * + * + */ + class Arr { + + } + /** + * + * + */ + class Str { + + } + +} + + namespace Collective\Html { + /** + * + * + * @see \Collective\Html\FormBuilder + */ + class FormFacade { + /** + * Open up a new HTML form. + * + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function open($options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->open($options); + } + /** + * Create a new model based form builder. + * + * @param mixed $model + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function model($model, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->model($model, $options); + } + /** + * Set the model instance on the form builder. + * + * @param mixed $model + * @return void + * @static + */ + public static function setModel($model) + { + /** @var \Collective\Html\FormBuilder $instance */ + $instance->setModel($model); + } + /** + * Get the current model instance on the form builder. + * + * @return mixed $model + * @static + */ + public static function getModel() + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->getModel(); + } + /** + * Close the current form. + * + * @return string + * @static + */ + public static function close() + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->close(); + } + /** + * Generate a hidden field with the current CSRF token. + * + * @return string + * @static + */ + public static function token() + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->token(); + } + /** + * Create a form label element. + * + * @param string $name + * @param string $value + * @param array $options + * @param bool $escape_html + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function label($name, $value = null, $options = [], $escape_html = true) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->label($name, $value, $options, $escape_html); + } + /** + * Create a form input field. + * + * @param string $type + * @param string $name + * @param string $value + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function input($type, $name, $value = null, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->input($type, $name, $value, $options); + } + /** + * Create a text input field. + * + * @param string $name + * @param string $value + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function text($name, $value = null, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->text($name, $value, $options); + } + /** + * Create a password input field. + * + * @param string $name + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function password($name, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->password($name, $options); + } + /** + * Create a range input field. + * + * @param string $name + * @param string $value + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function range($name, $value = null, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->range($name, $value, $options); + } + /** + * Create a hidden input field. + * + * @param string $name + * @param string $value + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function hidden($name, $value = null, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->hidden($name, $value, $options); + } + /** + * Create a search input field. + * + * @param string $name + * @param string $value + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function search($name, $value = null, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->search($name, $value, $options); + } + /** + * Create an e-mail input field. + * + * @param string $name + * @param string $value + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function email($name, $value = null, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->email($name, $value, $options); + } + /** + * Create a tel input field. + * + * @param string $name + * @param string $value + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function tel($name, $value = null, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->tel($name, $value, $options); + } + /** + * Create a number input field. + * + * @param string $name + * @param string $value + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function number($name, $value = null, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->number($name, $value, $options); + } + /** + * Create a date input field. + * + * @param string $name + * @param string $value + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function date($name, $value = null, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->date($name, $value, $options); + } + /** + * Create a datetime input field. + * + * @param string $name + * @param string $value + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function datetime($name, $value = null, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->datetime($name, $value, $options); + } + /** + * Create a datetime-local input field. + * + * @param string $name + * @param string $value + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function datetimeLocal($name, $value = null, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->datetimeLocal($name, $value, $options); + } + /** + * Create a time input field. + * + * @param string $name + * @param string $value + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function time($name, $value = null, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->time($name, $value, $options); + } + /** + * Create a url input field. + * + * @param string $name + * @param string $value + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function url($name, $value = null, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->url($name, $value, $options); + } + /** + * Create a week input field. + * + * @param string $name + * @param string $value + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function week($name, $value = null, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->week($name, $value, $options); + } + /** + * Create a file input field. + * + * @param string $name + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function file($name, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->file($name, $options); + } + /** + * Create a textarea input field. + * + * @param string $name + * @param string $value + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function textarea($name, $value = null, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->textarea($name, $value, $options); + } + /** + * Create a select box field. + * + * @param string $name + * @param array $list + * @param string|bool $selected + * @param array $selectAttributes + * @param array $optionsAttributes + * @param array $optgroupsAttributes + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function select($name, $list = [], $selected = null, $selectAttributes = [], $optionsAttributes = [], $optgroupsAttributes = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->select($name, $list, $selected, $selectAttributes, $optionsAttributes, $optgroupsAttributes); + } + /** + * Create a select range field. + * + * @param string $name + * @param string $begin + * @param string $end + * @param string $selected + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function selectRange($name, $begin, $end, $selected = null, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->selectRange($name, $begin, $end, $selected, $options); + } + /** + * Create a select year field. + * + * @param string $name + * @param string $begin + * @param string $end + * @param string $selected + * @param array $options + * @return mixed + * @static + */ + public static function selectYear() + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->selectYear(); + } + /** + * Create a select month field. + * + * @param string $name + * @param string $selected + * @param array $options + * @param string $format + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function selectMonth($name, $selected = null, $options = [], $format = '%B') + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->selectMonth($name, $selected, $options, $format); + } + /** + * Get the select option for the given value. + * + * @param string $display + * @param string $value + * @param string $selected + * @param array $attributes + * @param array $optgroupAttributes + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function getSelectOption($display, $value, $selected, $attributes = [], $optgroupAttributes = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->getSelectOption($display, $value, $selected, $attributes, $optgroupAttributes); + } + /** + * Create a checkbox input field. + * + * @param string $name + * @param mixed $value + * @param bool $checked + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function checkbox($name, $value = 1, $checked = null, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->checkbox($name, $value, $checked, $options); + } + /** + * Create a radio button input field. + * + * @param string $name + * @param mixed $value + * @param bool $checked + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function radio($name, $value = null, $checked = null, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->radio($name, $value, $checked, $options); + } + /** + * Create a HTML reset input element. + * + * @param string $value + * @param array $attributes + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function reset($value, $attributes = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->reset($value, $attributes); + } + /** + * Create a HTML image input element. + * + * @param string $url + * @param string $name + * @param array $attributes + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function image($url, $name = null, $attributes = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->image($url, $name, $attributes); + } + /** + * Create a month input field. + * + * @param string $name + * @param string $value + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function month($name, $value = null, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->month($name, $value, $options); + } + /** + * Create a color input field. + * + * @param string $name + * @param string $value + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function color($name, $value = null, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->color($name, $value, $options); + } + /** + * Create a submit button element. + * + * @param string $value + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function submit($value = null, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->submit($value, $options); + } + /** + * Create a button element. + * + * @param string $value + * @param array $options + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function button($value = null, $options = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->button($value, $options); + } + /** + * Create a datalist box field. + * + * @param string $id + * @param array $list + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function datalist($id, $list = []) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->datalist($id, $list); + } + /** + * Get the ID attribute for a field name. + * + * @param string $name + * @param array $attributes + * @return string + * @static + */ + public static function getIdAttribute($name, $attributes) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->getIdAttribute($name, $attributes); + } + /** + * Get the value that should be assigned to the field. + * + * @param string $name + * @param string $value + * @return mixed + * @static + */ + public static function getValueAttribute($name, $value = null) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->getValueAttribute($name, $value); + } + /** + * Take Request in fill process + * + * @param bool $consider + * @static + */ + public static function considerRequest($consider = true) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->considerRequest($consider); + } + /** + * Get a value from the session's old input. + * + * @param string $name + * @return mixed + * @static + */ + public static function old($name) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->old($name); + } + /** + * Determine if the old input is empty. + * + * @return bool + * @static + */ + public static function oldInputIsEmpty() + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->oldInputIsEmpty(); + } + /** + * Get the session store implementation. + * + * @return \Illuminate\Contracts\Session\Session $session + * @static + */ + public static function getSessionStore() + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->getSessionStore(); + } + /** + * Set the session store implementation. + * + * @param \Illuminate\Contracts\Session\Session $session + * @return \Collective\Html\FormBuilder + * @static + */ + public static function setSessionStore($session) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->setSessionStore($session); + } + /** + * Register a custom macro. + * + * @param string $name + * @param object|callable $macro + * @return void + * @static + */ + public static function macro($name, $macro) + { + \Collective\Html\FormBuilder::macro($name, $macro); + } + /** + * Mix another object into the class. + * + * @param object $mixin + * @param bool $replace + * @return void + * @throws \ReflectionException + * @static + */ + public static function mixin($mixin, $replace = true) + { + \Collective\Html\FormBuilder::mixin($mixin, $replace); + } + /** + * Checks if macro is registered. + * + * @param string $name + * @return bool + * @static + */ + public static function hasMacro($name) + { + return \Collective\Html\FormBuilder::hasMacro($name); + } + /** + * Flush the existing macros. + * + * @return void + * @static + */ + public static function flushMacros() + { + \Collective\Html\FormBuilder::flushMacros(); + } + /** + * Dynamically handle calls to the class. + * + * @param string $method + * @param array $parameters + * @return mixed + * @throws \BadMethodCallException + * @static + */ + public static function macroCall($method, $parameters) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->macroCall($method, $parameters); + } + /** + * Register a custom component. + * + * @param $name + * @param $view + * @param array $signature + * @return void + * @static + */ + public static function component($name, $view, $signature) + { + \Collective\Html\FormBuilder::component($name, $view, $signature); + } + /** + * Check if a component is registered. + * + * @param $name + * @return bool + * @static + */ + public static function hasComponent($name) + { + return \Collective\Html\FormBuilder::hasComponent($name); + } + /** + * Dynamically handle calls to the class. + * + * @param string $method + * @param array $parameters + * @return \Illuminate\Contracts\View\View|mixed + * @throws \BadMethodCallException + * @static + */ + public static function componentCall($method, $parameters) + { + /** @var \Collective\Html\FormBuilder $instance */ + return $instance->componentCall($method, $parameters); + } + + } + /** + * + * + * @see \Collective\Html\HtmlBuilder + */ + class HtmlFacade { + /** + * Convert an HTML string to entities. + * + * @param string $value + * @return string + * @static + */ + public static function entities($value) + { + /** @var \Collective\Html\HtmlBuilder $instance */ + return $instance->entities($value); + } + /** + * Convert entities to HTML characters. + * + * @param string $value + * @return string + * @static + */ + public static function decode($value) + { + /** @var \Collective\Html\HtmlBuilder $instance */ + return $instance->decode($value); + } + /** + * Generate a link to a JavaScript file. + * + * @param string $url + * @param array $attributes + * @param bool $secure + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function script($url, $attributes = [], $secure = null) + { + /** @var \Collective\Html\HtmlBuilder $instance */ + return $instance->script($url, $attributes, $secure); + } + /** + * Generate a link to a CSS file. + * + * @param string $url + * @param array $attributes + * @param bool $secure + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function style($url, $attributes = [], $secure = null) + { + /** @var \Collective\Html\HtmlBuilder $instance */ + return $instance->style($url, $attributes, $secure); + } + /** + * Generate an HTML image element. + * + * @param string $url + * @param string $alt + * @param array $attributes + * @param bool $secure + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function image($url, $alt = null, $attributes = [], $secure = null) + { + /** @var \Collective\Html\HtmlBuilder $instance */ + return $instance->image($url, $alt, $attributes, $secure); + } + /** + * Generate a link to a Favicon file. + * + * @param string $url + * @param array $attributes + * @param bool $secure + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function favicon($url, $attributes = [], $secure = null) + { + /** @var \Collective\Html\HtmlBuilder $instance */ + return $instance->favicon($url, $attributes, $secure); + } + /** + * Generate a HTML link. + * + * @param string $url + * @param string $title + * @param array $attributes + * @param bool $secure + * @param bool $escape + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function link($url, $title = null, $attributes = [], $secure = null, $escape = true) + { + /** @var \Collective\Html\HtmlBuilder $instance */ + return $instance->link($url, $title, $attributes, $secure, $escape); + } + /** + * Generate a HTTPS HTML link. + * + * @param string $url + * @param string $title + * @param array $attributes + * @param bool $escape + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function secureLink($url, $title = null, $attributes = [], $escape = true) + { + /** @var \Collective\Html\HtmlBuilder $instance */ + return $instance->secureLink($url, $title, $attributes, $escape); + } + /** + * Generate a HTML link to an asset. + * + * @param string $url + * @param string $title + * @param array $attributes + * @param bool $secure + * @param bool $escape + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function linkAsset($url, $title = null, $attributes = [], $secure = null, $escape = true) + { + /** @var \Collective\Html\HtmlBuilder $instance */ + return $instance->linkAsset($url, $title, $attributes, $secure, $escape); + } + /** + * Generate a HTTPS HTML link to an asset. + * + * @param string $url + * @param string $title + * @param array $attributes + * @param bool $escape + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function linkSecureAsset($url, $title = null, $attributes = [], $escape = true) + { + /** @var \Collective\Html\HtmlBuilder $instance */ + return $instance->linkSecureAsset($url, $title, $attributes, $escape); + } + /** + * Generate a HTML link to a named route. + * + * @param string $name + * @param string $title + * @param array $parameters + * @param array $attributes + * @param bool $secure + * @param bool $escape + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function linkRoute($name, $title = null, $parameters = [], $attributes = [], $secure = null, $escape = true) + { + /** @var \Collective\Html\HtmlBuilder $instance */ + return $instance->linkRoute($name, $title, $parameters, $attributes, $secure, $escape); + } + /** + * Generate a HTML link to a controller action. + * + * @param string $action + * @param string $title + * @param array $parameters + * @param array $attributes + * @param bool $secure + * @param bool $escape + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function linkAction($action, $title = null, $parameters = [], $attributes = [], $secure = null, $escape = true) + { + /** @var \Collective\Html\HtmlBuilder $instance */ + return $instance->linkAction($action, $title, $parameters, $attributes, $secure, $escape); + } + /** + * Generate a HTML link to an email address. + * + * @param string $email + * @param string $title + * @param array $attributes + * @param bool $escape + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function mailto($email, $title = null, $attributes = [], $escape = true) + { + /** @var \Collective\Html\HtmlBuilder $instance */ + return $instance->mailto($email, $title, $attributes, $escape); + } + /** + * Obfuscate an e-mail address to prevent spam-bots from sniffing it. + * + * @param string $email + * @return string + * @static + */ + public static function email($email) + { + /** @var \Collective\Html\HtmlBuilder $instance */ + return $instance->email($email); + } + /** + * Generates non-breaking space entities based on number supplied. + * + * @param int $num + * @return string + * @static + */ + public static function nbsp($num = 1) + { + /** @var \Collective\Html\HtmlBuilder $instance */ + return $instance->nbsp($num); + } + /** + * Generate an ordered list of items. + * + * @param array $list + * @param array $attributes + * @return \Illuminate\Support\HtmlString|string + * @static + */ + public static function ol($list, $attributes = []) + { + /** @var \Collective\Html\HtmlBuilder $instance */ + return $instance->ol($list, $attributes); + } + /** + * Generate an un-ordered list of items. + * + * @param array $list + * @param array $attributes + * @return \Illuminate\Support\HtmlString|string + * @static + */ + public static function ul($list, $attributes = []) + { + /** @var \Collective\Html\HtmlBuilder $instance */ + return $instance->ul($list, $attributes); + } + /** + * Generate a description list of items. + * + * @param array $list + * @param array $attributes + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function dl($list, $attributes = []) + { + /** @var \Collective\Html\HtmlBuilder $instance */ + return $instance->dl($list, $attributes); + } + /** + * Build an HTML attribute string from an array. + * + * @param array $attributes + * @return string + * @static + */ + public static function attributes($attributes) + { + /** @var \Collective\Html\HtmlBuilder $instance */ + return $instance->attributes($attributes); + } + /** + * Obfuscate a string to prevent spam-bots from sniffing it. + * + * @param string $value + * @return string + * @static + */ + public static function obfuscate($value) + { + /** @var \Collective\Html\HtmlBuilder $instance */ + return $instance->obfuscate($value); + } + /** + * Generate a meta tag. + * + * @param string $name + * @param string $content + * @param array $attributes + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function meta($name, $content, $attributes = []) + { + /** @var \Collective\Html\HtmlBuilder $instance */ + return $instance->meta($name, $content, $attributes); + } + /** + * Generate an html tag. + * + * @param string $tag + * @param mixed $content + * @param array $attributes + * @return \Illuminate\Support\HtmlString + * @static + */ + public static function tag($tag, $content, $attributes = []) + { + /** @var \Collective\Html\HtmlBuilder $instance */ + return $instance->tag($tag, $content, $attributes); + } + /** + * Register a custom macro. + * + * @param string $name + * @param object|callable $macro + * @return void + * @static + */ + public static function macro($name, $macro) + { + \Collective\Html\HtmlBuilder::macro($name, $macro); + } + /** + * Mix another object into the class. + * + * @param object $mixin + * @param bool $replace + * @return void + * @throws \ReflectionException + * @static + */ + public static function mixin($mixin, $replace = true) + { + \Collective\Html\HtmlBuilder::mixin($mixin, $replace); + } + /** + * Checks if macro is registered. + * + * @param string $name + * @return bool + * @static + */ + public static function hasMacro($name) + { + return \Collective\Html\HtmlBuilder::hasMacro($name); + } + /** + * Flush the existing macros. + * + * @return void + * @static + */ + public static function flushMacros() + { + \Collective\Html\HtmlBuilder::flushMacros(); + } + /** + * Dynamically handle calls to the class. + * + * @param string $method + * @param array $parameters + * @return mixed + * @throws \BadMethodCallException + * @static + */ + public static function macroCall($method, $parameters) + { + /** @var \Collective\Html\HtmlBuilder $instance */ + return $instance->macroCall($method, $parameters); + } + /** + * Register a custom component. + * + * @param $name + * @param $view + * @param array $signature + * @return void + * @static + */ + public static function component($name, $view, $signature) + { + \Collective\Html\HtmlBuilder::component($name, $view, $signature); + } + /** + * Check if a component is registered. + * + * @param $name + * @return bool + * @static + */ + public static function hasComponent($name) + { + return \Collective\Html\HtmlBuilder::hasComponent($name); + } + /** + * Dynamically handle calls to the class. + * + * @param string $method + * @param array $parameters + * @return \Illuminate\Contracts\View\View|mixed + * @throws \BadMethodCallException + * @static + */ + public static function componentCall($method, $parameters) + { + /** @var \Collective\Html\HtmlBuilder $instance */ + return $instance->componentCall($method, $parameters); + } + + } + +} + + namespace Symfony\Component\Yaml { + /** + * Yaml offers convenience methods to load and dump YAML. + * + * @author Fabien Potencier + * @final + */ + class Yaml { + + } + +} + + namespace App { + /** + * + * + */ + class SupportedApps { + + } + /** + * + * + */ + interface EnhancedApps { + + } + +} + + namespace Facade\Ignition\Facades { + /** + * Class Flare. + * + * @see \Facade\FlareClient\Flare + */ + class Flare { + /** + * + * + * @static + */ + public static function register($apiKey, $apiSecret = null, $contextDetector = null, $container = null) + { + return \Facade\FlareClient\Flare::register($apiKey, $apiSecret, $contextDetector, $container); + } + /** + * + * + * @static + */ + public static function determineVersionUsing($determineVersionCallable) + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->determineVersionUsing($determineVersionCallable); + } + /** + * + * + * @static + */ + public static function reportErrorLevels($reportErrorLevels) + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->reportErrorLevels($reportErrorLevels); + } + /** + * + * + * @static + */ + public static function filterExceptionsUsing($filterExceptionsCallable) + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->filterExceptionsUsing($filterExceptionsCallable); + } + /** + * + * + * @static + */ + public static function filterReportsUsing($filterReportsCallable) + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->filterReportsUsing($filterReportsCallable); + } + /** + * + * + * @return null|string + * @static + */ + public static function version() + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->version(); + } + /** + * + * + * @static + */ + public static function getMiddleware() + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->getMiddleware(); + } + /** + * + * + * @static + */ + public static function registerFlareHandlers() + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->registerFlareHandlers(); + } + /** + * + * + * @static + */ + public static function registerExceptionHandler() + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->registerExceptionHandler(); + } + /** + * + * + * @static + */ + public static function registerErrorHandler() + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->registerErrorHandler(); + } + /** + * + * + * @static + */ + public static function registerMiddleware($callable) + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->registerMiddleware($callable); + } + /** + * + * + * @static + */ + public static function getMiddlewares() + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->getMiddlewares(); + } + /** + * + * + * @static + */ + public static function glow($name, $messageLevel = 'info', $metaData = []) + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->glow($name, $messageLevel, $metaData); + } + /** + * + * + * @static + */ + public static function handleException($throwable) + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->handleException($throwable); + } + /** + * + * + * @static + */ + public static function handleError($code, $message, $file = '', $line = 0) + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->handleError($code, $message, $file, $line); + } + /** + * + * + * @static + */ + public static function applicationPath($applicationPath) + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->applicationPath($applicationPath); + } + /** + * + * + * @static + */ + public static function report($throwable, $callback = null) + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->report($throwable, $callback); + } + /** + * + * + * @static + */ + public static function reportMessage($message, $logLevel, $callback = null) + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->reportMessage($message, $logLevel, $callback); + } + /** + * + * + * @static + */ + public static function sendTestReport($throwable) + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->sendTestReport($throwable); + } + /** + * + * + * @static + */ + public static function reset() + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->reset(); + } + /** + * + * + * @static + */ + public static function anonymizeIp() + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->anonymizeIp(); + } + /** + * + * + * @static + */ + public static function censorRequestBodyFields($fieldNames) + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->censorRequestBodyFields($fieldNames); + } + /** + * + * + * @static + */ + public static function createReport($throwable) + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->createReport($throwable); + } + /** + * + * + * @static + */ + public static function createReportFromMessage($message, $logLevel) + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->createReportFromMessage($message, $logLevel); + } + /** + * + * + * @static + */ + public static function stage($stage) + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->stage($stage); + } + /** + * + * + * @static + */ + public static function messageLevel($messageLevel) + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->messageLevel($messageLevel); + } + /** + * + * + * @static + */ + public static function getGroup($groupName = 'context', $default = []) + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->getGroup($groupName, $default); + } + /** + * + * + * @static + */ + public static function context($key, $value) + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->context($key, $value); + } + /** + * + * + * @static + */ + public static function group($groupName, $properties) + { + /** @var \Facade\FlareClient\Flare $instance */ + return $instance->group($groupName, $properties); + } + + } + +} + + namespace Illuminate\Http { + /** + * + * + */ + class Request { + /** + * + * + * @see \Illuminate\Foundation\Providers\FoundationServiceProvider::registerRequestValidation() + * @param array $rules + * @param mixed $params + * @static + */ + public static function validate($rules, ...$params) + { + return \Illuminate\Http\Request::validate($rules, ...$params); + } + /** + * + * + * @see \Illuminate\Foundation\Providers\FoundationServiceProvider::registerRequestValidation() + * @param string $errorBag + * @param array $rules + * @param mixed $params + * @static + */ + public static function validateWithBag($errorBag, $rules, ...$params) + { + return \Illuminate\Http\Request::validateWithBag($errorBag, $rules, ...$params); + } + /** + * + * + * @see \Illuminate\Foundation\Providers\FoundationServiceProvider::registerRequestSignatureValidation() + * @param mixed $absolute + * @static + */ + public static function hasValidSignature($absolute = true) + { + return \Illuminate\Http\Request::hasValidSignature($absolute); + } + /** + * + * + * @see \Illuminate\Foundation\Providers\FoundationServiceProvider::registerRequestSignatureValidation() + * @static + */ + public static function hasValidRelativeSignature() + { + return \Illuminate\Http\Request::hasValidRelativeSignature(); + } + + } + +} + + namespace Illuminate\Routing { + /** + * + * + * @mixin \Illuminate\Routing\RouteRegistrar + */ + class Router { + /** + * + * + * @see \Laravel\Ui\AuthRouteMethods::auth() + * @param mixed $options + * @static + */ + public static function auth($options = []) + { + return \Illuminate\Routing\Router::auth($options); + } + /** + * + * + * @see \Laravel\Ui\AuthRouteMethods::resetPassword() + * @static + */ + public static function resetPassword() + { + return \Illuminate\Routing\Router::resetPassword(); + } + /** + * + * + * @see \Laravel\Ui\AuthRouteMethods::confirmPassword() + * @static + */ + public static function confirmPassword() + { + return \Illuminate\Routing\Router::confirmPassword(); + } + /** + * + * + * @see \Laravel\Ui\AuthRouteMethods::emailVerification() + * @static + */ + public static function emailVerification() + { + return \Illuminate\Routing\Router::emailVerification(); + } + + } + +} + + +namespace { + class App extends \Illuminate\Support\Facades\App {} + class Arr extends \Illuminate\Support\Arr {} + class Artisan extends \Illuminate\Support\Facades\Artisan {} + class Auth extends \Illuminate\Support\Facades\Auth {} + class Blade extends \Illuminate\Support\Facades\Blade {} + class Broadcast extends \Illuminate\Support\Facades\Broadcast {} + class Bus extends \Illuminate\Support\Facades\Bus {} + class Cache extends \Illuminate\Support\Facades\Cache {} + class Config extends \Illuminate\Support\Facades\Config {} + class Cookie extends \Illuminate\Support\Facades\Cookie {} + class Crypt extends \Illuminate\Support\Facades\Crypt {} + class DB extends \Illuminate\Support\Facades\DB {} + class Eloquent extends \Illuminate\Database\Eloquent\Model { + /** + * Create and return an un-saved model instance. + * + * @param array $attributes + * @return \Illuminate\Database\Eloquent\Model|static + * @static + */ + public static function make($attributes = []) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->make($attributes); + } + + /** + * Register a new global scope. + * + * @param string $identifier + * @param \Illuminate\Database\Eloquent\Scope|\Closure $scope + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function withGlobalScope($identifier, $scope) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->withGlobalScope($identifier, $scope); + } + + /** + * Remove a registered global scope. + * + * @param \Illuminate\Database\Eloquent\Scope|string $scope + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function withoutGlobalScope($scope) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->withoutGlobalScope($scope); + } + + /** + * Remove all or passed registered global scopes. + * + * @param array|null $scopes + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function withoutGlobalScopes($scopes = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->withoutGlobalScopes($scopes); + } + + /** + * Get an array of global scopes that were removed from the query. + * + * @return array + * @static + */ + public static function removedScopes() + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->removedScopes(); + } + + /** + * Add a where clause on the primary key to the query. + * + * @param mixed $id + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function whereKey($id) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->whereKey($id); + } + + /** + * Add a where clause on the primary key to the query. + * + * @param mixed $id + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function whereKeyNot($id) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->whereKeyNot($id); + } + + /** + * Add a basic where clause to the query. + * + * @param \Closure|string|array|\Illuminate\Database\Query\Expression $column + * @param mixed $operator + * @param mixed $value + * @param string $boolean + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function where($column, $operator = null, $value = null, $boolean = 'and') + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->where($column, $operator, $value, $boolean); + } + + /** + * Add a basic where clause to the query, and return the first result. + * + * @param \Closure|string|array|\Illuminate\Database\Query\Expression $column + * @param mixed $operator + * @param mixed $value + * @param string $boolean + * @return \Illuminate\Database\Eloquent\Model|static|null + * @static + */ + public static function firstWhere($column, $operator = null, $value = null, $boolean = 'and') + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->firstWhere($column, $operator, $value, $boolean); + } + + /** + * Add an "or where" clause to the query. + * + * @param \Closure|array|string|\Illuminate\Database\Query\Expression $column + * @param mixed $operator + * @param mixed $value + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function orWhere($column, $operator = null, $value = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->orWhere($column, $operator, $value); + } + + /** + * Add an "order by" clause for a timestamp to the query. + * + * @param string|\Illuminate\Database\Query\Expression $column + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function latest($column = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->latest($column); + } + + /** + * Add an "order by" clause for a timestamp to the query. + * + * @param string|\Illuminate\Database\Query\Expression $column + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function oldest($column = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->oldest($column); + } + + /** + * Create a collection of models from plain arrays. + * + * @param array $items + * @return \Illuminate\Database\Eloquent\Collection + * @static + */ + public static function hydrate($items) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->hydrate($items); + } + + /** + * Create a collection of models from a raw query. + * + * @param string $query + * @param array $bindings + * @return \Illuminate\Database\Eloquent\Collection + * @static + */ + public static function fromQuery($query, $bindings = []) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->fromQuery($query, $bindings); + } + + /** + * Find a model by its primary key. + * + * @param mixed $id + * @param array $columns + * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|static[]|static|null + * @static + */ + public static function find($id, $columns = []) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->find($id, $columns); + } + + /** + * Find multiple models by their primary keys. + * + * @param \Illuminate\Contracts\Support\Arrayable|array $ids + * @param array $columns + * @return \Illuminate\Database\Eloquent\Collection + * @static + */ + public static function findMany($ids, $columns = []) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->findMany($ids, $columns); + } + + /** + * Find a model by its primary key or throw an exception. + * + * @param mixed $id + * @param array $columns + * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|static|static[] + * @throws \Illuminate\Database\Eloquent\ModelNotFoundException + * @static + */ + public static function findOrFail($id, $columns = []) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->findOrFail($id, $columns); + } + + /** + * Find a model by its primary key or return fresh model instance. + * + * @param mixed $id + * @param array $columns + * @return \Illuminate\Database\Eloquent\Model|static + * @static + */ + public static function findOrNew($id, $columns = []) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->findOrNew($id, $columns); + } + + /** + * Get the first record matching the attributes or instantiate it. + * + * @param array $attributes + * @param array $values + * @return \Illuminate\Database\Eloquent\Model|static + * @static + */ + public static function firstOrNew($attributes = [], $values = []) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->firstOrNew($attributes, $values); + } + + /** + * Get the first record matching the attributes or create it. + * + * @param array $attributes + * @param array $values + * @return \Illuminate\Database\Eloquent\Model|static + * @static + */ + public static function firstOrCreate($attributes = [], $values = []) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->firstOrCreate($attributes, $values); + } + + /** + * Create or update a record matching the attributes, and fill it with values. + * + * @param array $attributes + * @param array $values + * @return \Illuminate\Database\Eloquent\Model|static + * @static + */ + public static function updateOrCreate($attributes, $values = []) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->updateOrCreate($attributes, $values); + } + + /** + * Execute the query and get the first result or throw an exception. + * + * @param array $columns + * @return \Illuminate\Database\Eloquent\Model|static + * @throws \Illuminate\Database\Eloquent\ModelNotFoundException + * @static + */ + public static function firstOrFail($columns = []) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->firstOrFail($columns); + } + + /** + * Execute the query and get the first result or call a callback. + * + * @param \Closure|array $columns + * @param \Closure|null $callback + * @return \Illuminate\Database\Eloquent\Model|static|mixed + * @static + */ + public static function firstOr($columns = [], $callback = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->firstOr($columns, $callback); + } + + /** + * Execute the query and get the first result if it's the sole matching record. + * + * @param array|string $columns + * @return \Illuminate\Database\Eloquent\Model + * @throws \Illuminate\Database\Eloquent\ModelNotFoundException + * @throws \Illuminate\Database\MultipleRecordsFoundException + * @static + */ + public static function sole($columns = []) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->sole($columns); + } + + /** + * Get a single column's value from the first result of a query. + * + * @param string|\Illuminate\Database\Query\Expression $column + * @return mixed + * @static + */ + public static function value($column) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->value($column); + } + + /** + * Get a single column's value from the first result of the query or throw an exception. + * + * @param string|\Illuminate\Database\Query\Expression $column + * @return mixed + * @throws \Illuminate\Database\Eloquent\ModelNotFoundException + * @static + */ + public static function valueOrFail($column) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->valueOrFail($column); + } + + /** + * Execute the query as a "select" statement. + * + * @param array|string $columns + * @return \Illuminate\Database\Eloquent\Collection|static[] + * @static + */ + public static function get($columns = []) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->get($columns); + } + + /** + * Get the hydrated models without eager loading. + * + * @param array|string $columns + * @return \Illuminate\Database\Eloquent\Model[]|static[] + * @static + */ + public static function getModels($columns = []) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->getModels($columns); + } + + /** + * Eager load the relationships for the models. + * + * @param array $models + * @return array + * @static + */ + public static function eagerLoadRelations($models) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->eagerLoadRelations($models); + } + + /** + * Get a lazy collection for the given query. + * + * @return \Illuminate\Support\LazyCollection + * @static + */ + public static function cursor() + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->cursor(); + } + + /** + * Get an array with the values of a given column. + * + * @param string|\Illuminate\Database\Query\Expression $column + * @param string|null $key + * @return \Illuminate\Support\Collection + * @static + */ + public static function pluck($column, $key = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->pluck($column, $key); + } + + /** + * Paginate the given query. + * + * @param int|null $perPage + * @param array $columns + * @param string $pageName + * @param int|null $page + * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator + * @throws \InvalidArgumentException + * @static + */ + public static function paginate($perPage = null, $columns = [], $pageName = 'page', $page = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->paginate($perPage, $columns, $pageName, $page); + } + + /** + * Paginate the given query into a simple paginator. + * + * @param int|null $perPage + * @param array $columns + * @param string $pageName + * @param int|null $page + * @return \Illuminate\Contracts\Pagination\Paginator + * @static + */ + public static function simplePaginate($perPage = null, $columns = [], $pageName = 'page', $page = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->simplePaginate($perPage, $columns, $pageName, $page); + } + + /** + * Paginate the given query into a cursor paginator. + * + * @param int|null $perPage + * @param array $columns + * @param string $cursorName + * @param \Illuminate\Pagination\Cursor|string|null $cursor + * @return \Illuminate\Contracts\Pagination\CursorPaginator + * @static + */ + public static function cursorPaginate($perPage = null, $columns = [], $cursorName = 'cursor', $cursor = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->cursorPaginate($perPage, $columns, $cursorName, $cursor); + } + + /** + * Save a new model and return the instance. + * + * @param array $attributes + * @return \Illuminate\Database\Eloquent\Model|$this + * @static + */ + public static function create($attributes = []) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->create($attributes); + } + + /** + * Save a new model and return the instance. Allow mass-assignment. + * + * @param array $attributes + * @return \Illuminate\Database\Eloquent\Model|$this + * @static + */ + public static function forceCreate($attributes) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->forceCreate($attributes); + } + + /** + * Insert new records or update the existing ones. + * + * @param array $values + * @param array|string $uniqueBy + * @param array|null $update + * @return int + * @static + */ + public static function upsert($values, $uniqueBy, $update = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->upsert($values, $uniqueBy, $update); + } + + /** + * Register a replacement for the default delete function. + * + * @param \Closure $callback + * @return void + * @static + */ + public static function onDelete($callback) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + $instance->onDelete($callback); + } + + /** + * Call the given local model scopes. + * + * @param array|string $scopes + * @return static|mixed + * @static + */ + public static function scopes($scopes) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->scopes($scopes); + } + + /** + * Apply the scopes to the Eloquent builder instance and return it. + * + * @return static + * @static + */ + public static function applyScopes() + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->applyScopes(); + } + + /** + * Prevent the specified relations from being eager loaded. + * + * @param mixed $relations + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function without($relations) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->without($relations); + } + + /** + * Set the relationships that should be eager loaded while removing any previously added eager loading specifications. + * + * @param mixed $relations + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function withOnly($relations) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->withOnly($relations); + } + + /** + * Create a new instance of the model being queried. + * + * @param array $attributes + * @return \Illuminate\Database\Eloquent\Model|static + * @static + */ + public static function newModelInstance($attributes = []) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->newModelInstance($attributes); + } + + /** + * Apply query-time casts to the model instance. + * + * @param array $casts + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function withCasts($casts) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->withCasts($casts); + } + + /** + * Get the underlying query builder instance. + * + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function getQuery() + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->getQuery(); + } + + /** + * Set the underlying query builder instance. + * + * @param \Illuminate\Database\Query\Builder $query + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function setQuery($query) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->setQuery($query); + } + + /** + * Get a base query builder instance. + * + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function toBase() + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->toBase(); + } + + /** + * Get the relationships being eagerly loaded. + * + * @return array + * @static + */ + public static function getEagerLoads() + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->getEagerLoads(); + } + + /** + * Set the relationships being eagerly loaded. + * + * @param array $eagerLoad + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function setEagerLoads($eagerLoad) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->setEagerLoads($eagerLoad); + } + + /** + * Get the model instance being queried. + * + * @return \Illuminate\Database\Eloquent\Model|static + * @static + */ + public static function getModel() + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->getModel(); + } + + /** + * Set a model instance for the model being queried. + * + * @param \Illuminate\Database\Eloquent\Model $model + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function setModel($model) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->setModel($model); + } + + /** + * Get the given macro by name. + * + * @param string $name + * @return \Closure + * @static + */ + public static function getMacro($name) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->getMacro($name); + } + + /** + * Checks if a macro is registered. + * + * @param string $name + * @return bool + * @static + */ + public static function hasMacro($name) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->hasMacro($name); + } + + /** + * Get the given global macro by name. + * + * @param string $name + * @return \Closure + * @static + */ + public static function getGlobalMacro($name) + { + return \Illuminate\Database\Eloquent\Builder::getGlobalMacro($name); + } + + /** + * Checks if a global macro is registered. + * + * @param string $name + * @return bool + * @static + */ + public static function hasGlobalMacro($name) + { + return \Illuminate\Database\Eloquent\Builder::hasGlobalMacro($name); + } + + /** + * Clone the Eloquent query builder. + * + * @return static + * @static + */ + public static function clone() + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->clone(); + } + + /** + * Add a relationship count / exists condition to the query. + * + * @param \Illuminate\Database\Eloquent\Relations\Relation|string $relation + * @param string $operator + * @param int $count + * @param string $boolean + * @param \Closure|null $callback + * @return \Illuminate\Database\Eloquent\Builder|static + * @throws \RuntimeException + * @static + */ + public static function has($relation, $operator = '>=', $count = 1, $boolean = 'and', $callback = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->has($relation, $operator, $count, $boolean, $callback); + } + + /** + * Add a relationship count / exists condition to the query with an "or". + * + * @param string $relation + * @param string $operator + * @param int $count + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function orHas($relation, $operator = '>=', $count = 1) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->orHas($relation, $operator, $count); + } + + /** + * Add a relationship count / exists condition to the query. + * + * @param string $relation + * @param string $boolean + * @param \Closure|null $callback + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function doesntHave($relation, $boolean = 'and', $callback = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->doesntHave($relation, $boolean, $callback); + } + + /** + * Add a relationship count / exists condition to the query with an "or". + * + * @param string $relation + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function orDoesntHave($relation) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->orDoesntHave($relation); + } + + /** + * Add a relationship count / exists condition to the query with where clauses. + * + * @param string $relation + * @param \Closure|null $callback + * @param string $operator + * @param int $count + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function whereHas($relation, $callback = null, $operator = '>=', $count = 1) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->whereHas($relation, $callback, $operator, $count); + } + + /** + * Add a relationship count / exists condition to the query with where clauses and an "or". + * + * @param string $relation + * @param \Closure|null $callback + * @param string $operator + * @param int $count + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function orWhereHas($relation, $callback = null, $operator = '>=', $count = 1) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->orWhereHas($relation, $callback, $operator, $count); + } + + /** + * Add a relationship count / exists condition to the query with where clauses. + * + * @param string $relation + * @param \Closure|null $callback + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function whereDoesntHave($relation, $callback = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->whereDoesntHave($relation, $callback); + } + + /** + * Add a relationship count / exists condition to the query with where clauses and an "or". + * + * @param string $relation + * @param \Closure|null $callback + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function orWhereDoesntHave($relation, $callback = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->orWhereDoesntHave($relation, $callback); + } + + /** + * Add a polymorphic relationship count / exists condition to the query. + * + * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation + * @param string|array $types + * @param string $operator + * @param int $count + * @param string $boolean + * @param \Closure|null $callback + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function hasMorph($relation, $types, $operator = '>=', $count = 1, $boolean = 'and', $callback = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->hasMorph($relation, $types, $operator, $count, $boolean, $callback); + } + + /** + * Add a polymorphic relationship count / exists condition to the query with an "or". + * + * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation + * @param string|array $types + * @param string $operator + * @param int $count + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function orHasMorph($relation, $types, $operator = '>=', $count = 1) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->orHasMorph($relation, $types, $operator, $count); + } + + /** + * Add a polymorphic relationship count / exists condition to the query. + * + * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation + * @param string|array $types + * @param string $boolean + * @param \Closure|null $callback + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function doesntHaveMorph($relation, $types, $boolean = 'and', $callback = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->doesntHaveMorph($relation, $types, $boolean, $callback); + } + + /** + * Add a polymorphic relationship count / exists condition to the query with an "or". + * + * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation + * @param string|array $types + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function orDoesntHaveMorph($relation, $types) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->orDoesntHaveMorph($relation, $types); + } + + /** + * Add a polymorphic relationship count / exists condition to the query with where clauses. + * + * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation + * @param string|array $types + * @param \Closure|null $callback + * @param string $operator + * @param int $count + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function whereHasMorph($relation, $types, $callback = null, $operator = '>=', $count = 1) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->whereHasMorph($relation, $types, $callback, $operator, $count); + } + + /** + * Add a polymorphic relationship count / exists condition to the query with where clauses and an "or". + * + * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation + * @param string|array $types + * @param \Closure|null $callback + * @param string $operator + * @param int $count + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function orWhereHasMorph($relation, $types, $callback = null, $operator = '>=', $count = 1) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->orWhereHasMorph($relation, $types, $callback, $operator, $count); + } + + /** + * Add a polymorphic relationship count / exists condition to the query with where clauses. + * + * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation + * @param string|array $types + * @param \Closure|null $callback + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function whereDoesntHaveMorph($relation, $types, $callback = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->whereDoesntHaveMorph($relation, $types, $callback); + } + + /** + * Add a polymorphic relationship count / exists condition to the query with where clauses and an "or". + * + * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation + * @param string|array $types + * @param \Closure|null $callback + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function orWhereDoesntHaveMorph($relation, $types, $callback = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->orWhereDoesntHaveMorph($relation, $types, $callback); + } + + /** + * Add a basic where clause to a relationship query. + * + * @param string $relation + * @param \Closure|string|array|\Illuminate\Database\Query\Expression $column + * @param mixed $operator + * @param mixed $value + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function whereRelation($relation, $column, $operator = null, $value = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->whereRelation($relation, $column, $operator, $value); + } + + /** + * Add an "or where" clause to a relationship query. + * + * @param string $relation + * @param \Closure|string|array|\Illuminate\Database\Query\Expression $column + * @param mixed $operator + * @param mixed $value + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function orWhereRelation($relation, $column, $operator = null, $value = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->orWhereRelation($relation, $column, $operator, $value); + } + + /** + * Add a polymorphic relationship condition to the query with a where clause. + * + * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation + * @param string|array $types + * @param \Closure|string|array|\Illuminate\Database\Query\Expression $column + * @param mixed $operator + * @param mixed $value + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function whereMorphRelation($relation, $types, $column, $operator = null, $value = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->whereMorphRelation($relation, $types, $column, $operator, $value); + } + + /** + * Add a polymorphic relationship condition to the query with an "or where" clause. + * + * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation + * @param string|array $types + * @param \Closure|string|array|\Illuminate\Database\Query\Expression $column + * @param mixed $operator + * @param mixed $value + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function orWhereMorphRelation($relation, $types, $column, $operator = null, $value = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->orWhereMorphRelation($relation, $types, $column, $operator, $value); + } + + /** + * Add a morph-to relationship condition to the query. + * + * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation + * @param \Illuminate\Database\Eloquent\Model|string $model + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function whereMorphedTo($relation, $model, $boolean = 'and') + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->whereMorphedTo($relation, $model, $boolean); + } + + /** + * Add a morph-to relationship condition to the query with an "or where" clause. + * + * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation + * @param \Illuminate\Database\Eloquent\Model|string $model + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function orWhereMorphedTo($relation, $model) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->orWhereMorphedTo($relation, $model); + } + + /** + * Add a "belongs to" relationship where clause to the query. + * + * @param \Illuminate\Database\Eloquent\Model $related + * @param string $relationship + * @param string $boolean + * @return \Illuminate\Database\Eloquent\Builder|static + * @throws \RuntimeException + * @static + */ + public static function whereBelongsTo($related, $relationshipName = null, $boolean = 'and') + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->whereBelongsTo($related, $relationshipName, $boolean); + } + + /** + * Add an "BelongsTo" relationship with an "or where" clause to the query. + * + * @param \Illuminate\Database\Eloquent\Model $related + * @param string $relationship + * @return \Illuminate\Database\Eloquent\Builder|static + * @throws \RuntimeException + * @static + */ + public static function orWhereBelongsTo($related, $relationshipName = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->orWhereBelongsTo($related, $relationshipName); + } + + /** + * Add subselect queries to include an aggregate value for a relationship. + * + * @param mixed $relations + * @param string $column + * @param string $function + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function withAggregate($relations, $column, $function = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->withAggregate($relations, $column, $function); + } + + /** + * Add subselect queries to count the relations. + * + * @param mixed $relations + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function withCount($relations) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->withCount($relations); + } + + /** + * Add subselect queries to include the max of the relation's column. + * + * @param string|array $relation + * @param string $column + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function withMax($relation, $column) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->withMax($relation, $column); + } + + /** + * Add subselect queries to include the min of the relation's column. + * + * @param string|array $relation + * @param string $column + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function withMin($relation, $column) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->withMin($relation, $column); + } + + /** + * Add subselect queries to include the sum of the relation's column. + * + * @param string|array $relation + * @param string $column + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function withSum($relation, $column) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->withSum($relation, $column); + } + + /** + * Add subselect queries to include the average of the relation's column. + * + * @param string|array $relation + * @param string $column + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function withAvg($relation, $column) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->withAvg($relation, $column); + } + + /** + * Add subselect queries to include the existence of related models. + * + * @param string|array $relation + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function withExists($relation) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->withExists($relation); + } + + /** + * Merge the where constraints from another query to the current query. + * + * @param \Illuminate\Database\Eloquent\Builder $from + * @return \Illuminate\Database\Eloquent\Builder|static + * @static + */ + public static function mergeConstraintsFrom($from) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->mergeConstraintsFrom($from); + } + + /** + * Chunk the results of the query. + * + * @param int $count + * @param callable $callback + * @return bool + * @static + */ + public static function chunk($count, $callback) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->chunk($count, $callback); + } + + /** + * Run a map over each item while chunking. + * + * @param callable $callback + * @param int $count + * @return \Illuminate\Support\Collection + * @static + */ + public static function chunkMap($callback, $count = 1000) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->chunkMap($callback, $count); + } + + /** + * Execute a callback over each item while chunking. + * + * @param callable $callback + * @param int $count + * @return bool + * @throws \RuntimeException + * @static + */ + public static function each($callback, $count = 1000) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->each($callback, $count); + } + + /** + * Chunk the results of a query by comparing IDs. + * + * @param int $count + * @param callable $callback + * @param string|null $column + * @param string|null $alias + * @return bool + * @static + */ + public static function chunkById($count, $callback, $column = null, $alias = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->chunkById($count, $callback, $column, $alias); + } + + /** + * Execute a callback over each item while chunking by ID. + * + * @param callable $callback + * @param int $count + * @param string|null $column + * @param string|null $alias + * @return bool + * @static + */ + public static function eachById($callback, $count = 1000, $column = null, $alias = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->eachById($callback, $count, $column, $alias); + } + + /** + * Query lazily, by chunks of the given size. + * + * @param int $chunkSize + * @return \Illuminate\Support\LazyCollection + * @throws \InvalidArgumentException + * @static + */ + public static function lazy($chunkSize = 1000) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->lazy($chunkSize); + } + + /** + * Query lazily, by chunking the results of a query by comparing IDs. + * + * @param int $chunkSize + * @param string|null $column + * @param string|null $alias + * @return \Illuminate\Support\LazyCollection + * @throws \InvalidArgumentException + * @static + */ + public static function lazyById($chunkSize = 1000, $column = null, $alias = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->lazyById($chunkSize, $column, $alias); + } + + /** + * Query lazily, by chunking the results of a query by comparing IDs in descending order. + * + * @param int $chunkSize + * @param string|null $column + * @param string|null $alias + * @return \Illuminate\Support\LazyCollection + * @throws \InvalidArgumentException + * @static + */ + public static function lazyByIdDesc($chunkSize = 1000, $column = null, $alias = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->lazyByIdDesc($chunkSize, $column, $alias); + } + + /** + * Execute the query and get the first result. + * + * @param array|string $columns + * @return \Illuminate\Database\Eloquent\Model|object|static|null + * @static + */ + public static function first($columns = []) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->first($columns); + } + + /** + * Execute the query and get the first result if it's the sole matching record. + * + * @param array|string $columns + * @return \Illuminate\Database\Eloquent\Model|object|static|null + * @throws \Illuminate\Database\RecordsNotFoundException + * @throws \Illuminate\Database\MultipleRecordsFoundException + * @static + */ + public static function baseSole($columns = []) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->baseSole($columns); + } + + /** + * Pass the query to a given callback. + * + * @param callable $callback + * @return $this|mixed + * @static + */ + public static function tap($callback) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->tap($callback); + } + + /** + * Apply the callback if the given "value" is truthy. + * + * @param mixed $value + * @param callable $callback + * @param callable|null $default + * @return $this|mixed + * @static + */ + public static function when($value, $callback, $default = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->when($value, $callback, $default); + } + + /** + * Apply the callback if the given "value" is falsy. + * + * @param mixed $value + * @param callable $callback + * @param callable|null $default + * @return $this|mixed + * @static + */ + public static function unless($value, $callback, $default = null) + { + /** @var \Illuminate\Database\Eloquent\Builder $instance */ + return $instance->unless($value, $callback, $default); + } + + /** + * Set the columns to be selected. + * + * @param array|mixed $columns + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function select($columns = []) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->select($columns); + } + + /** + * Add a subselect expression to the query. + * + * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|string $query + * @param string $as + * @return \Illuminate\Database\Query\Builder + * @throws \InvalidArgumentException + * @static + */ + public static function selectSub($query, $as) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->selectSub($query, $as); + } + + /** + * Add a new "raw" select expression to the query. + * + * @param string $expression + * @param array $bindings + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function selectRaw($expression, $bindings = []) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->selectRaw($expression, $bindings); + } + + /** + * Makes "from" fetch from a subquery. + * + * @param \Closure|\Illuminate\Database\Query\Builder|string $query + * @param string $as + * @return \Illuminate\Database\Query\Builder + * @throws \InvalidArgumentException + * @static + */ + public static function fromSub($query, $as) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->fromSub($query, $as); + } + + /** + * Add a raw from clause to the query. + * + * @param string $expression + * @param mixed $bindings + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function fromRaw($expression, $bindings = []) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->fromRaw($expression, $bindings); + } + + /** + * Add a new select column to the query. + * + * @param array|mixed $column + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function addSelect($column) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->addSelect($column); + } + + /** + * Force the query to only return distinct results. + * + * @param mixed $distinct + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function distinct() + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->distinct(); + } + + /** + * Set the table which the query is targeting. + * + * @param \Closure|\Illuminate\Database\Query\Builder|string $table + * @param string|null $as + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function from($table, $as = null) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->from($table, $as); + } + + /** + * Add a join clause to the query. + * + * @param string $table + * @param \Closure|string $first + * @param string|null $operator + * @param string|null $second + * @param string $type + * @param bool $where + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function join($table, $first, $operator = null, $second = null, $type = 'inner', $where = false) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->join($table, $first, $operator, $second, $type, $where); + } + + /** + * Add a "join where" clause to the query. + * + * @param string $table + * @param \Closure|string $first + * @param string $operator + * @param string $second + * @param string $type + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function joinWhere($table, $first, $operator, $second, $type = 'inner') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->joinWhere($table, $first, $operator, $second, $type); + } + + /** + * Add a subquery join clause to the query. + * + * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|string $query + * @param string $as + * @param \Closure|string $first + * @param string|null $operator + * @param string|null $second + * @param string $type + * @param bool $where + * @return \Illuminate\Database\Query\Builder + * @throws \InvalidArgumentException + * @static + */ + public static function joinSub($query, $as, $first, $operator = null, $second = null, $type = 'inner', $where = false) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->joinSub($query, $as, $first, $operator, $second, $type, $where); + } + + /** + * Add a left join to the query. + * + * @param string $table + * @param \Closure|string $first + * @param string|null $operator + * @param string|null $second + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function leftJoin($table, $first, $operator = null, $second = null) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->leftJoin($table, $first, $operator, $second); + } + + /** + * Add a "join where" clause to the query. + * + * @param string $table + * @param \Closure|string $first + * @param string $operator + * @param string $second + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function leftJoinWhere($table, $first, $operator, $second) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->leftJoinWhere($table, $first, $operator, $second); + } + + /** + * Add a subquery left join to the query. + * + * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|string $query + * @param string $as + * @param \Closure|string $first + * @param string|null $operator + * @param string|null $second + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function leftJoinSub($query, $as, $first, $operator = null, $second = null) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->leftJoinSub($query, $as, $first, $operator, $second); + } + + /** + * Add a right join to the query. + * + * @param string $table + * @param \Closure|string $first + * @param string|null $operator + * @param string|null $second + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function rightJoin($table, $first, $operator = null, $second = null) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->rightJoin($table, $first, $operator, $second); + } + + /** + * Add a "right join where" clause to the query. + * + * @param string $table + * @param \Closure|string $first + * @param string $operator + * @param string $second + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function rightJoinWhere($table, $first, $operator, $second) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->rightJoinWhere($table, $first, $operator, $second); + } + + /** + * Add a subquery right join to the query. + * + * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|string $query + * @param string $as + * @param \Closure|string $first + * @param string|null $operator + * @param string|null $second + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function rightJoinSub($query, $as, $first, $operator = null, $second = null) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->rightJoinSub($query, $as, $first, $operator, $second); + } + + /** + * Add a "cross join" clause to the query. + * + * @param string $table + * @param \Closure|string|null $first + * @param string|null $operator + * @param string|null $second + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function crossJoin($table, $first = null, $operator = null, $second = null) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->crossJoin($table, $first, $operator, $second); + } + + /** + * Add a subquery cross join to the query. + * + * @param \Closure|\Illuminate\Database\Query\Builder|string $query + * @param string $as + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function crossJoinSub($query, $as) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->crossJoinSub($query, $as); + } + + /** + * Merge an array of where clauses and bindings. + * + * @param array $wheres + * @param array $bindings + * @return void + * @static + */ + public static function mergeWheres($wheres, $bindings) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + $instance->mergeWheres($wheres, $bindings); + } + + /** + * Prepare the value and operator for a where clause. + * + * @param string $value + * @param string $operator + * @param bool $useDefault + * @return array + * @throws \InvalidArgumentException + * @static + */ + public static function prepareValueAndOperator($value, $operator, $useDefault = false) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->prepareValueAndOperator($value, $operator, $useDefault); + } + + /** + * Add a "where" clause comparing two columns to the query. + * + * @param string|array $first + * @param string|null $operator + * @param string|null $second + * @param string|null $boolean + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function whereColumn($first, $operator = null, $second = null, $boolean = 'and') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereColumn($first, $operator, $second, $boolean); + } + + /** + * Add an "or where" clause comparing two columns to the query. + * + * @param string|array $first + * @param string|null $operator + * @param string|null $second + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orWhereColumn($first, $operator = null, $second = null) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereColumn($first, $operator, $second); + } + + /** + * Add a raw where clause to the query. + * + * @param string $sql + * @param mixed $bindings + * @param string $boolean + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function whereRaw($sql, $bindings = [], $boolean = 'and') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereRaw($sql, $bindings, $boolean); + } + + /** + * Add a raw or where clause to the query. + * + * @param string $sql + * @param mixed $bindings + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orWhereRaw($sql, $bindings = []) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereRaw($sql, $bindings); + } + + /** + * Add a "where in" clause to the query. + * + * @param string $column + * @param mixed $values + * @param string $boolean + * @param bool $not + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function whereIn($column, $values, $boolean = 'and', $not = false) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereIn($column, $values, $boolean, $not); + } + + /** + * Add an "or where in" clause to the query. + * + * @param string $column + * @param mixed $values + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orWhereIn($column, $values) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereIn($column, $values); + } + + /** + * Add a "where not in" clause to the query. + * + * @param string $column + * @param mixed $values + * @param string $boolean + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function whereNotIn($column, $values, $boolean = 'and') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereNotIn($column, $values, $boolean); + } + + /** + * Add an "or where not in" clause to the query. + * + * @param string $column + * @param mixed $values + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orWhereNotIn($column, $values) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereNotIn($column, $values); + } + + /** + * Add a "where in raw" clause for integer values to the query. + * + * @param string $column + * @param \Illuminate\Contracts\Support\Arrayable|array $values + * @param string $boolean + * @param bool $not + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function whereIntegerInRaw($column, $values, $boolean = 'and', $not = false) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereIntegerInRaw($column, $values, $boolean, $not); + } + + /** + * Add an "or where in raw" clause for integer values to the query. + * + * @param string $column + * @param \Illuminate\Contracts\Support\Arrayable|array $values + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orWhereIntegerInRaw($column, $values) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereIntegerInRaw($column, $values); + } + + /** + * Add a "where not in raw" clause for integer values to the query. + * + * @param string $column + * @param \Illuminate\Contracts\Support\Arrayable|array $values + * @param string $boolean + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function whereIntegerNotInRaw($column, $values, $boolean = 'and') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereIntegerNotInRaw($column, $values, $boolean); + } + + /** + * Add an "or where not in raw" clause for integer values to the query. + * + * @param string $column + * @param \Illuminate\Contracts\Support\Arrayable|array $values + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orWhereIntegerNotInRaw($column, $values) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereIntegerNotInRaw($column, $values); + } + + /** + * Add a "where null" clause to the query. + * + * @param string|array $columns + * @param string $boolean + * @param bool $not + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function whereNull($columns, $boolean = 'and', $not = false) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereNull($columns, $boolean, $not); + } + + /** + * Add an "or where null" clause to the query. + * + * @param string|array $column + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orWhereNull($column) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereNull($column); + } + + /** + * Add a "where not null" clause to the query. + * + * @param string|array $columns + * @param string $boolean + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function whereNotNull($columns, $boolean = 'and') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereNotNull($columns, $boolean); + } + + /** + * Add a where between statement to the query. + * + * @param string|\Illuminate\Database\Query\Expression $column + * @param array $values + * @param string $boolean + * @param bool $not + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function whereBetween($column, $values, $boolean = 'and', $not = false) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereBetween($column, $values, $boolean, $not); + } + + /** + * Add a where between statement using columns to the query. + * + * @param string $column + * @param array $values + * @param string $boolean + * @param bool $not + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function whereBetweenColumns($column, $values, $boolean = 'and', $not = false) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereBetweenColumns($column, $values, $boolean, $not); + } + + /** + * Add an or where between statement to the query. + * + * @param string $column + * @param array $values + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orWhereBetween($column, $values) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereBetween($column, $values); + } + + /** + * Add an or where between statement using columns to the query. + * + * @param string $column + * @param array $values + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orWhereBetweenColumns($column, $values) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereBetweenColumns($column, $values); + } + + /** + * Add a where not between statement to the query. + * + * @param string $column + * @param array $values + * @param string $boolean + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function whereNotBetween($column, $values, $boolean = 'and') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereNotBetween($column, $values, $boolean); + } + + /** + * Add a where not between statement using columns to the query. + * + * @param string $column + * @param array $values + * @param string $boolean + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function whereNotBetweenColumns($column, $values, $boolean = 'and') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereNotBetweenColumns($column, $values, $boolean); + } + + /** + * Add an or where not between statement to the query. + * + * @param string $column + * @param array $values + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orWhereNotBetween($column, $values) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereNotBetween($column, $values); + } + + /** + * Add an or where not between statement using columns to the query. + * + * @param string $column + * @param array $values + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orWhereNotBetweenColumns($column, $values) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereNotBetweenColumns($column, $values); + } + + /** + * Add an "or where not null" clause to the query. + * + * @param string $column + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orWhereNotNull($column) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereNotNull($column); + } + + /** + * Add a "where date" statement to the query. + * + * @param \Illuminate\Database\Query\Expression|string $column + * @param string $operator + * @param \DateTimeInterface|string|null $value + * @param string $boolean + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function whereDate($column, $operator, $value = null, $boolean = 'and') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereDate($column, $operator, $value, $boolean); + } + + /** + * Add an "or where date" statement to the query. + * + * @param string $column + * @param string $operator + * @param \DateTimeInterface|string|null $value + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orWhereDate($column, $operator, $value = null) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereDate($column, $operator, $value); + } + + /** + * Add a "where time" statement to the query. + * + * @param string $column + * @param string $operator + * @param \DateTimeInterface|string|null $value + * @param string $boolean + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function whereTime($column, $operator, $value = null, $boolean = 'and') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereTime($column, $operator, $value, $boolean); + } + + /** + * Add an "or where time" statement to the query. + * + * @param string $column + * @param string $operator + * @param \DateTimeInterface|string|null $value + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orWhereTime($column, $operator, $value = null) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereTime($column, $operator, $value); + } + + /** + * Add a "where day" statement to the query. + * + * @param string $column + * @param string $operator + * @param \DateTimeInterface|string|null $value + * @param string $boolean + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function whereDay($column, $operator, $value = null, $boolean = 'and') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereDay($column, $operator, $value, $boolean); + } + + /** + * Add an "or where day" statement to the query. + * + * @param string $column + * @param string $operator + * @param \DateTimeInterface|string|null $value + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orWhereDay($column, $operator, $value = null) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereDay($column, $operator, $value); + } + + /** + * Add a "where month" statement to the query. + * + * @param string $column + * @param string $operator + * @param \DateTimeInterface|string|null $value + * @param string $boolean + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function whereMonth($column, $operator, $value = null, $boolean = 'and') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereMonth($column, $operator, $value, $boolean); + } + + /** + * Add an "or where month" statement to the query. + * + * @param string $column + * @param string $operator + * @param \DateTimeInterface|string|null $value + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orWhereMonth($column, $operator, $value = null) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereMonth($column, $operator, $value); + } + + /** + * Add a "where year" statement to the query. + * + * @param string $column + * @param string $operator + * @param \DateTimeInterface|string|int|null $value + * @param string $boolean + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function whereYear($column, $operator, $value = null, $boolean = 'and') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereYear($column, $operator, $value, $boolean); + } + + /** + * Add an "or where year" statement to the query. + * + * @param string $column + * @param string $operator + * @param \DateTimeInterface|string|int|null $value + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orWhereYear($column, $operator, $value = null) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereYear($column, $operator, $value); + } + + /** + * Add a nested where statement to the query. + * + * @param \Closure $callback + * @param string $boolean + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function whereNested($callback, $boolean = 'and') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereNested($callback, $boolean); + } + + /** + * Create a new query instance for nested where condition. + * + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function forNestedWhere() + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->forNestedWhere(); + } + + /** + * Add another query builder as a nested where to the query builder. + * + * @param \Illuminate\Database\Query\Builder $query + * @param string $boolean + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function addNestedWhereQuery($query, $boolean = 'and') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->addNestedWhereQuery($query, $boolean); + } + + /** + * Add an exists clause to the query. + * + * @param \Closure $callback + * @param string $boolean + * @param bool $not + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function whereExists($callback, $boolean = 'and', $not = false) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereExists($callback, $boolean, $not); + } + + /** + * Add an or exists clause to the query. + * + * @param \Closure $callback + * @param bool $not + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orWhereExists($callback, $not = false) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereExists($callback, $not); + } + + /** + * Add a where not exists clause to the query. + * + * @param \Closure $callback + * @param string $boolean + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function whereNotExists($callback, $boolean = 'and') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereNotExists($callback, $boolean); + } + + /** + * Add a where not exists clause to the query. + * + * @param \Closure $callback + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orWhereNotExists($callback) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereNotExists($callback); + } + + /** + * Add an exists clause to the query. + * + * @param \Illuminate\Database\Query\Builder $query + * @param string $boolean + * @param bool $not + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function addWhereExistsQuery($query, $boolean = 'and', $not = false) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->addWhereExistsQuery($query, $boolean, $not); + } + + /** + * Adds a where condition using row values. + * + * @param array $columns + * @param string $operator + * @param array $values + * @param string $boolean + * @return \Illuminate\Database\Query\Builder + * @throws \InvalidArgumentException + * @static + */ + public static function whereRowValues($columns, $operator, $values, $boolean = 'and') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereRowValues($columns, $operator, $values, $boolean); + } + + /** + * Adds an or where condition using row values. + * + * @param array $columns + * @param string $operator + * @param array $values + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orWhereRowValues($columns, $operator, $values) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereRowValues($columns, $operator, $values); + } + + /** + * Add a "where JSON contains" clause to the query. + * + * @param string $column + * @param mixed $value + * @param string $boolean + * @param bool $not + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function whereJsonContains($column, $value, $boolean = 'and', $not = false) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereJsonContains($column, $value, $boolean, $not); + } + + /** + * Add an "or where JSON contains" clause to the query. + * + * @param string $column + * @param mixed $value + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orWhereJsonContains($column, $value) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereJsonContains($column, $value); + } + + /** + * Add a "where JSON not contains" clause to the query. + * + * @param string $column + * @param mixed $value + * @param string $boolean + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function whereJsonDoesntContain($column, $value, $boolean = 'and') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereJsonDoesntContain($column, $value, $boolean); + } + + /** + * Add an "or where JSON not contains" clause to the query. + * + * @param string $column + * @param mixed $value + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orWhereJsonDoesntContain($column, $value) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereJsonDoesntContain($column, $value); + } + + /** + * Add a "where JSON length" clause to the query. + * + * @param string $column + * @param mixed $operator + * @param mixed $value + * @param string $boolean + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function whereJsonLength($column, $operator, $value = null, $boolean = 'and') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereJsonLength($column, $operator, $value, $boolean); + } + + /** + * Add an "or where JSON length" clause to the query. + * + * @param string $column + * @param mixed $operator + * @param mixed $value + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orWhereJsonLength($column, $operator, $value = null) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereJsonLength($column, $operator, $value); + } + + /** + * Handles dynamic "where" clauses to the query. + * + * @param string $method + * @param array $parameters + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function dynamicWhere($method, $parameters) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->dynamicWhere($method, $parameters); + } + + /** + * Add a "where fulltext" clause to the query. + * + * @param string|string[] $columns + * @param string $value + * @param string $boolean + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function whereFullText($columns, $value, $options = [], $boolean = 'and') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereFullText($columns, $value, $options, $boolean); + } + + /** + * Add a "or where fulltext" clause to the query. + * + * @param string|string[] $columns + * @param string $value + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orWhereFullText($columns, $value, $options = []) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereFullText($columns, $value, $options); + } + + /** + * Add a "group by" clause to the query. + * + * @param array|string $groups + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function groupBy(...$groups) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->groupBy(...$groups); + } + + /** + * Add a raw groupBy clause to the query. + * + * @param string $sql + * @param array $bindings + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function groupByRaw($sql, $bindings = []) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->groupByRaw($sql, $bindings); + } + + /** + * Add a "having" clause to the query. + * + * @param string $column + * @param string|null $operator + * @param string|null $value + * @param string $boolean + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function having($column, $operator = null, $value = null, $boolean = 'and') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->having($column, $operator, $value, $boolean); + } + + /** + * Add an "or having" clause to the query. + * + * @param string $column + * @param string|null $operator + * @param string|null $value + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orHaving($column, $operator = null, $value = null) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orHaving($column, $operator, $value); + } + + /** + * Add a "having between " clause to the query. + * + * @param string $column + * @param array $values + * @param string $boolean + * @param bool $not + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function havingBetween($column, $values, $boolean = 'and', $not = false) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->havingBetween($column, $values, $boolean, $not); + } + + /** + * Add a raw having clause to the query. + * + * @param string $sql + * @param array $bindings + * @param string $boolean + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function havingRaw($sql, $bindings = [], $boolean = 'and') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->havingRaw($sql, $bindings, $boolean); + } + + /** + * Add a raw or having clause to the query. + * + * @param string $sql + * @param array $bindings + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orHavingRaw($sql, $bindings = []) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orHavingRaw($sql, $bindings); + } + + /** + * Add an "order by" clause to the query. + * + * @param \Closure|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder|\Illuminate\Database\Query\Expression|string $column + * @param string $direction + * @return \Illuminate\Database\Query\Builder + * @throws \InvalidArgumentException + * @static + */ + public static function orderBy($column, $direction = 'asc') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orderBy($column, $direction); + } + + /** + * Add a descending "order by" clause to the query. + * + * @param \Closure|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder|\Illuminate\Database\Query\Expression|string $column + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orderByDesc($column) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orderByDesc($column); + } + + /** + * Put the query's results in random order. + * + * @param string $seed + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function inRandomOrder($seed = '') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->inRandomOrder($seed); + } + + /** + * Add a raw "order by" clause to the query. + * + * @param string $sql + * @param array $bindings + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function orderByRaw($sql, $bindings = []) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orderByRaw($sql, $bindings); + } + + /** + * Alias to set the "offset" value of the query. + * + * @param int $value + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function skip($value) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->skip($value); + } + + /** + * Set the "offset" value of the query. + * + * @param int $value + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function offset($value) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->offset($value); + } + + /** + * Alias to set the "limit" value of the query. + * + * @param int $value + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function take($value) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->take($value); + } + + /** + * Set the "limit" value of the query. + * + * @param int $value + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function limit($value) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->limit($value); + } + + /** + * Set the limit and offset for a given page. + * + * @param int $page + * @param int $perPage + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function forPage($page, $perPage = 15) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->forPage($page, $perPage); + } + + /** + * Constrain the query to the previous "page" of results before a given ID. + * + * @param int $perPage + * @param int|null $lastId + * @param string $column + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function forPageBeforeId($perPage = 15, $lastId = 0, $column = 'id') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->forPageBeforeId($perPage, $lastId, $column); + } + + /** + * Constrain the query to the next "page" of results after a given ID. + * + * @param int $perPage + * @param int|null $lastId + * @param string $column + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function forPageAfterId($perPage = 15, $lastId = 0, $column = 'id') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->forPageAfterId($perPage, $lastId, $column); + } + + /** + * Remove all existing orders and optionally add a new order. + * + * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Query\Expression|string|null $column + * @param string $direction + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function reorder($column = null, $direction = 'asc') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->reorder($column, $direction); + } + + /** + * Add a union statement to the query. + * + * @param \Illuminate\Database\Query\Builder|\Closure $query + * @param bool $all + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function union($query, $all = false) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->union($query, $all); + } + + /** + * Add a union all statement to the query. + * + * @param \Illuminate\Database\Query\Builder|\Closure $query + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function unionAll($query) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->unionAll($query); + } + + /** + * Lock the selected rows in the table. + * + * @param string|bool $value + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function lock($value = true) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->lock($value); + } + + /** + * Lock the selected rows in the table for updating. + * + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function lockForUpdate() + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->lockForUpdate(); + } + + /** + * Share lock the selected rows in the table. + * + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function sharedLock() + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->sharedLock(); + } + + /** + * Register a closure to be invoked before the query is executed. + * + * @param callable $callback + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function beforeQuery($callback) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->beforeQuery($callback); + } + + /** + * Invoke the "before query" modification callbacks. + * + * @return void + * @static + */ + public static function applyBeforeQueryCallbacks() + { + /** @var \Illuminate\Database\Query\Builder $instance */ + $instance->applyBeforeQueryCallbacks(); + } + + /** + * Get the SQL representation of the query. + * + * @return string + * @static + */ + public static function toSql() + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->toSql(); + } + + /** + * Get the count of the total records for the paginator. + * + * @param array $columns + * @return int + * @static + */ + public static function getCountForPagination($columns = []) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->getCountForPagination($columns); + } + + /** + * Concatenate values of a given column as a string. + * + * @param string $column + * @param string $glue + * @return string + * @static + */ + public static function implode($column, $glue = '') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->implode($column, $glue); + } + + /** + * Determine if any rows exist for the current query. + * + * @return bool + * @static + */ + public static function exists() + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->exists(); + } + + /** + * Determine if no rows exist for the current query. + * + * @return bool + * @static + */ + public static function doesntExist() + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->doesntExist(); + } + + /** + * Execute the given callback if no rows exist for the current query. + * + * @param \Closure $callback + * @return mixed + * @static + */ + public static function existsOr($callback) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->existsOr($callback); + } + + /** + * Execute the given callback if rows exist for the current query. + * + * @param \Closure $callback + * @return mixed + * @static + */ + public static function doesntExistOr($callback) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->doesntExistOr($callback); + } + + /** + * Retrieve the "count" result of the query. + * + * @param string $columns + * @return int + * @static + */ + public static function count($columns = '*') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->count($columns); + } + + /** + * Retrieve the minimum value of a given column. + * + * @param string $column + * @return mixed + * @static + */ + public static function min($column) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->min($column); + } + + /** + * Retrieve the maximum value of a given column. + * + * @param string $column + * @return mixed + * @static + */ + public static function max($column) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->max($column); + } + + /** + * Retrieve the sum of the values of a given column. + * + * @param string $column + * @return mixed + * @static + */ + public static function sum($column) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->sum($column); + } + + /** + * Retrieve the average of the values of a given column. + * + * @param string $column + * @return mixed + * @static + */ + public static function avg($column) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->avg($column); + } + + /** + * Alias for the "avg" method. + * + * @param string $column + * @return mixed + * @static + */ + public static function average($column) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->average($column); + } + + /** + * Execute an aggregate function on the database. + * + * @param string $function + * @param array $columns + * @return mixed + * @static + */ + public static function aggregate($function, $columns = []) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->aggregate($function, $columns); + } + + /** + * Execute a numeric aggregate function on the database. + * + * @param string $function + * @param array $columns + * @return float|int + * @static + */ + public static function numericAggregate($function, $columns = []) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->numericAggregate($function, $columns); + } + + /** + * Insert new records into the database. + * + * @param array $values + * @return bool + * @static + */ + public static function insert($values) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->insert($values); + } + + /** + * Insert new records into the database while ignoring errors. + * + * @param array $values + * @return int + * @static + */ + public static function insertOrIgnore($values) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->insertOrIgnore($values); + } + + /** + * Insert a new record and get the value of the primary key. + * + * @param array $values + * @param string|null $sequence + * @return int + * @static + */ + public static function insertGetId($values, $sequence = null) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->insertGetId($values, $sequence); + } + + /** + * Insert new records into the table using a subquery. + * + * @param array $columns + * @param \Closure|\Illuminate\Database\Query\Builder|string $query + * @return int + * @static + */ + public static function insertUsing($columns, $query) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->insertUsing($columns, $query); + } + + /** + * Update records in a PostgreSQL database using the update from syntax. + * + * @param array $values + * @return int + * @static + */ + public static function updateFrom($values) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->updateFrom($values); + } + + /** + * Insert or update a record matching the attributes, and fill it with values. + * + * @param array $attributes + * @param array $values + * @return bool + * @static + */ + public static function updateOrInsert($attributes, $values = []) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->updateOrInsert($attributes, $values); + } + + /** + * Run a truncate statement on the table. + * + * @return void + * @static + */ + public static function truncate() + { + /** @var \Illuminate\Database\Query\Builder $instance */ + $instance->truncate(); + } + + /** + * Create a raw database expression. + * + * @param mixed $value + * @return \Illuminate\Database\Query\Expression + * @static + */ + public static function raw($value) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->raw($value); + } + + /** + * Get the current query value bindings in a flattened array. + * + * @return array + * @static + */ + public static function getBindings() + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->getBindings(); + } + + /** + * Get the raw array of bindings. + * + * @return array + * @static + */ + public static function getRawBindings() + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->getRawBindings(); + } + + /** + * Set the bindings on the query builder. + * + * @param array $bindings + * @param string $type + * @return \Illuminate\Database\Query\Builder + * @throws \InvalidArgumentException + * @static + */ + public static function setBindings($bindings, $type = 'where') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->setBindings($bindings, $type); + } + + /** + * Add a binding to the query. + * + * @param mixed $value + * @param string $type + * @return \Illuminate\Database\Query\Builder + * @throws \InvalidArgumentException + * @static + */ + public static function addBinding($value, $type = 'where') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->addBinding($value, $type); + } + + /** + * Cast the given binding value. + * + * @param mixed $value + * @return mixed + * @static + */ + public static function castBinding($value) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->castBinding($value); + } + + /** + * Merge an array of bindings into our bindings. + * + * @param \Illuminate\Database\Query\Builder $query + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function mergeBindings($query) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->mergeBindings($query); + } + + /** + * Remove all of the expressions from a list of bindings. + * + * @param array $bindings + * @return array + * @static + */ + public static function cleanBindings($bindings) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->cleanBindings($bindings); + } + + /** + * Get the database query processor instance. + * + * @return \Illuminate\Database\Query\Processors\Processor + * @static + */ + public static function getProcessor() + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->getProcessor(); + } + + /** + * Get the query grammar instance. + * + * @return \Illuminate\Database\Query\Grammars\Grammar + * @static + */ + public static function getGrammar() + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->getGrammar(); + } + + /** + * Use the write pdo for query. + * + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function useWritePdo() + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->useWritePdo(); + } + + /** + * Clone the query without the given properties. + * + * @param array $properties + * @return static + * @static + */ + public static function cloneWithout($properties) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->cloneWithout($properties); + } + + /** + * Clone the query without the given bindings. + * + * @param array $except + * @return static + * @static + */ + public static function cloneWithoutBindings($except) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->cloneWithoutBindings($except); + } + + /** + * Dump the current SQL and bindings. + * + * @return \Illuminate\Database\Query\Builder + * @static + */ + public static function dump() + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->dump(); + } + + /** + * Die and dump the current SQL and bindings. + * + * @return \Illuminate\Database\Query\never + * @static + */ + public static function dd() + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->dd(); + } + + /** + * Explains the query. + * + * @return \Illuminate\Support\Collection + * @static + */ + public static function explain() + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->explain(); + } + + /** + * Register a custom macro. + * + * @param string $name + * @param object|callable $macro + * @return void + * @static + */ + public static function macro($name, $macro) + { + \Illuminate\Database\Query\Builder::macro($name, $macro); + } + + /** + * Mix another object into the class. + * + * @param object $mixin + * @param bool $replace + * @return void + * @throws \ReflectionException + * @static + */ + public static function mixin($mixin, $replace = true) + { + \Illuminate\Database\Query\Builder::mixin($mixin, $replace); + } + + /** + * Flush the existing macros. + * + * @return void + * @static + */ + public static function flushMacros() + { + \Illuminate\Database\Query\Builder::flushMacros(); + } + + /** + * Dynamically handle calls to the class. + * + * @param string $method + * @param array $parameters + * @return mixed + * @throws \BadMethodCallException + * @static + */ + public static function macroCall($method, $parameters) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->macroCall($method, $parameters); + } + } + class Event extends \Illuminate\Support\Facades\Event {} + class File extends \Illuminate\Support\Facades\File {} + class Form extends \Collective\Html\FormFacade {} + class Gate extends \Illuminate\Support\Facades\Gate {} + class Hash extends \Illuminate\Support\Facades\Hash {} + class Html extends \Collective\Html\HtmlFacade {} + class Http extends \Illuminate\Support\Facades\Http {} + class Lang extends \Illuminate\Support\Facades\Lang {} + class Log extends \Illuminate\Support\Facades\Log {} + class Mail extends \Illuminate\Support\Facades\Mail {} + class Notification extends \Illuminate\Support\Facades\Notification {} + class Password extends \Illuminate\Support\Facades\Password {} + class Queue extends \Illuminate\Support\Facades\Queue {} + class Redirect extends \Illuminate\Support\Facades\Redirect {} + class Request extends \Illuminate\Support\Facades\Request {} + class Response extends \Illuminate\Support\Facades\Response {} + class Route extends \Illuminate\Support\Facades\Route {} + class Schema extends \Illuminate\Support\Facades\Schema {} + class Session extends \Illuminate\Support\Facades\Session {} + class Storage extends \Illuminate\Support\Facades\Storage {} + class Str extends \Illuminate\Support\Str {} + class URL extends \Illuminate\Support\Facades\URL {} + class Validator extends \Illuminate\Support\Facades\Validator {} + class View extends \Illuminate\Support\Facades\View {} + class Yaml extends \Symfony\Component\Yaml\Yaml {} + class SupportedApps extends \App\SupportedApps {} + interface EnhancedApps extends \App\EnhancedApps {} + class Flare extends \Facade\Ignition\Facades\Flare {} + +} + + + + diff --git a/app/Application.php b/app/Application.php index b92edc86..6b11075d 100644 --- a/app/Application.php +++ b/app/Application.php @@ -3,9 +3,42 @@ namespace App; use GuzzleHttp\Exception\GuzzleException; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; +/** + * App\Application + * + * @property string $appid + * @property string $name + * @property string|null $sha + * @property string|null $icon + * @property string|null $website + * @property string|null $license + * @property string|null $description + * @property int $enhanced + * @property string $tile_background + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property string|null $class + * @method static Builder|Application newModelQuery() + * @method static Builder|Application newQuery() + * @method static Builder|Application query() + * @method static Builder|Application whereAppid($value) + * @method static Builder|Application whereClass($value) + * @method static Builder|Application whereCreatedAt($value) + * @method static Builder|Application whereDescription($value) + * @method static Builder|Application whereEnhanced($value) + * @method static Builder|Application whereIcon($value) + * @method static Builder|Application whereLicense($value) + * @method static Builder|Application whereName($value) + * @method static Builder|Application whereSha($value) + * @method static Builder|Application whereTileBackground($value) + * @method static Builder|Application whereUpdatedAt($value) + * @method static Builder|Application whereWebsite($value) + */ class Application extends Model { /** @@ -79,9 +112,9 @@ class Application extends Model } /** - * @return \Illuminate\Support\Collection + * @return Collection */ - public static function apps(): \Illuminate\Support\Collection + public static function apps(): Collection { $json = json_decode(file_get_contents(storage_path('app/supportedapps.json'))) ?? []; $apps = collect($json->apps); diff --git a/app/Console/Commands/RegisterApp.php b/app/Console/Commands/RegisterApp.php index 8da87600..37f13461 100644 --- a/app/Console/Commands/RegisterApp.php +++ b/app/Console/Commands/RegisterApp.php @@ -36,7 +36,7 @@ class RegisterApp extends Command /** * Execute the console command. * - * @return mixed + * @return void */ public function handle() { diff --git a/app/Http/Controllers/ItemController.php b/app/Http/Controllers/ItemController.php index 2b62e9f2..fd705b0b 100644 --- a/app/Http/Controllers/ItemController.php +++ b/app/Http/Controllers/ItemController.php @@ -6,18 +6,20 @@ use App\Application; use App\Item; use App\Jobs\ProcessApps; use App\User; -use Artisan; use GuzzleHttp\Client; use GuzzleHttp\Exception\ConnectException; use GuzzleHttp\Exception\GuzzleException; use GuzzleHttp\Exception\ServerException; use Illuminate\Contracts\View\View; -use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Collection; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; +use Illuminate\Routing\Redirector; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\URL; +use Psr\Http\Message\ResponseInterface; +use Psr\Http\Message\StreamInterface; class ItemController extends Controller { @@ -105,11 +107,11 @@ class ItemController extends Controller $new = !(((bool)$item->pinned === true)); $item->pinned = $new; $item->save(); - if ($ajax) { + if ($ajax) { $item = Item::whereId($tag)->first(); - $data['apps'] = new \Illuminate\Database\Eloquent\Collection; + $data['apps'] = new Collection; if ((int)$tag === 0) { $tags = Item::where('type', 1)->pinned()->orderBy('order', 'asc')->get(); @@ -133,9 +135,10 @@ class ItemController extends Controller /** * Display a listing of the resource. * + * @param Request $request * @return View */ - public function index(Request $request) + public function index(Request $request): View { $trash = (bool) $request->input('trash'); @@ -411,6 +414,10 @@ class ItemController extends Controller return json_encode($output); } + /** + * @param Request $request + * @return void + */ public function testConfig(Request $request) { $data = $request->input('data'); @@ -419,8 +426,7 @@ class ItemController extends Controller $app = $single->class; // If password is not resubmitted fill it from the database when in edit mode - if ( - array_key_exists('password', $data) && + if (array_key_exists('password', $data) && $data['password'] === null && array_key_exists('id', $data) ) { @@ -436,10 +442,15 @@ class ItemController extends Controller $app_details->test(); } - public function execute($url, $attrs = [], $overridevars = false) + /** + * @param $url + * @param array $attrs + * @param array|bool $overridevars + * @return ResponseInterface|null + * @throws GuzzleException + */ + public function execute($url, array $attrs = [], $overridevars = false): ?ResponseInterface { - $res = null; - $vars = ($overridevars !== false) ? $overridevars : [ 'http_errors' => false, @@ -461,10 +472,15 @@ class ItemController extends Controller Log::debug($e->getMessage()); } - return $res; + return null; } - public function websitelookup($url) + /** + * @param $url + * @return StreamInterface + * @throws GuzzleException + */ + public function websitelookup($url): StreamInterface { $url = base64_decode($url); $data = $this->execute($url); @@ -472,6 +488,10 @@ class ItemController extends Controller return $data->getBody(); } + /** + * @param $id + * @return void + */ public function getStats($id) { $item = Item::find($id); @@ -484,6 +504,9 @@ class ItemController extends Controller } } + /** + * @return \Illuminate\Contracts\Foundation\Application|RedirectResponse|Redirector + */ public function checkAppList() { ProcessApps::dispatch(); diff --git a/app/Http/Controllers/ItemRestController.php b/app/Http/Controllers/ItemRestController.php index be0353a4..b1a93317 100644 --- a/app/Http/Controllers/ItemRestController.php +++ b/app/Http/Controllers/ItemRestController.php @@ -5,6 +5,7 @@ namespace App\Http\Controllers; use App\Item; use Illuminate\Http\Request; use Illuminate\Http\Response; +use Illuminate\Support\Collection; class ItemRestController extends Controller { @@ -17,7 +18,7 @@ class ItemRestController extends Controller /** * Display a listing of the resource. * - * @return Response + * @return Collection */ public function index() { diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index 8507b62a..2ffc5923 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -3,10 +3,17 @@ namespace App\Http\Controllers; use App\Search; +use Illuminate\Contracts\Foundation\Application; +use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; +use Illuminate\Routing\Redirector; class SearchController extends Controller { + /** + * @param Request $request + * @return Application|RedirectResponse|Redirector|mixed|void + */ public function index(Request $request) { $requestprovider = $request->input('provider'); diff --git a/app/Http/Middleware/CheckAllowed.php b/app/Http/Middleware/CheckAllowed.php index 5b3d2bc5..3ecdd53d 100644 --- a/app/Http/Middleware/CheckAllowed.php +++ b/app/Http/Middleware/CheckAllowed.php @@ -4,6 +4,7 @@ namespace App\Http\Middleware; use App\User; use Closure; +use Illuminate\Auth\AuthenticationException; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Route; @@ -17,6 +18,7 @@ class CheckAllowed * @param Request $request * @param Closure $next * @return mixed + * @throws AuthenticationException */ public function handle(Request $request, Closure $next) { diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index 1f9e98f5..153bec91 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -11,12 +11,12 @@ class RedirectIfAuthenticated /** * Handle an incoming request. * - * @param Request $request + * @param Request $request * @param Closure $next - * @param string|null $guard + * @param string|null $guard * @return mixed */ - public function handle($request, Closure $next, $guard = null) + public function handle(Request $request, Closure $next, string $guard = null) { if (Auth::guard($guard)->check()) { return redirect()->intended(); diff --git a/app/Item.php b/app/Item.php index 82277b67..87c9dfde 100644 --- a/app/Item.php +++ b/app/Item.php @@ -12,6 +12,62 @@ use Illuminate\Database\Eloquent\SoftDeletes; use stdClass; use Symfony\Component\ClassLoader\ClassMapGenerator; +/** + * App\Item + * + * @property int $id + * @property string $title + * @property string|null $colour + * @property string|null $icon + * @property string $url + * @property string|null $description + * @property int $pinned + * @property int $order + * @property \Illuminate\Support\Carbon|null $deleted_at + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property int $type + * @property int $user_id + * @property string|null $class + * @property string|null $appid + * @property string|null $appdescription + * @property-read \Illuminate\Database\Eloquent\Collection|Item[] $children + * @property-read int|null $children_count + * @property-read string $droppable + * @property-read \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\Routing\UrlGenerator|mixed|string $link + * @property-read string $link_icon + * @property-read string $link_target + * @property-read string $link_type + * @property-read \Illuminate\Database\Eloquent\Collection|Item[] $parents + * @property-read int|null $parents_count + * @property-read \App\User|null $user + * @method static \Database\Factories\ItemFactory factory(...$parameters) + * @method static Builder|Item newModelQuery() + * @method static Builder|Item newQuery() + * @method static Builder|Item ofType($type) + * @method static \Illuminate\Database\Query\Builder|Item onlyTrashed() + * @method static Builder|Item pinned() + * @method static Builder|Item query() + * @method static Builder|Item whereAppdescription($value) + * @method static Builder|Item whereAppid($value) + * @method static Builder|Item whereClass($value) + * @method static Builder|Item whereColour($value) + * @method static Builder|Item whereCreatedAt($value) + * @method static Builder|Item whereDeletedAt($value) + * @method static Builder|Item whereDescription($value) + * @method static Builder|Item whereIcon($value) + * @method static Builder|Item whereId($value) + * @method static Builder|Item whereOrder($value) + * @method static Builder|Item wherePinned($value) + * @method static Builder|Item whereTitle($value) + * @method static Builder|Item whereType($value) + * @method static Builder|Item whereUpdatedAt($value) + * @method static Builder|Item whereUrl($value) + * @method static Builder|Item whereUserId($value) + * @method static \Illuminate\Database\Query\Builder|Item withTrashed() + * @method static \Illuminate\Database\Query\Builder|Item withoutTrashed() + * @mixin \Eloquent + */ class Item extends Model { use SoftDeletes; @@ -294,9 +350,9 @@ class Item extends Model /** * @param $class - * @return false + * @return Application|null */ - public static function applicationDetails($class): bool + public static function applicationDetails($class): ?Application { if (! empty($class)) { $name = self::nameFromClass($class); @@ -306,7 +362,7 @@ class Item extends Model } } - return false; + return null; } /** @@ -316,7 +372,7 @@ class Item extends Model public static function getApplicationDescription($class): string { $details = self::applicationDetails($class); - if ($details !== false) { + if ($details !== null) { return $details->description.' - '.$details->license; } diff --git a/app/ItemTag.php b/app/ItemTag.php index a2b168b2..74f77b60 100644 --- a/app/ItemTag.php +++ b/app/ItemTag.php @@ -4,6 +4,22 @@ namespace App; use Illuminate\Database\Eloquent\Relations\Pivot; +/** + * App\ItemTag + * + * @property int $item_id + * @property int $tag_id + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @method static \Illuminate\Database\Eloquent\Builder|ItemTag newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|ItemTag newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|ItemTag query() + * @method static \Illuminate\Database\Eloquent\Builder|ItemTag whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|ItemTag whereItemId($value) + * @method static \Illuminate\Database\Eloquent\Builder|ItemTag whereTagId($value) + * @method static \Illuminate\Database\Eloquent\Builder|ItemTag whereUpdatedAt($value) + * @mixin \Eloquent + */ class ItemTag extends Pivot { } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 8b791ae5..709faf2e 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -7,6 +7,7 @@ use App\Jobs\ProcessApps; use App\Jobs\UpdateApps; use App\Setting; use App\User; +use Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider; use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Schema; @@ -116,6 +117,10 @@ class AppServiceProvider extends ServiceProvider */ public function register() { + if ($this->app->isLocal()) { + $this->app->register(IdeHelperServiceProvider::class); + } + $this->app->singleton('settings', function () { return new Setting(); }); diff --git a/app/Search.php b/app/Search.php index 813f7795..b32043c5 100644 --- a/app/Search.php +++ b/app/Search.php @@ -14,7 +14,7 @@ abstract class Search * * @return Collection */ - public static function providers() + public static function providers(): Collection { $providers = self::standardProviders(); $providers = $providers + self::appProviders(); @@ -62,7 +62,7 @@ abstract class Search * * @return array */ - public static function appProviders() + public static function appProviders(): array { $providers = []; $userapps = Item::all(); diff --git a/app/Setting.php b/app/Setting.php index 3b1130f4..4afbd38b 100644 --- a/app/Setting.php +++ b/app/Setting.php @@ -3,6 +3,7 @@ namespace App; use Form; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsToMany; @@ -11,6 +12,37 @@ use Illuminate\Session\SessionManager; use Illuminate\Session\Store; use Illuminate\Support\Facades\Input; +/** + * App\Setting + * + * @mixin Builder + * @property int $id + * @property int $group_id + * @property string $key + * @property string $type + * @property string|null $options + * @property string $label + * @property string|null $value + * @property string $order + * @property int $system + * @property-read mixed $edit_value + * @property-read mixed $list_value + * @property-read \App\SettingGroup|null $group + * @property-read \Illuminate\Database\Eloquent\Collection|\App\User[] $users + * @property-read int|null $users_count + * @method static Builder|Setting newModelQuery() + * @method static Builder|Setting newQuery() + * @method static Builder|Setting query() + * @method static Builder|Setting whereGroupId($value) + * @method static Builder|Setting whereId($value) + * @method static Builder|Setting whereKey($value) + * @method static Builder|Setting whereLabel($value) + * @method static Builder|Setting whereOptions($value) + * @method static Builder|Setting whereOrder($value) + * @method static Builder|Setting whereSystem($value) + * @method static Builder|Setting whereType($value) + * @method static Builder|Setting whereValue($value) + */ class Setting extends Model { /** diff --git a/app/SettingGroup.php b/app/SettingGroup.php index aaa64442..b6d59c87 100644 --- a/app/SettingGroup.php +++ b/app/SettingGroup.php @@ -5,6 +5,22 @@ namespace App; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\HasMany; +/** + * App\SettingGroup + * + * @property int $id + * @property string $title + * @property int $order + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Setting[] $settings + * @property-read int|null $settings_count + * @method static \Illuminate\Database\Eloquent\Builder|SettingGroup newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|SettingGroup newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|SettingGroup query() + * @method static \Illuminate\Database\Eloquent\Builder|SettingGroup whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|SettingGroup whereOrder($value) + * @method static \Illuminate\Database\Eloquent\Builder|SettingGroup whereTitle($value) + * @mixin \Eloquent + */ class SettingGroup extends Model { /** diff --git a/app/SettingUser.php b/app/SettingUser.php index 05c3949b..8e323ba2 100644 --- a/app/SettingUser.php +++ b/app/SettingUser.php @@ -4,6 +4,20 @@ namespace App; use Illuminate\Database\Eloquent\Relations\Pivot; +/** + * App\SettingUser + * + * @property int $setting_id + * @property int $user_id + * @property string|null $uservalue + * @method static \Illuminate\Database\Eloquent\Builder|SettingUser newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|SettingUser newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|SettingUser query() + * @method static \Illuminate\Database\Eloquent\Builder|SettingUser whereSettingId($value) + * @method static \Illuminate\Database\Eloquent\Builder|SettingUser whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|SettingUser whereUservalue($value) + * @mixin \Eloquent + */ class SettingUser extends Pivot { // diff --git a/app/User.php b/app/User.php index 33e310f7..e039897f 100644 --- a/app/User.php +++ b/app/User.php @@ -7,6 +7,40 @@ use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; +/** + * App\User + * + * @property int $id + * @property string $username + * @property string $email + * @property string|null $avatar + * @property string|null $password + * @property string|null $autologin + * @property int $public_front + * @property string|null $remember_token + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Item[] $items + * @property-read int|null $items_count + * @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $notifications + * @property-read int|null $notifications_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Setting[] $settings + * @property-read int|null $settings_count + * @method static \Illuminate\Database\Eloquent\Builder|User newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|User newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|User query() + * @method static \Illuminate\Database\Eloquent\Builder|User whereAutologin($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereAvatar($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereEmail($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|User wherePassword($value) + * @method static \Illuminate\Database\Eloquent\Builder|User wherePublicFront($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereRememberToken($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereUsername($value) + * @mixin \Eloquent + */ class User extends Authenticatable { use Notifiable; diff --git a/composer.json b/composer.json index d037b877..aca33767 100644 --- a/composer.json +++ b/composer.json @@ -23,12 +23,13 @@ "ext-intl": "*" }, "require-dev": { + "barryvdh/laravel-ide-helper": "^2.12", "filp/whoops": "~2.0", "fzaninotto/faker": "~1.4", "mockery/mockery": "~1.0", "phpunit/phpunit": "~9.0", - "symfony/thanks": "^1.0", - "squizlabs/php_codesniffer": "3.*" + "squizlabs/php_codesniffer": "3.*", + "symfony/thanks": "^1.0" }, "autoload": { "classmap": [ @@ -52,6 +53,7 @@ "extra": { "laravel": { "dont-discover": [ + "barryvdh/laravel-ide-helper" ] } }, @@ -65,6 +67,11 @@ "post-autoload-dump": [ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", "@php artisan package:discover" + ], + "post-update-cmd": [ + "Illuminate\\Foundation\\ComposerScripts::postUpdate", + "@php artisan ide-helper:generate", + "@php artisan ide-helper:meta" ] }, "config": { diff --git a/composer.lock b/composer.lock index 475f19f6..2e12b081 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c1478972b2e1dbdb27f39255a644f4be", + "content-hash": "23969e2624fec1e93e31a8fa1e94c471", "packages": [ { "name": "brick/math", @@ -7100,6 +7100,562 @@ } ], "packages-dev": [ + { + "name": "barryvdh/laravel-ide-helper", + "version": "v2.12.3", + "source": { + "type": "git", + "url": "https://github.com/barryvdh/laravel-ide-helper.git", + "reference": "3ba1e2573b38f72107b8aacc4ee177fcab30a550" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/3ba1e2573b38f72107b8aacc4ee177fcab30a550", + "reference": "3ba1e2573b38f72107b8aacc4ee177fcab30a550", + "shasum": "" + }, + "require": { + "barryvdh/reflection-docblock": "^2.0.6", + "composer/pcre": "^1 || ^2 || ^3", + "doctrine/dbal": "^2.6 || ^3", + "ext-json": "*", + "illuminate/console": "^8 || ^9", + "illuminate/filesystem": "^8 || ^9", + "illuminate/support": "^8 || ^9", + "nikic/php-parser": "^4.7", + "php": "^7.3 || ^8.0", + "phpdocumentor/type-resolver": "^1.1.0" + }, + "require-dev": { + "ext-pdo_sqlite": "*", + "friendsofphp/php-cs-fixer": "^2", + "illuminate/config": "^8 || ^9", + "illuminate/view": "^8 || ^9", + "mockery/mockery": "^1.4", + "orchestra/testbench": "^6 || ^7", + "phpunit/phpunit": "^8.5 || ^9", + "spatie/phpunit-snapshot-assertions": "^3 || ^4", + "vimeo/psalm": "^3.12" + }, + "suggest": { + "illuminate/events": "Required for automatic helper generation (^6|^7|^8|^9)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.12-dev" + }, + "laravel": { + "providers": [ + "Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Barryvdh\\LaravelIdeHelper\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Barry vd. Heuvel", + "email": "barryvdh@gmail.com" + } + ], + "description": "Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.", + "keywords": [ + "autocomplete", + "codeintel", + "helper", + "ide", + "laravel", + "netbeans", + "phpdoc", + "phpstorm", + "sublime" + ], + "support": { + "issues": "https://github.com/barryvdh/laravel-ide-helper/issues", + "source": "https://github.com/barryvdh/laravel-ide-helper/tree/v2.12.3" + }, + "funding": [ + { + "url": "https://fruitcake.nl", + "type": "custom" + }, + { + "url": "https://github.com/barryvdh", + "type": "github" + } + ], + "time": "2022-03-06T14:33:42+00:00" + }, + { + "name": "barryvdh/reflection-docblock", + "version": "v2.1.0", + "source": { + "type": "git", + "url": "https://github.com/barryvdh/ReflectionDocBlock.git", + "reference": "bf44b757feb8ba1734659029357646466ded673e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/barryvdh/ReflectionDocBlock/zipball/bf44b757feb8ba1734659029357646466ded673e", + "reference": "bf44b757feb8ba1734659029357646466ded673e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.14|^9" + }, + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Barryvdh": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "support": { + "source": "https://github.com/barryvdh/ReflectionDocBlock/tree/v2.1.0" + }, + "time": "2022-10-31T15:35:43+00:00" + }, + { + "name": "composer/pcre", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.1.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-11-17T09:50:14+00:00" + }, + { + "name": "doctrine/cache", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/cache.git", + "reference": "1ca8f21980e770095a31456042471a57bc4c68fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/cache/zipball/1ca8f21980e770095a31456042471a57bc4c68fb", + "reference": "1ca8f21980e770095a31456042471a57bc4c68fb", + "shasum": "" + }, + "require": { + "php": "~7.1 || ^8.0" + }, + "conflict": { + "doctrine/common": ">2.2,<2.4" + }, + "require-dev": { + "cache/integration-tests": "dev-master", + "doctrine/coding-standard": "^9", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "symfony/cache": "^4.4 || ^5.4 || ^6", + "symfony/var-exporter": "^4.4 || ^5.4 || ^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", + "homepage": "https://www.doctrine-project.org/projects/cache.html", + "keywords": [ + "abstraction", + "apcu", + "cache", + "caching", + "couchdb", + "memcached", + "php", + "redis", + "xcache" + ], + "support": { + "issues": "https://github.com/doctrine/cache/issues", + "source": "https://github.com/doctrine/cache/tree/2.2.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache", + "type": "tidelift" + } + ], + "time": "2022-05-20T20:07:39+00:00" + }, + { + "name": "doctrine/dbal", + "version": "3.5.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/dbal.git", + "reference": "f38ee8aaca2d58ee88653cb34a6a3880c23f38a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/f38ee8aaca2d58ee88653cb34a6a3880c23f38a5", + "reference": "f38ee8aaca2d58ee88653cb34a6a3880c23f38a5", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2", + "doctrine/cache": "^1.11|^2.0", + "doctrine/deprecations": "^0.5.3|^1", + "doctrine/event-manager": "^1|^2", + "php": "^7.4 || ^8.0", + "psr/cache": "^1|^2|^3", + "psr/log": "^1|^2|^3" + }, + "require-dev": { + "doctrine/coding-standard": "10.0.0", + "jetbrains/phpstorm-stubs": "2022.2", + "phpstan/phpstan": "1.8.10", + "phpstan/phpstan-strict-rules": "^1.4", + "phpunit/phpunit": "9.5.25", + "psalm/plugin-phpunit": "0.17.0", + "squizlabs/php_codesniffer": "3.7.1", + "symfony/cache": "^5.4|^6.0", + "symfony/console": "^4.4|^5.4|^6.0", + "vimeo/psalm": "4.29.0" + }, + "suggest": { + "symfony/console": "For helpful console commands such as SQL execution and import of files." + }, + "bin": [ + "bin/doctrine-dbal" + ], + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\DBAL\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + } + ], + "description": "Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.", + "homepage": "https://www.doctrine-project.org/projects/dbal.html", + "keywords": [ + "abstraction", + "database", + "db2", + "dbal", + "mariadb", + "mssql", + "mysql", + "oci8", + "oracle", + "pdo", + "pgsql", + "postgresql", + "queryobject", + "sasql", + "sql", + "sqlite", + "sqlserver", + "sqlsrv" + ], + "support": { + "issues": "https://github.com/doctrine/dbal/issues", + "source": "https://github.com/doctrine/dbal/tree/3.5.1" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdbal", + "type": "tidelift" + } + ], + "time": "2022-10-24T07:26:18+00:00" + }, + { + "name": "doctrine/deprecations", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "shasum": "" + }, + "require": { + "php": "^7.1|^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "phpunit/phpunit": "^7.5|^8.5|^9.5", + "psr/log": "^1|^2|^3" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/v1.0.0" + }, + "time": "2022-05-02T15:47:09+00:00" + }, + { + "name": "doctrine/event-manager", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/event-manager.git", + "reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/95aa4cb529f1e96576f3fda9f5705ada4056a520", + "reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520", + "shasum": "" + }, + "require": { + "doctrine/deprecations": "^0.5.3 || ^1", + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/common": "<2.9" + }, + "require-dev": { + "doctrine/coding-standard": "^9 || ^10", + "phpstan/phpstan": "~1.4.10 || ^1.8.8", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.24" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.", + "homepage": "https://www.doctrine-project.org/projects/event-manager.html", + "keywords": [ + "event", + "event dispatcher", + "event manager", + "event system", + "events" + ], + "support": { + "issues": "https://github.com/doctrine/event-manager/issues", + "source": "https://github.com/doctrine/event-manager/tree/1.2.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fevent-manager", + "type": "tidelift" + } + ], + "time": "2022-10-12T20:51:15+00:00" + }, { "name": "doctrine/instantiator", "version": "1.4.1", @@ -7518,6 +8074,114 @@ }, "time": "2022-02-21T01:04:05+00:00" }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.6.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/48f445a408c131e38cab1c235aa6d2bb7a0bb20d", + "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "*", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^9.5", + "rector/rector": "^0.13.9", + "vimeo/psalm": "^4.25" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.2" + }, + "time": "2022-10-14T12:47:21+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "9.2.19", diff --git a/routes/web.php b/routes/web.php index 1d581c44..e9c7ab31 100644 --- a/routes/web.php +++ b/routes/web.php @@ -10,8 +10,8 @@ use App\Http\Controllers\SearchController; use App\Http\Controllers\SettingsController; use App\Http\Controllers\TagController; use App\Http\Controllers\UserController; -use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; +use Illuminate\Support\Facades\Request; use Illuminate\Support\Facades\Route; /* @@ -87,6 +87,7 @@ Route::get('titlecolour', function (Request $request) { if ($color) { return title_color($color); } + return ''; })->name('titlecolour'); Route::resource('users', UserController::class); diff --git a/vendor/barryvdh/laravel-ide-helper/.editorconfig b/vendor/barryvdh/laravel-ide-helper/.editorconfig new file mode 100644 index 00000000..9d499094 --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/.editorconfig @@ -0,0 +1,15 @@ +; This file is for unifying the coding style for different editors and IDEs. +; More information at http://editorconfig.org + +root = true + +[*] +charset = utf-8 +indent_size = 4 +indent_style = space +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false \ No newline at end of file diff --git a/vendor/barryvdh/laravel-ide-helper/.php_cs.common.php b/vendor/barryvdh/laravel-ide-helper/.php_cs.common.php new file mode 100644 index 00000000..aebd5441 --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/.php_cs.common.php @@ -0,0 +1,63 @@ + true, + 'blank_line_after_opening_tag' => true, + 'braces' => [ + 'allow_single_line_anonymous_class_with_empty_body' => true, + ], + 'compact_nullable_typehint' => true, + 'declare_equal_normalize' => true, + 'lowercase_cast' => true, + 'lowercase_static_reference' => true, + 'new_with_braces' => true, + 'no_blank_lines_after_class_opening' => true, + 'no_leading_import_slash' => true, + 'no_whitespace_in_blank_line' => true, + 'ordered_class_elements' => [ + 'order' => [ + 'use_trait', + ], + ], + 'ordered_imports' => [ + 'imports_order' => [ + 'class', + 'function', + 'const', + ], + 'sort_algorithm' => 'alpha', + ], + 'return_type_declaration' => true, + 'short_scalar_cast' => true, + 'single_blank_line_before_namespace' => true, + 'single_trait_insert_per_statement' => true, + 'ternary_operator_spaces' => true, + 'visibility_required' => [ + 'elements' => [ + 'const', + 'method', + 'property', + ], + ], + + // Further quality-of-life improvements + 'array_syntax' => [ + 'syntax' => 'short', + ], + 'concat_space' => [ + 'spacing' => 'one', + ], + 'fully_qualified_strict_types' => true, + 'native_function_invocation' => [ + 'include' => [], + 'strict' => true, + ], + 'no_unused_imports' => true, + 'single_quote' => true, + 'space_after_semicolon' => true, + 'trailing_comma_in_multiline_array' => true, + 'trim_array_spaces' => true, + 'unary_operator_spaces' => true, + 'whitespace_after_comma_in_array' => true, +]; diff --git a/vendor/barryvdh/laravel-ide-helper/.php_cs.dist b/vendor/barryvdh/laravel-ide-helper/.php_cs.dist new file mode 100644 index 00000000..20833451 --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/.php_cs.dist @@ -0,0 +1,14 @@ +in(__DIR__) + ->exclude('tests'); + +$config = require __DIR__ . '/.php_cs.common.php'; + +return PhpCsFixer\Config::create() + ->setFinder($finder) + ->setRules($config) + ->setRiskyAllowed(true) + ->setCacheFile(__DIR__ . '/.php_cs.cache'); diff --git a/vendor/barryvdh/laravel-ide-helper/.php_cs.tests.php b/vendor/barryvdh/laravel-ide-helper/.php_cs.tests.php new file mode 100644 index 00000000..24c484d1 --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/.php_cs.tests.php @@ -0,0 +1,22 @@ +in(__DIR__ . '/tests') + ->exclude('__snapshots__'); + +$config = require __DIR__ . '/.php_cs.common.php'; + +// Additional rules for tests +$config = array_merge( + $config, + [ + 'declare_strict_types' => true, + ] +); + +return PhpCsFixer\Config::create() + ->setFinder($finder) + ->setRules($config) + ->setRiskyAllowed(true) + ->setCacheFile(__DIR__ . '/.php_cs.tests.cache'); diff --git a/vendor/barryvdh/laravel-ide-helper/CHANGELOG.md b/vendor/barryvdh/laravel-ide-helper/CHANGELOG.md new file mode 100644 index 00000000..8b1d2dff --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/CHANGELOG.md @@ -0,0 +1,175 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +[Next release](https://github.com/barryvdh/laravel-ide-helper/compare/v2.12.3...master) +-------------- + +2022-03-06, 2.12.3 +------------------ + +### Fixed +- Fix date and datetime handling for attributes that set a serialization format option for the Carbon instance [#1324 / FLeudts](https://github.com/barryvdh/laravel-ide-helper/pull/1324) +- Fix composer conflict with composer/pcre version 2/3. [#1327 / barryvdh](https://github.com/barryvdh/laravel-ide-helper/pull/1327) + +2022-02-08, 2.12.2 +------------------ +### Fixed +- Remove composer dependecy, use copy of ClassMapGenerator [#1313 / barryvdh](https://github.com/barryvdh/laravel-ide-helper/pull/1313) + +2022-01-24, 2.12.1 +------------------ +### Fixed +- Properly handle `Castable`s without return type. [#1306 / binotaliu](https://github.com/barryvdh/laravel-ide-helper/pull/1306) + +2022-01-23, 2.12.0 +------------------ +### Added +- Add support for custom casts that using `Castable` [#1287 / binotaliu](https://github.com/barryvdh/laravel-ide-helper/pull/1287) +- Added Laravel 9 support [#1297 / rcerljenko](https://github.com/barryvdh/laravel-ide-helper/pull/1297) + +2022-01-03, 2.11.0 +------------------ +### Added +- Add support for Laravel 8.77 Attributes [\#1289 / SimonJnsson](https://github.com/barryvdh/laravel-ide-helper/pull/1289) +- Add support for cast types `decimal:*`, `encrypted:*`, `immutable_date`, `immutable_datetime`, `custom_datetime`, and `immutable_custom_datetime` [#1262 / miken32](https://github.com/barryvdh/laravel-ide-helper/pull/1262) +- Add support of variadic parameters in `ide-helper:models` [\#1234 / shaffe-fr](https://github.com/barryvdh/laravel-ide-helper/pull/1234) +- Add support of custom casts without properties [\#1267 / sparclex](https://github.com/barryvdh/laravel-ide-helper/pull/1267) + +### Fixed +- Fix recursively searching for `HasFactory` and `Macroable` traits [\#1216 / daniel-de-wit](https://github.com/barryvdh/laravel-ide-helper/pull/1216) +- Use platformName to determine db type when casting boolean types [\#1212 / stockalexander](https://github.com/barryvdh/laravel-ide-helper/pull/1212) + +### Changed +- Move default models helper filename to config [\#1241 / wimski](https://github.com/barryvdh/laravel-ide-helper/pull/1241) + +2021-06-18, 2.10.1 +------------------ +### Added +- Added Type registration according to [Custom Mapping Types documentation](https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#custom-mapping-types) [\#1228 / wimski](https://github.com/barryvdh/laravel-ide-helper/pull/1241) + +### Fixed +- Fixing issue where configured custom_db_types could cause a DBAL exception to be thrown while running `ide-helper:models` [\#1228 / wimski](https://github.com/barryvdh/laravel-ide-helper/pull/1241) + +2021-04-09, 2.10.0 +------------------ +### Added +- Allowing Methods to be set or unset in ModelHooks [\#1198 / jenga201](https://github.com/barryvdh/laravel-ide-helper/pull/1198)\ + Note: the visibility of `\Barryvdh\LaravelIdeHelper\Console\ModelsCommand::setMethod` has been changed to **public**! + +### Fixed +- Fixing issue where incorrect autoloader unregistered [\#1210 / tezhm](https://github.com/barryvdh/laravel-ide-helper/pull/1210) + +2021-04-02, 2.9.3 +----------------- +### Fixed +- Support both customized namespace factories as well as default resolvable ones [\#1201 / wimski](https://github.com/barryvdh/laravel-ide-helper/pull/1201) + +2021-04-01, 2.9.2 +----------------- +### Added +- Model hooks for adding custom information from external sources to model classes through the ModelsCommand [\#945 / wimski](https://github.com/barryvdh/laravel-ide-helper/pull/945) + +### Fixed +- Fix ide-helper:models exception if model doesn't have factory [\#1196 / ahmed-aliraqi](https://github.com/barryvdh/laravel-ide-helper/pull/1196) +- Running tests triggering post_migrate hooks [\#1193 / netpok](https://github.com/barryvdh/laravel-ide-helper/pull/1193) +- Array_merge error when config is cached prior to package install [\#1184 / netpok](https://github.com/barryvdh/laravel-ide-helper/pull/1184) + +2021-03-15, 2.9.1 +----------------- +### Added +- Generate PHPDoc for Laravel 8.x factories [\#1074 / ahmed-aliraqi](https://github.com/barryvdh/laravel-ide-helper/pull/1074) +- Add a comment to a property like table columns [\#1168 / biiiiiigmonster](https://github.com/barryvdh/laravel-ide-helper/pull/1168) +- Added `post_migrate` hook to run commands after a migration [\#1163 / netpok](https://github.com/barryvdh/laravel-ide-helper/pull/1163) +- Allow for PhpDoc for macros with union types [\#1148 / riesjart](https://github.com/barryvdh/laravel-ide-helper/pull/1148) + +### Fixed +- Error when generating helper for invokable classes [\#1124 / standaniels](https://github.com/barryvdh/laravel-ide-helper/pull/1124) +- Fix broken ReflectionUnionTypes [\#1132 / def-studio](https://github.com/barryvdh/laravel-ide-helper/pull/1132) +- Relative class names are not converted to fully-qualified class names [\#1005 / SavKS](https://github.com/barryvdh/laravel-ide-helper/pull/1005) + +2020-12-30, 2.9.0 +----------------- +### Changed +- Dropped support for Laravel 6 and Laravel 7, as well as support for PHP 7.2 and added support for doctrine/dbal:^3 [\#1114 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/1114) + +### Fixed +- `Macro::initPhpDoc()` will save original docblock if present [\#1116 / LastDragon-ru](https://github.com/barryvdh/laravel-ide-helper/pull/1116) +- `Alias` will grab macros from `\Illuminate\Database\Eloquent\Builder` too [\#1118 / LastDragon-ru](https://github.com/barryvdh/laravel-ide-helper/pull/1118) + +2020-12-08, 2.8.2 +----------------- +### Added +- Fix phpdoc generate for custom cast with parameter [\#986 / artelkr](https://github.com/barryvdh/laravel-ide-helper/pull/986) +- Created a possibility to add custom relation type [\#987 / efinder2](https://github.com/barryvdh/laravel-ide-helper/pull/987) +- Added `@see` with macro/mixin definition location to PhpDoc [\#1054 / riesjart](https://github.com/barryvdh/laravel-ide-helper/pull/1054) +- Initial compatibility for PHP8 [\#1106 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/1106) + +### Changed +- Implement DeferrableProvider [\#914 / kon-shou](https://github.com/barryvdh/laravel-ide-helper/pull/914) + +### Fixed +- Compatibility with Lumen [\#1043 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/1043) +- Allow model_locations to have glob patterns [\#1059 / saackearl](https://github.com/barryvdh/laravel-ide-helper/pull/1059) +- Error when generating helper for macroable classes which are not facades and contain a "fake" method [\#1066 / domkrm] (https://github.com/barryvdh/laravel-ide-helper/pull/1066) +- Casts with a return type of `static` or `$this` now resolve to an instance of the cast [\#1103 / riesjart](https://github.com/barryvdh/laravel-ide-helper/pull/1103) + +### Removed +- Removed format and broken generateJsonHelper [\#1053 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/1053) + +2020-09-07, 2.8.1 +----------------- +### Added +- Support Laravel 8 [\#1022 / barryvdh](https://github.com/barryvdh/laravel-ide-helper/pull/1022) +- Add option to force usage of FQN [\#1031 / edvordo](https://github.com/barryvdh/laravel-ide-helper/pull/1031) +- Add support for macros of all macroable classes [\#1006 / domkrm](https://github.com/barryvdh/laravel-ide-helper/pull/1006) + +2020-08-11, 2.8.0 +----------------- +### Added +- Add static return type to builder methods [\#924 / dmason30](https://github.com/barryvdh/laravel-ide-helper/pull/924) +- Add `optonal` to meta generator for PhpStorm [\#932 / halaei](https://github.com/barryvdh/laravel-ide-helper/pull/932) +- Decimal columns as string in Models [\#948 / fgibaux](https://github.com/barryvdh/laravel-ide-helper/pull/948) +- Simplify full namespaces for already included resources [\#954 / LANGERGabriel](https://github.com/barryvdh/laravel-ide-helper/pull/954) +- Make writing relation count properties optional [\#969 / AegirLeet](https://github.com/barryvdh/laravel-ide-helper/pull/969) +- Add more methods able to resolve container instances [\#996 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/996) + +### Fixed +- Test `auth` is bound before detect Auth driver [\#946 / zhwei](https://github.com/barryvdh/laravel-ide-helper/pull/946) +- Fix inline doc-block for final models [\#944 / Gummibeer](https://github.com/barryvdh/laravel-ide-helper/pull/955) + +2020-04-22, 2.7.0 +----------------- +### Added +- Add `ignored_models` as config option [\#890 / pataar](https://github.com/barryvdh/laravel-ide-helper/pull/890) +- Infer return type from reflection if no phpdoc given [\#906 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/906) +- Add custom collection support for get and all methods [\#903 / dmason30](https://github.com/barryvdh/laravel-ide-helper/pull/903) +- if a model implements interfaces, include them in the stub [\#920 / mr-feek](https://github.com/barryvdh/laravel-ide-helper/pull/920) +- Generate noinspections PHPStorm tags [\#905 / mzglinski](https://github.com/barryvdh/laravel-ide-helper/pull/905) +- Added support for Laravel 7 custom casts [\#913 / belamov](https://github.com/barryvdh/laravel-ide-helper/pull/913) +- Ability to use patterns for model_locations [\#921 / 4n70w4](https://github.com/barryvdh/laravel-ide-helper/pull/921) + +### Fixed +- MorphToMany relations with query not working [\#894 / UksusoFF](https://github.com/barryvdh/laravel-ide-helper/pull/894) +- Fix camelCase duplicated properties generator [\#881 / bop10](https://github.com/barryvdh/laravel-ide-helper/pull/881) +- Prevent generation of invalid code for certain parameter default values [\#901 / loilo](https://github.com/barryvdh/laravel-ide-helper/pull/901) +- Make hasOne and morphOne nullable [\#864 / leo108](https://github.com/barryvdh/laravel-ide-helper/pull/864) +- Remove unnecessary and wrong definition of SoftDelete methods [\#918 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/918) +- Unregister meta command custom autoloader when it is no longer needed [\#919 / mr-feek](https://github.com/barryvdh/laravel-ide-helper/pull/919) + +2020-02-25, 2.6.7 +----------------- +### Added +- Support for Laravel 7 [commit by barryvdh](https://github.com/barryvdh/laravel-ide-helper/commit/edd69c5e0508972c81f1f7173236de2459c45814) + +2019-12-02, 2.6.6 +----------------- +### Added +- Add splat operator (...) support [\#860 / ngmy](https://github.com/barryvdh/laravel-ide-helper/pull/860) +- Add support for custom date class via Date::use() [\#859 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/859) + +### Fixed +- Prevent undefined property errors [\#877 / matt-allan](https://github.com/barryvdh/laravel-ide-helper/pull/877) + +---- +Missing an older changelog? Feel free to submit a PR! diff --git a/vendor/barryvdh/laravel-ide-helper/LICENSE.md b/vendor/barryvdh/laravel-ide-helper/LICENSE.md new file mode 100644 index 00000000..c0ffe02b --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/LICENSE.md @@ -0,0 +1,21 @@ +# The MIT License (MIT) + +Copyright (c) Barry vd. Heuvel + +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. diff --git a/vendor/barryvdh/laravel-ide-helper/README.md b/vendor/barryvdh/laravel-ide-helper/README.md new file mode 100644 index 00000000..83d44333 --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/README.md @@ -0,0 +1,442 @@ +# Laravel IDE Helper Generator + +[![Tests](https://github.com/barryvdh/laravel-ide-helper/actions/workflows/run-tests.yml/badge.svg)](https://github.com/barryvdh/laravel-ide-helper/actions) +[![Packagist License](https://poser.pugx.org/barryvdh/laravel-ide-helper/license.png)](http://choosealicense.com/licenses/mit/) +[![Latest Stable Version](https://poser.pugx.org/barryvdh/laravel-ide-helper/version.png)](https://packagist.org/packages/barryvdh/laravel-ide-helper) +[![Total Downloads](https://poser.pugx.org/barryvdh/laravel-ide-helper/d/total.png)](https://packagist.org/packages/barryvdh/laravel-ide-helper) +[![Fruitcake](https://img.shields.io/badge/Powered%20By-Fruitcake-b2bc35.svg)](https://fruitcake.nl/) + +**Complete PHPDocs, directly from the source** + +This package generates helper files that enable your IDE to provide accurate autocompletion. +Generation is done based on the files in your project, so they are always up-to-date. + +- [Installation](#installation) +- [Usage](#usage) + - [Automatic PHPDoc generation for Laravel Facades](#automatic-phpdoc-generation-for-laravel-facades) + - [Automatic PHPDocs for models](#automatic-phpdocs-for-models) + - [Model Directories](#model-directories) + - [Ignore Models](#ignore-models) + - [Model Hooks](#model-hooks) + - [Automatic PHPDocs generation for Laravel Fluent methods](#automatic-phpdocs-generation-for-laravel-fluent-methods) + - [Auto-completion for factory builders](#auto-completion-for-factory-builders) + - [PhpStorm Meta for Container instances](#phpstorm-meta-for-container-instances) +- [Usage with Lumen](#usage-with-lumen) + - [Enabling Facades](#enabling-facades) + - [Adding the Service Provider](#adding-the-service-provider) + - [Adding Additional Facades](#adding-additional-facades) +- [License](#license) + +## Installation + +Require this package with composer using the following command: + +```bash +composer require --dev barryvdh/laravel-ide-helper +``` + +This package makes use of [Laravels package auto-discovery mechanism](https://medium.com/@taylorotwell/package-auto-discovery-in-laravel-5-5-ea9e3ab20518), which means if you don't install dev dependencies in production, it also won't be loaded. + +If for some reason you want manually control this: +- add the package to the `extra.laravel.dont-discover` key in `composer.json`, e.g. + ```json + "extra": { + "laravel": { + "dont-discover": [ + "barryvdh/laravel-ide-helper" + ] + } + } + ``` +- Add the following class to the `providers` array in `config/app.php`: + ```php + Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class, + ``` + If you want to manually load it only in non-production environments, instead you can add this to your `AppServiceProvider` with the `register()` method: + ```php + public function register() + { + if ($this->app->isLocal()) { + $this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class); + } + // ... + } + ``` + +> Note: Avoid caching the configuration in your development environment, it may cause issues after installing this package; respectively clear the cache beforehand via `php artisan cache:clear` if you encounter problems when running the commands + +## Usage + +_Check out [this Laracasts video](https://laracasts.com/series/how-to-be-awesome-in-phpstorm/episodes/15) for a quick introduction/explanation!_ + +- `php artisan ide-helper:generate` - [PHPDoc generation for Laravel Facades ](#automatic-phpdoc-generation-for-laravel-facades) +- `php artisan ide-helper:models` - [PHPDocs for models](#automatic-PHPDocs-for-models) +- `php artisan ide-helper:meta` - [PhpStorm Meta file](#phpstorm-meta-for-container-instances) + + +Note: You do need CodeComplice for Sublime Text: https://github.com/spectacles/CodeComplice + +### Automatic PHPDoc generation for Laravel Facades + +You can now re-generate the docs yourself (for future updates) + +```bash +php artisan ide-helper:generate +``` + +Note: `bootstrap/compiled.php` has to be cleared first, so run `php artisan clear-compiled` before generating. + +This will generate the file `_ide_helper.php` which is expected to be additionally parsed by your IDE for autocomplete. You can use the config `filename` to change its name. + +You can configure your `composer.json` to do this each time you update your dependencies: + +```js +"scripts": { + "post-update-cmd": [ + "Illuminate\\Foundation\\ComposerScripts::postUpdate", + "@php artisan ide-helper:generate", + "@php artisan ide-helper:meta" + ] +}, +``` + +You can also publish the config file to change implementations (ie. interface to specific class) or set defaults for `--helpers`. + +```bash +php artisan vendor:publish --provider="Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider" --tag=config +``` + +The generator tries to identify the real class, but if it cannot be found, you can define it in the config file. + +Some classes need a working database connection. If you do not have a default working connection, some facades will not be included. +You can use an in-memory SQLite driver by adding the `-M` option. + +You can choose to include helper files. This is not enabled by default, but you can override it with the `--helpers (-H)` option. +The `Illuminate/Support/helpers.php` is already set up, but you can add/remove your own files in the config file. + +### Automatic PHPDoc generation for macros and mixins + +This package can generate PHPDocs for macros and mixins which will be added to the `_ide_helper.php` file. + +But this only works if you use type hinting when declaring a macro. + +```php +Str::macro('concat', function(string $str1, string $str2) : string { + return $str1 . $str2; +}); +``` + +### Automatic PHPDocs for models + +If you don't want to write your properties yourself, you can use the command `php artisan ide-helper:models` to generate +PHPDocs, based on table columns, relations and getters/setters. + +> Note: this command requires a working database connection to introspect the table of each model + +By default, you are asked to overwrite or write to a separate file (`_ide_helper_models.php`). +You can write the comments directly to your Model file, using the `--write (-W)` option, or +force to not write with `--nowrite (-N)`. + +Alternatively using the `--write-mixin (-M)` option will only add a mixin tag to your Model file, +writing the rest in (`_ide_helper_models.php`). +The class name will be different from the model, avoiding the IDE duplicate annoyance. + +> Please make sure to back up your models, before writing the info. + +Writing to the models should keep the existing comments and only append new properties/methods. +The existing PHPDoc is replaced, or added if not found. +With the `--reset (-R)` option, the existing PHPDocs are ignored, and only the newly found columns/relations are saved as PHPDocs. + +```bash +php artisan ide-helper:models "App\Models\Post" +``` + +```php +/** + * App\Models\Post + * + * @property integer $id + * @property integer $author_id + * @property string $title + * @property string $text + * @property \Illuminate\Support\Carbon $created_at + * @property \Illuminate\Support\Carbon $updated_at + * @property-read \User $author + * @property-read \Illuminate\Database\Eloquent\Collection|\Comment[] $comments + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Post newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Post newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Post query() + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Post whereTitle($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Post forAuthors(\User ...$authors) + * … + */ +``` + +With the `--write-mixin (-M)` option +```php +/** + * … + * @mixin IdeHelperPost + */ +``` + +#### Model Directories + +By default, models in `app/models` are scanned. The optional argument tells what models to use (also outside app/models). + +```bash +php artisan ide-helper:models "App\Models\Post" "App\Models\User" +``` + +You can also scan a different directory, using the `--dir` option (relative from the base path): + +```bash +php artisan ide-helper:models --dir="path/to/models" --dir="app/src/Model" +``` + +You can publish the config file (`php artisan vendor:publish`) and set the default directories. + +#### Ignore Models + +Models can be ignored using the `--ignore (-I)` option + +```bash +php artisan ide-helper:models --ignore="App\Models\Post,App\Models\User" +``` + +Or can be ignored by setting the `ignored_models` config + +```php +'ignored_models' => [ + App\Post::class, + Api\User::class +], +``` + +#### Magic `where*` methods + +Eloquent allows calling `where` on your models, e.g. `Post::whereTitle(…)` and automatically translates this to e.g. `Post::where('title', '=', '…')`. + +If for some reason it's undesired to have them generated (one for each column), you can disable this via config `write_model_magic_where` and setting it to `false`. + +#### Magic `*_count` properties + +You may use the [`::withCount`](https://laravel.com/docs/master/eloquent-relationships#counting-related-models) method to count the number results from a relationship without actually loading them. Those results are then placed in attributes following the `_count` convention. + +By default, these attributes are generated in the phpdoc. You can turn them off by setting the config `write_model_relation_count_properties` to `false`. + +#### Support `@comment` based on DocBlock + +In order to better support IDEs, relations and getters/setters can also add a comment to a property like table columns. Therefore a custom docblock `@comment` is used: +```php +class Users extends Model +{ + /** + * @comment Get User's full name + * + * @return string + */ + public function getFullNameAttribute(): string + { + return $this->first_name . ' ' .$this->last_name ; + } +} + +// => after generate models + +/** + * App\Models\Users + * + * @property-read string $full_name Get User's full name + * … + */ +``` + +#### Dedicated Eloquent Builder methods + +A new method to the eloquent models was added called `newEloquentBuilder` [Reference](https://timacdonald.me/dedicated-eloquent-model-query-builders/) where we can +add support for creating a new dedicated class instead of using local scopes in the model itself. + +If for some reason it's undesired to have them generated (one for each column), you can disable this via config `write_model_external_builder_methods` and setting it to `false`. + +#### Unsupported or custom database types + +Common column types (e.g. varchar, integer) are correctly mapped to PHP types (`string`, `int`). + +But sometimes you may want to use custom column types in your database like `geography`, `jsonb`, `citext`, `bit`, etc. which may throw an "Unknown database type"-Exception. + +For those special cases, you can map them via the config `custom_db_types`. Example: +```php +'custom_db_types' => [ + 'mysql' => [ + 'geography' => 'array', + 'point' => 'array', + ], + 'postgresql' => [ + 'jsonb' => 'string', + '_int4' => 'array', + ], +], +``` + +#### Model Hooks + +If you need additional information on your model from sources that are not handled by default, you can hook in to the + generation process with model hooks to add extra information on the fly. + Simply create a class that implements `ModelHookInterface` and add it to the `model_hooks` array in the config: + + ```php +'model_hooks' => [ + MyCustomHook::class, +], +``` + +The `run` method will be called during generation for every model and receives the current running `ModelsCommand` and the current `Model`, e.g.: + +```php +class MyCustomHook implements ModelHookInterface +{ + public function run(ModelsCommand $command, Model $model): void + { + if (! $model instanceof MyModel) { + return; + } + + $command->setProperty('custom', 'string', true, false, 'My custom property'); + $command->unsetMethod('method'); + $command->setMethod('method', $command->getMethodType($model, '\Some\Class'), ['$param']); + } +} +``` + +```php +/** + * MyModel + * + * @property integer $id + * @property-read string $custom +``` + +### Automatic PHPDocs generation for Laravel Fluent methods + +If you need PHPDocs support for Fluent methods in migration, for example + +```php +$table->string("somestring")->nullable()->index(); +``` + +After publishing vendor, simply change the `include_fluent` line your `config/ide-helper.php` file into: + +```php +'include_fluent' => true, +``` + +Then run `php artisan ide-helper:generate`, you will now see all Fluent methods recognized by your IDE. + +### Auto-completion for factory builders + +If you would like the `factory()->create()` and `factory()->make()` methods to return the correct model class, +you can enable custom factory builders with the `include_factory_builders` line your `config/ide-helper.php` file. +Deprecated for Laravel 8 or latest. + +```php +'include_factory_builders' => true, +``` + +For this to work, you must also publish the PhpStorm Meta file (see below). + +## PhpStorm Meta for Container instances + +It's possible to generate a PhpStorm meta file to [add support for factory design pattern](https://www.jetbrains.com/help/phpstorm/ide-advanced-metadata.html). +For Laravel, this means we can make PhpStorm understand what kind of object we are resolving from the IoC Container. +For example, `events` will return an `Illuminate\Events\Dispatcher` object, +so with the meta file you can call `app('events')` and it will autocomplete the Dispatcher methods. + +```bash +php artisan ide-helper:meta +``` + +```php +app('events')->fire(); +\App::make('events')->fire(); + +/** @var \Illuminate\Foundation\Application $app */ +$app->make('events')->fire(); + +// When the key is not found, it uses the argument as class name +app('App\SomeClass'); +// Also works with +app(App\SomeClass::class); +``` + +> Note: You might need to restart PhpStorm and make sure `.phpstorm.meta.php` is indexed. +> +> Note: When you receive a FatalException: class not found, check your config +> (for example, remove S3 as cloud driver when you don't have S3 configured. Remove Redis ServiceProvider when you don't use it). + +You can change the generated filename via the config `meta_filename`. This can be useful for cases you want to take advantage the PhpStorm also supports the _directory_ `.phpstorm.meta.php/` which would parse any file places there, should your want provide additional files to PhpStorm. + +## Usage with Lumen + +This package is focused on Laravel development, but it can also be used in Lumen with some workarounds. +Because Lumen works a little different, as it is like a bare bone version of Laravel and the main configuration +parameters are instead located in `bootstrap/app.php`, some alterations must be made. + +### Enabling Facades + +While Laravel IDE Helper can generate automatically default Facades for code hinting, +Lumen doesn't come with Facades activated. If you plan in using them, you must enable +them under the `Create The Application` section, uncommenting this line: + +```php +// $app->withFacades(); +``` + +From there, you should be able to use the `create_alias()` function to add additional Facades into your application. + +### Adding the Service Provider + +You can install Laravel IDE Helper in `app/Providers/AppServiceProvider.php`, +and uncommenting this line that registers the App Service Providers, so it can properly load. + +```php +// $app->register(App\Providers\AppServiceProvider::class); +``` + +If you are not using that line, that is usually handy to manage gracefully multiple Laravel/Lumen installations, +you will have to add this line of code under the `Register Service Providers` section of your `bootstrap/app.php`. + +```php +if ($app->environment() !== 'production') { + $app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class); +} +``` + +After that, Laravel IDE Helper should work correctly. During the generation process, +the script may throw exceptions saying that some Class(s) doesn't exist or there are some undefined indexes. +This is normal, as Lumen has some default packages stripped away, like Cookies, Storage and Session. +If you plan to add these packages, you will have to add them manually and create additional Facades if needed. + +### Adding Additional Facades + +Currently, Lumen IDE Helper doesn't take into account additional Facades created under `bootstrap/app.php` using `create_alias()`, +so you need to create a `config/app.php` file and add your custom aliases under an `aliases` array again, like so: + +```php +return [ + 'aliases' => [ + 'CustomAliasOne' => Example\Support\Facades\CustomAliasOne::class, + 'CustomAliasTwo' => Example\Support\Facades\CustomAliasTwo::class, + //... + ] +]; +``` + +After you run `php artisan ide-helper:generate`, it's recommended (but not mandatory) to rename `config/app.php` to something else, +until you have to re-generate the docs or after passing to production environment. +Lumen 5.1+ will read this file for configuration parameters if it is present, and may overlap some configurations if it is completely populated. + +## License + +The Laravel IDE Helper Generator is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT) + diff --git a/vendor/barryvdh/laravel-ide-helper/composer.json b/vendor/barryvdh/laravel-ide-helper/composer.json new file mode 100644 index 00000000..06d92125 --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/composer.json @@ -0,0 +1,91 @@ +{ + "name": "barryvdh/laravel-ide-helper", + "description": "Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.", + "license": "MIT", + "keywords": [ + "laravel", + "autocomplete", + "ide", + "helper", + "phpstorm", + "netbeans", + "sublime", + "codeintel", + "phpdoc" + ], + "authors": [ + { + "name": "Barry vd. Heuvel", + "email": "barryvdh@gmail.com" + } + ], + "require": { + "php": "^7.3 || ^8.0", + "ext-json": "*", + "barryvdh/reflection-docblock": "^2.0.6", + "composer/pcre": "^1 || ^2 || ^3", + "doctrine/dbal": "^2.6 || ^3", + "illuminate/console": "^8 || ^9", + "illuminate/filesystem": "^8 || ^9", + "illuminate/support": "^8 || ^9", + "nikic/php-parser": "^4.7", + "phpdocumentor/type-resolver": "^1.1.0" + }, + "require-dev": { + "ext-pdo_sqlite": "*", + "friendsofphp/php-cs-fixer": "^2", + "illuminate/config": "^8 || ^9", + "illuminate/view": "^8 || ^9", + "mockery/mockery": "^1.4", + "orchestra/testbench": "^6 || ^7", + "phpunit/phpunit": "^8.5 || ^9", + "spatie/phpunit-snapshot-assertions": "^3 || ^4", + "vimeo/psalm": "^3.12" + }, + "suggest": { + "illuminate/events": "Required for automatic helper generation (^6|^7|^8|^9)." + }, + "minimum-stability": "dev", + "prefer-stable": true, + "autoload": { + "psr-4": { + "Barryvdh\\LaravelIdeHelper\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Barryvdh\\LaravelIdeHelper\\Tests\\": "tests" + } + }, + "config": { + "allow-plugins": { + "composer/package-versions-deprecated": true + }, + "sort-packages": true + }, + "extra": { + "branch-alias": { + "dev-master": "2.12-dev" + }, + "laravel": { + "providers": [ + "Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider" + ] + } + }, + "scripts": { + "analyze": "psalm", + "check-style": [ + "php-cs-fixer fix --diff --diff-format=udiff --dry-run", + "php-cs-fixer fix --diff --diff-format=udiff --dry-run --config=.php_cs.tests.php" + ], + "fix-style": [ + "php-cs-fixer fix", + "php-cs-fixer fix --config=.php_cs.tests.php" + ], + "psalm-set-baseline": "psalm --set-baseline=psalm-baseline.xml", + "test": "phpunit", + "test-ci": "phpunit -d --without-creating-snapshots", + "test-regenerate": "phpunit -d --update-snapshots" + } +} diff --git a/vendor/barryvdh/laravel-ide-helper/config/ide-helper.php b/vendor/barryvdh/laravel-ide-helper/config/ide-helper.php new file mode 100644 index 00000000..51fcdf24 --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/config/ide-helper.php @@ -0,0 +1,319 @@ + '_ide_helper.php', + + /* + |-------------------------------------------------------------------------- + | Models filename + |-------------------------------------------------------------------------- + | + | The default filename for the models helper file + | + */ + + 'models_filename' => '_ide_helper_models.php', + + /* + |-------------------------------------------------------------------------- + | Where to write the PhpStorm specific meta file + |-------------------------------------------------------------------------- + | + | PhpStorm also supports the directory `.phpstorm.meta.php/` with arbitrary + | files in it, should you need additional files for your project; e.g. + | `.phpstorm.meta.php/laravel_ide_Helper.php'. + | + */ + 'meta_filename' => '.phpstorm.meta.php', + + /* + |-------------------------------------------------------------------------- + | Fluent helpers + |-------------------------------------------------------------------------- + | + | Set to true to generate commonly used Fluent methods + | + */ + + 'include_fluent' => false, + + /* + |-------------------------------------------------------------------------- + | Factory Builders + |-------------------------------------------------------------------------- + | + | Set to true to generate factory generators for better factory() + | method auto-completion. + | + | Deprecated for Laravel 8 or latest. + | + */ + + 'include_factory_builders' => false, + + /* + |-------------------------------------------------------------------------- + | Write Model Magic methods + |-------------------------------------------------------------------------- + | + | Set to false to disable write magic methods of model + | + */ + + 'write_model_magic_where' => true, + + /* + |-------------------------------------------------------------------------- + | Write Model External Eloquent Builder methods + |-------------------------------------------------------------------------- + | + | Set to false to disable write external eloquent builder methods + | + */ + + 'write_model_external_builder_methods' => true, + + /* + |-------------------------------------------------------------------------- + | Write Model relation count properties + |-------------------------------------------------------------------------- + | + | Set to false to disable writing of relation count properties to model DocBlocks. + | + */ + + 'write_model_relation_count_properties' => true, + + /* + |-------------------------------------------------------------------------- + | Write Eloquent Model Mixins + |-------------------------------------------------------------------------- + | + | This will add the necessary DocBlock mixins to the model class + | contained in the Laravel Framework. This helps the IDE with + | auto-completion. + | + | Please be aware that this setting changes a file within the /vendor directory. + | + */ + + 'write_eloquent_model_mixins' => false, + + /* + |-------------------------------------------------------------------------- + | Helper files to include + |-------------------------------------------------------------------------- + | + | Include helper files. By default not included, but can be toggled with the + | -- helpers (-H) option. Extra helper files can be included. + | + */ + + 'include_helpers' => false, + + 'helper_files' => [ + base_path() . '/vendor/laravel/framework/src/Illuminate/Support/helpers.php', + ], + + /* + |-------------------------------------------------------------------------- + | Model locations to include + |-------------------------------------------------------------------------- + | + | Define in which directories the ide-helper:models command should look + | for models. + | + | glob patterns are supported to easier reach models in sub-directories, + | e.g. `app/Services/* /Models` (without the space) + | + */ + + 'model_locations' => [ + 'app', + ], + + /* + |-------------------------------------------------------------------------- + | Models to ignore + |-------------------------------------------------------------------------- + | + | Define which models should be ignored. + | + */ + + 'ignored_models' => [ + + ], + + /* + |-------------------------------------------------------------------------- + | Models hooks + |-------------------------------------------------------------------------- + | + | Define which hook classes you want to run for models to add custom information + | + | Hooks should implement Barryvdh\LaravelIdeHelper\Contracts\ModelHookInterface. + | + */ + + 'model_hooks' => [ + // App\Support\IdeHelper\MyModelHook::class + ], + + /* + |-------------------------------------------------------------------------- + | Extra classes + |-------------------------------------------------------------------------- + | + | These implementations are not really extended, but called with magic functions + | + */ + + 'extra' => [ + 'Eloquent' => ['Illuminate\Database\Eloquent\Builder', 'Illuminate\Database\Query\Builder'], + 'Session' => ['Illuminate\Session\Store'], + ], + + 'magic' => [], + + /* + |-------------------------------------------------------------------------- + | Interface implementations + |-------------------------------------------------------------------------- + | + | These interfaces will be replaced with the implementing class. Some interfaces + | are detected by the helpers, others can be listed below. + | + */ + + 'interfaces' => [ + + ], + + /* + |-------------------------------------------------------------------------- + | Support for custom DB types + |-------------------------------------------------------------------------- + | + | This setting allow you to map any custom database type (that you may have + | created using CREATE TYPE statement or imported using database plugin + | / extension to a Doctrine type. + | + | Each key in this array is a name of the Doctrine2 DBAL Platform. Currently valid names are: + | 'postgresql', 'db2', 'drizzle', 'mysql', 'oracle', 'sqlanywhere', 'sqlite', 'mssql' + | + | This name is returned by getName() method of the specific Doctrine/DBAL/Platforms/AbstractPlatform descendant + | + | The value of the array is an array of type mappings. Key is the name of the custom type, + | (for example, "jsonb" from Postgres 9.4) and the value is the name of the corresponding Doctrine2 type (in + | our case it is 'json_array'. Doctrine types are listed here: + | https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#types + | + | So to support jsonb in your models when working with Postgres, just add the following entry to the array below: + | + | "postgresql" => array( + | "jsonb" => "json_array", + | ), + | + */ + 'custom_db_types' => [ + + ], + + /* + |-------------------------------------------------------------------------- + | Support for camel cased models + |-------------------------------------------------------------------------- + | + | There are some Laravel packages (such as Eloquence) that allow for accessing + | Eloquent model properties via camel case, instead of snake case. + | + | Enabling this option will support these packages by saving all model + | properties as camel case, instead of snake case. + | + | For example, normally you would see this: + | + | * @property \Illuminate\Support\Carbon $created_at + | * @property \Illuminate\Support\Carbon $updated_at + | + | With this enabled, the properties will be this: + | + | * @property \Illuminate\Support\Carbon $createdAt + | * @property \Illuminate\Support\Carbon $updatedAt + | + | Note, it is currently an all-or-nothing option. + | + */ + 'model_camel_case_properties' => false, + + /* + |-------------------------------------------------------------------------- + | Property Casts + |-------------------------------------------------------------------------- + | + | Cast the given "real type" to the given "type". + | + */ + 'type_overrides' => [ + 'integer' => 'int', + 'boolean' => 'bool', + ], + + /* + |-------------------------------------------------------------------------- + | Include DocBlocks from classes + |-------------------------------------------------------------------------- + | + | Include DocBlocks from classes to allow additional code inspection for + | magic methods and properties. + | + */ + 'include_class_docblocks' => false, + + /* + |-------------------------------------------------------------------------- + | Force FQN usage + |-------------------------------------------------------------------------- + | + | Use the fully qualified (class) name in docBlock, + | event if class exists in a given file + | or there is an import (use className) of a given class + | + */ + 'force_fqn' => false, + + /* + |-------------------------------------------------------------------------- + | Additional relation types + |-------------------------------------------------------------------------- + | + | Sometimes it's needed to create custom relation types. The key of the array + | is the Relationship Method name. The value of the array is the canonical class + | name of the Relationship, e.g. `'relationName' => RelationShipClass::class`. + | + */ + 'additional_relation_types' => [], + + /* + |-------------------------------------------------------------------------- + | Run artisan commands after migrations to generate model helpers + |-------------------------------------------------------------------------- + | + | The specified commands should run after migrations are finished running. + | + */ + 'post_migrate' => [ + // 'ide-helper:models --nowrite', + ], + +]; diff --git a/vendor/barryvdh/laravel-ide-helper/psalm-baseline.xml b/vendor/barryvdh/laravel-ide-helper/psalm-baseline.xml new file mode 100644 index 00000000..ed4c6f24 --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/psalm-baseline.xml @@ -0,0 +1,20 @@ + + + + + Factory + Factory + + + + + \Auth + \DB + \Cache + \Cache + \Queue + \SSH + \Storage + + + diff --git a/vendor/barryvdh/laravel-ide-helper/psalm.xml b/vendor/barryvdh/laravel-ide-helper/psalm.xml new file mode 100644 index 00000000..86fd1f49 --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/psalm.xml @@ -0,0 +1,16 @@ + + + + + + + + + diff --git a/vendor/barryvdh/laravel-ide-helper/resources/views/helper.php b/vendor/barryvdh/laravel-ide-helper/resources/views/helper.php new file mode 100644 index 00000000..ddf29229 --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/resources/views/helper.php @@ -0,0 +1,115 @@ + + + +// @formatter:off +// phpcs:ignoreFile + +/** + * A helper file for Laravel, to provide autocomplete information to your IDE + * Generated for Laravel . + * + * This file should not be included in your code, only analyzed by your IDE! + * + * @author Barry vd. Heuvel + * @see https://github.com/barryvdh/laravel-ide-helper + */ + + $aliases) : ?> + +namespace { + + getDocComment(' ')) ?> + getClassType() ?> getExtendsClass() ?> { + getMethods() as $method) : ?> + getDocComment(' ')) ?> + public static function getName() ?>(getParamsWithDefault() ?>) + {getDeclaringClass() !== $method->getRoot()) : ?> + //Method inherited from getDeclaringClass() ?> + + + isInstanceCall()) : ?> + /** @var getRoot()?> $instance */ + + shouldReturn() ? 'return ' : '' ?>getRootMethodCall() ?>; + } + + } + +} + + + + $aliases) : ?> +namespace { + + getClassType() ?> getShortName() ?> extends getExtends() ?> {getExtendsNamespace() == '\Illuminate\Database\Eloquent') : ?> + getMethods() as $method) : ?> + getDocComment(' ')) ?> + public static function getName() ?>(getParamsWithDefault() ?>) + {getDeclaringClass() !== $method->getRoot()) : ?> + //Method inherited from getDeclaringClass() ?> + + + isInstanceCall()) : ?> + /** @var getRoot()?> $instance */ + + shouldReturn() ? 'return ' : '' ?>getRootMethodCall() ?>; + } + + } + +} + + + + +namespace { + +} + + + +namespace Illuminate\Support { + /** + * Methods commonly used in migrations + * + * @method Fluent after(string $column) Add the after modifier + * @method Fluent charset(string $charset) Add the character set modifier + * @method Fluent collation(string $collation) Add the collation modifier + * @method Fluent comment(string $comment) Add comment + * @method Fluent default($value) Add the default modifier + * @method Fluent first() Select first row + * @method Fluent index(string $name = null) Add the in dex clause + * @method Fluent on(string $table) `on` of a foreign key + * @method Fluent onDelete(string $action) `on delete` of a foreign key + * @method Fluent onUpdate(string $action) `on update` of a foreign key + * @method Fluent primary() Add the primary key modifier + * @method Fluent references(string $column) `references` of a foreign key + * @method Fluent nullable(bool $value = true) Add the nullable modifier + * @method Fluent unique(string $name = null) Add unique index clause + * @method Fluent unsigned() Add the unsigned modifier + * @method Fluent useCurrent() Add the default timestamp value + * @method Fluent change() Add the change modifier + */ + class Fluent {} +} + + + +namespace getNamespaceName()?> { + /** + * @method \Illuminate\Database\Eloquent\Collection|getShortName()?>[]|getShortName()?> create($attributes = []) + * @method \Illuminate\Database\Eloquent\Collection|getShortName()?>[]|getShortName()?> make($attributes = []) + */ + class getShortName()?>FactoryBuilder extends \Illuminate\Database\Eloquent\FactoryBuilder {} +} + diff --git a/vendor/barryvdh/laravel-ide-helper/resources/views/meta.php b/vendor/barryvdh/laravel-ide-helper/resources/views/meta.php new file mode 100644 index 00000000..51d87da1 --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/resources/views/meta.php @@ -0,0 +1,62 @@ + + +// @formatter:off + +namespace PHPSTORM_META { + + /** + * PhpStorm Meta file, to provide autocomplete information for PhpStorm + * + * @author Barry vd. Heuvel + * @see https://github.com/barryvdh/laravel-ide-helper + */ + + override(, map([ + '' => '@', + $class) : ?> + '' => \::class, + + ])); + + + + override(\factory(0), map([ + '' => '@FactoryBuilder', + + 'getName() ?>' => \getName() ?>FactoryBuilder::class, + + ])); + + + override(\Illuminate\Support\Arr::add(0), type(0)); + override(\Illuminate\Support\Arr::except(0), type(0)); + override(\Illuminate\Support\Arr::first(0), elementType(0)); + override(\Illuminate\Support\Arr::last(0), elementType(0)); + override(\Illuminate\Support\Arr::get(0), elementType(0)); + override(\Illuminate\Support\Arr::only(0), type(0)); + override(\Illuminate\Support\Arr::prepend(0), type(0)); + override(\Illuminate\Support\Arr::pull(0), elementType(0)); + override(\Illuminate\Support\Arr::set(0), type(0)); + override(\Illuminate\Support\Arr::shuffle(0), type(0)); + override(\Illuminate\Support\Arr::sort(0), type(0)); + override(\Illuminate\Support\Arr::sortRecursive(0), type(0)); + override(\Illuminate\Support\Arr::where(0), type(0)); + override(\array_add(0), type(0)); + override(\array_except(0), type(0)); + override(\array_first(0), elementType(0)); + override(\array_last(0), elementType(0)); + override(\array_get(0), elementType(0)); + override(\array_only(0), type(0)); + override(\array_prepend(0), type(0)); + override(\array_pull(0), elementType(0)); + override(\array_set(0), type(0)); + override(\array_sort(0), type(0)); + override(\array_sort_recursive(0), type(0)); + override(\array_where(0), type(0)); + override(\head(0), elementType(0)); + override(\last(0), elementType(0)); + override(\with(0), type(0)); + override(\tap(0), type(0)); + override(\optional(0), type(0)); + +} diff --git a/vendor/barryvdh/laravel-ide-helper/src/Alias.php b/vendor/barryvdh/laravel-ide-helper/src/Alias.php new file mode 100644 index 00000000..1907ecd0 --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/src/Alias.php @@ -0,0 +1,473 @@ + + * @copyright 2014 Barry vd. Heuvel / Fruitcake Studio (http://www.fruitcakestudio.nl) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link https://github.com/barryvdh/laravel-ide-helper + */ + +namespace Barryvdh\LaravelIdeHelper; + +use Barryvdh\Reflection\DocBlock; +use Barryvdh\Reflection\DocBlock\Context; +use Barryvdh\Reflection\DocBlock\Serializer as DocBlockSerializer; +use Barryvdh\Reflection\DocBlock\Tag\MethodTag; +use Closure; +use Illuminate\Config\Repository as ConfigRepository; +use Illuminate\Database\Eloquent\Builder as EloquentBuilder; +use Illuminate\Support\Facades\Facade; +use ReflectionClass; + +class Alias +{ + protected $alias; + /** @psalm-var class-string $facade */ + protected $facade; + protected $extends = null; + protected $extendsClass = null; + protected $extendsNamespace = null; + protected $classType = 'class'; + protected $short; + protected $namespace = '__root'; + protected $root = null; + protected $classes = []; + protected $methods = []; + protected $usedMethods = []; + protected $valid = false; + protected $magicMethods = []; + protected $interfaces = []; + protected $phpdoc = null; + protected $classAliases = []; + + /** @var ConfigRepository */ + protected $config; + + /** + * @param ConfigRepository $config + * @param string $alias + * @psalm-param class-string $facade + * @param string $facade + * @param array $magicMethods + * @param array $interfaces + */ + public function __construct($config, $alias, $facade, $magicMethods = [], $interfaces = []) + { + $this->alias = $alias; + $this->magicMethods = $magicMethods; + $this->interfaces = $interfaces; + $this->config = $config; + + // Make the class absolute + $facade = '\\' . ltrim($facade, '\\'); + $this->facade = $facade; + + $this->detectRoot(); + + if (!$this->root || $this->isTrait()) { + return; + } + + $this->valid = true; + + $this->addClass($this->root); + $this->detectFake(); + $this->detectNamespace(); + $this->detectClassType(); + $this->detectExtendsNamespace(); + + if (!empty($this->namespace)) { + $this->classAliases = (new UsesResolver())->loadFromClass($this->root); + + //Create a DocBlock and serializer instance + $this->phpdoc = new DocBlock(new ReflectionClass($alias), new Context($this->namespace, $this->classAliases)); + } + + if ($facade === '\Illuminate\Database\Eloquent\Model') { + $this->usedMethods = ['decrement', 'increment']; + } + } + + /** + * Add one or more classes to analyze + * + * @param array|string $classes + */ + public function addClass($classes) + { + $classes = (array)$classes; + foreach ($classes as $class) { + if (class_exists($class) || interface_exists($class)) { + $this->classes[] = $class; + } else { + echo "Class not exists: $class\r\n"; + } + } + } + + /** + * Check if this class is valid to process. + * @return bool + */ + public function isValid() + { + return $this->valid; + } + + /** + * Get the classtype, 'interface' or 'class' + * + * @return string + */ + public function getClasstype() + { + return $this->classType; + } + + /** + * Get the class which this alias extends + * + * @return null|string + */ + public function getExtends() + { + return $this->extends; + } + + /** + * Get the class short name which this alias extends + * + * @return null|string + */ + public function getExtendsClass() + { + return $this->extendsClass; + } + + /** + * Get the namespace of the class which this alias extends + * + * @return null|string + */ + public function getExtendsNamespace() + { + return $this->extendsNamespace; + } + + /** + * Get the Alias by which this class is called + * + * @return string + */ + public function getAlias() + { + return $this->alias; + } + + /** + * Return the short name (without namespace) + */ + public function getShortName() + { + return $this->short; + } + /** + * Get the namespace from the alias + * + * @return string + */ + public function getNamespace() + { + return $this->namespace; + } + + /** + * Get the methods found by this Alias + * + * @return array|Method[] + */ + public function getMethods() + { + if (count($this->methods) > 0) { + return $this->methods; + } + + $this->addMagicMethods(); + $this->detectMethods(); + return $this->methods; + } + + /** + * Detect class returned by ::fake() + */ + protected function detectFake() + { + $facade = $this->facade; + + if (!is_subclass_of($facade, Facade::class)) { + return; + } + + if (!method_exists($facade, 'fake')) { + return; + } + + $real = $facade::getFacadeRoot(); + + try { + $facade::fake(); + $fake = $facade::getFacadeRoot(); + if ($fake !== $real) { + $this->addClass(get_class($fake)); + } + } finally { + $facade::swap($real); + } + } + + /** + * Detect the namespace + */ + protected function detectNamespace() + { + if (strpos($this->alias, '\\')) { + $nsParts = explode('\\', $this->alias); + $this->short = array_pop($nsParts); + $this->namespace = implode('\\', $nsParts); + } else { + $this->short = $this->alias; + } + } + + /** + * Detect the extends namespace + */ + protected function detectExtendsNamespace() + { + if (strpos($this->extends, '\\') !== false) { + $nsParts = explode('\\', $this->extends); + $this->extendsClass = array_pop($nsParts); + $this->extendsNamespace = implode('\\', $nsParts); + } + } + + /** + * Detect the class type + */ + protected function detectClassType() + { + //Some classes extend the facade + if (interface_exists($this->facade)) { + $this->classType = 'interface'; + $this->extends = $this->facade; + } else { + $this->classType = 'class'; + if (class_exists($this->facade)) { + $this->extends = $this->facade; + } + } + } + + /** + * Get the real root of a facade + * + * @return bool|string + */ + protected function detectRoot() + { + $facade = $this->facade; + + try { + //If possible, get the facade root + if (method_exists($facade, 'getFacadeRoot')) { + $root = get_class($facade::getFacadeRoot()); + } else { + $root = $facade; + } + + //If it doesn't exist, skip it + if (!class_exists($root) && !interface_exists($root)) { + return; + } + + $this->root = $root; + + //When the database connection is not set, some classes will be skipped + } catch (\PDOException $e) { + $this->error( + 'PDOException: ' . $e->getMessage() . + "\nPlease configure your database connection correctly, or use the sqlite memory driver (-M)." . + " Skipping $facade." + ); + } catch (\Exception $e) { + $this->error('Exception: ' . $e->getMessage() . "\nSkipping $facade."); + } + } + + /** + * Detect if this class is a trait or not. + * + * @return bool + */ + protected function isTrait() + { + // Check if the facade is not a Trait + return trait_exists($this->facade); + } + + /** + * Add magic methods, as defined in the configuration files + */ + protected function addMagicMethods() + { + foreach ($this->magicMethods as $magic => $real) { + list($className, $name) = explode('::', $real); + if ((!class_exists($className) && !interface_exists($className)) || !method_exists($className, $name)) { + continue; + } + $method = new \ReflectionMethod($className, $name); + $class = new \ReflectionClass($className); + + if (!in_array($magic, $this->usedMethods)) { + if ($class !== $this->root) { + $this->methods[] = new Method($method, $this->alias, $class, $magic, $this->interfaces, $this->classAliases); + } + $this->usedMethods[] = $magic; + } + } + } + + /** + * Get the methods for one or multiple classes. + * + * @return string + */ + protected function detectMethods() + { + foreach ($this->classes as $class) { + $reflection = new \ReflectionClass($class); + + $methods = $reflection->getMethods(\ReflectionMethod::IS_PUBLIC); + if ($methods) { + foreach ($methods as $method) { + if (!in_array($method->name, $this->usedMethods)) { + // Only add the methods to the output when the root is not the same as the class. + // And don't add the __*() methods + if ($this->extends !== $class && substr($method->name, 0, 2) !== '__') { + $this->methods[] = new Method( + $method, + $this->alias, + $reflection, + $method->name, + $this->interfaces, + $this->classAliases + ); + } + $this->usedMethods[] = $method->name; + } + } + } + + // Check if the class is macroable + // (Eloquent\Builder is also macroable but doesn't use Macroable trait) + $traits = collect($reflection->getTraitNames()); + if ($traits->contains('Illuminate\Support\Traits\Macroable') || $class === EloquentBuilder::class) { + $properties = $reflection->getStaticProperties(); + $macros = isset($properties['macros']) ? $properties['macros'] : []; + foreach ($macros as $macro_name => $macro_func) { + if (!in_array($macro_name, $this->usedMethods)) { + // Add macros + $this->methods[] = new Macro( + $this->getMacroFunction($macro_func), + $this->alias, + $reflection, + $macro_name, + $this->interfaces, + $this->classAliases + ); + $this->usedMethods[] = $macro_name; + } + } + } + } + } + + /** + * @param $macro_func + * + * @return \ReflectionFunctionAbstract + * @throws \ReflectionException + */ + protected function getMacroFunction($macro_func) + { + if (is_array($macro_func) && is_callable($macro_func)) { + return new \ReflectionMethod($macro_func[0], $macro_func[1]); + } + + if (is_object($macro_func) && is_callable($macro_func) && !$macro_func instanceof Closure) { + return new \ReflectionMethod($macro_func, '__invoke'); + } + + return new \ReflectionFunction($macro_func); + } + + /* + * Get the docblock for this alias + * + * @param string $prefix + * @return mixed + */ + public function getDocComment($prefix = "\t\t") + { + $serializer = new DocBlockSerializer(1, $prefix); + + if (!$this->phpdoc) { + return ''; + } + + if ($this->config->get('ide-helper.include_class_docblocks')) { + // if a class doesn't expose any DocBlock tags + // we can perform reflection on the class and + // add in the original class DocBlock + if (count($this->phpdoc->getTags()) === 0) { + $class = new ReflectionClass($this->root); + $this->phpdoc = new DocBlock($class->getDocComment()); + } + } + + $this->removeDuplicateMethodsFromPhpDoc(); + return $serializer->getDocComment($this->phpdoc); + } + + /** + * Removes method tags from the doc comment that already appear as functions inside the class. + * This prevents duplicate function errors in the IDE. + * + * @return void + */ + protected function removeDuplicateMethodsFromPhpDoc() + { + $methodNames = array_map(function (Method $method) { + return $method->getName(); + }, $this->getMethods()); + + foreach ($this->phpdoc->getTags() as $tag) { + if ($tag instanceof MethodTag && in_array($tag->getMethodName(), $methodNames)) { + $this->phpdoc->deleteTag($tag); + } + } + } + + /** + * Output an error. + * + * @param string $string + * @return void + */ + protected function error($string) + { + echo $string . "\r\n"; + } +} diff --git a/vendor/barryvdh/laravel-ide-helper/src/ClassMapGenerator.php b/vendor/barryvdh/laravel-ide-helper/src/ClassMapGenerator.php new file mode 100644 index 00000000..17fbcaa0 --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/src/ClassMapGenerator.php @@ -0,0 +1,415 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * This file is copied from the Symfony package to composer/composer and then copied again here. + * + * (c) Fabien Potencier + */ + +namespace Barryvdh\LaravelIdeHelper; + +use Composer\Pcre\Preg; +use Symfony\Component\Finder\Finder; + +/** + * ClassMapGenerator + * + * @author Gyula Sallai + * @author Jordi Boggiano + */ +class ClassMapGenerator +{ + /** @var array */ + private static $typeConfig; + + /** @var non-empty-string */ + private static $restPattern; + + /** + * Generate a class map file + * + * @param \Traversable|array $dirs Directories or a single path to search in + * @param string $file The name of the class map file + * @return void + */ + public static function dump($dirs, $file) + { + $maps = []; + + foreach ($dirs as $dir) { + $maps = array_merge($maps, static::createMap($dir)); + } + + file_put_contents($file, sprintf(' + * @author Johannes M. Schmitt + */ + public static function isAbsolutePath($path) + { + return substr($path, 0, 1) === '/' || substr($path, 1, 1) === ':' || substr($path, 0, 2) === '\\\\'; + } + + /** + * Normalize a path. This replaces backslashes with slashes, removes ending + * slash and collapses redundant separators and up-level references. + * + * @param string $path Path to the file or directory + * @return string + * + * @see \Composer\Util\Filesystem + * @author Jordi Boggiano + * @author Johannes M. Schmitt + */ + public static function normalizePath($path) + { + $parts = []; + $path = strtr($path, '\\', '/'); + $prefix = ''; + $absolute = false; + + // extract a prefix being a protocol://, protocol:, protocol://drive: or simply drive: + if (preg_match('{^( [0-9a-z]{2,}+: (?: // (?: [a-z]: )? )? | [a-z]: )}ix', $path, $match)) { + $prefix = $match[1]; + $path = substr($path, strlen($prefix)); + } + + if (substr($path, 0, 1) === '/') { + $absolute = true; + $path = substr($path, 1); + } + + $up = false; + foreach (explode('/', $path) as $chunk) { + if ('..' === $chunk && ($absolute || $up)) { + array_pop($parts); + $up = !(empty($parts) || '..' === end($parts)); + } elseif ('.' !== $chunk && '' !== $chunk) { + $parts[] = $chunk; + $up = '..' !== $chunk; + } + } + + return $prefix . ($absolute ? '/' : '') . implode('/', $parts); + } + + /** + * Iterate over all files in the given directory searching for classes + * + * @param \Traversable<\SplFileInfo>|string|array $path The path to search in or an iterator + * @param string $excluded Regex that matches file paths to be excluded from the classmap + * @param ?\Composer\IO\IOInterface $io IO object + * @param ?string $namespace Optional namespace prefix to filter by + * @param ?string $autoloadType psr-0|psr-4 Optional autoload standard to use mapping rules + * @param array $scannedFiles + * @return array A class map array + * @throws \RuntimeException When the path is neither an existing file nor directory + */ + public static function createMap($path, $excluded = null, $io = null, $namespace = null, $autoloadType = null, &$scannedFiles = []) + { + $basePath = $path; + if (is_string($path)) { + if (is_file($path)) { + $path = [new \SplFileInfo($path)]; + } elseif (is_dir($path) || strpos($path, '*') !== false) { + $path = Finder::create()->files()->followLinks()->name('/\.(php|inc|hh)$/')->in($path); + } else { + throw new \RuntimeException( + 'Could not scan for classes inside "' . $path . + '" which does not appear to be a file nor a folder' + ); + } + } elseif (null !== $autoloadType) { + throw new \RuntimeException('Path must be a string when specifying an autoload type'); + } + + $map = []; + $cwd = realpath(getcwd()); + + foreach ($path as $file) { + $filePath = $file->getPathname(); + if (!in_array(pathinfo($filePath, PATHINFO_EXTENSION), ['php', 'inc', 'hh'])) { + continue; + } + + if (!self::isAbsolutePath($filePath)) { + $filePath = $cwd . '/' . $filePath; + $filePath = self::normalizePath($filePath); + } else { + $filePath = Preg::replace('{[\\\\/]{2,}}', '/', $filePath); + } + + $realPath = realpath($filePath); + + // if a list of scanned files is given, avoid scanning twice the same file to save cycles and avoid generating warnings + // in case a PSR-0/4 declaration follows another more specific one, or a classmap declaration, which covered this file already + if (isset($scannedFiles[$realPath])) { + continue; + } + + // check the realpath of the file against the excluded paths as the path might be a symlink and the excluded path is realpath'd so symlink are resolved + if ($excluded && Preg::isMatch($excluded, strtr($realPath, '\\', '/'))) { + continue; + } + // check non-realpath of file for directories symlink in project dir + if ($excluded && Preg::isMatch($excluded, strtr($filePath, '\\', '/'))) { + continue; + } + + $classes = self::findClasses($filePath); + if (null !== $autoloadType) { + $classes = self::filterByNamespace($classes, $filePath, $namespace, $autoloadType, $basePath, $io); + + // if no valid class was found in the file then we do not mark it as scanned as it might still be matched by another rule later + if ($classes) { + $scannedFiles[$realPath] = true; + } + } else { + // classmap autoload rules always collect all classes so for these we definitely do not want to scan again + $scannedFiles[$realPath] = true; + } + + foreach ($classes as $class) { + // skip classes not within the given namespace prefix + if (null === $autoloadType && null !== $namespace && '' !== $namespace && 0 !== strpos($class, $namespace)) { + continue; + } + + if (!isset($map[$class])) { + $map[$class] = $filePath; + } elseif ($io && $map[$class] !== $filePath && !Preg::isMatch('{/(test|fixture|example|stub)s?/}i', strtr($map[$class] . ' ' . $filePath, '\\', '/'))) { + $io->writeError( + 'Warning: Ambiguous class resolution, "' . $class . '"' . + ' was found in both "' . $map[$class] . '" and "' . $filePath . '", the first will be used.' + ); + } + } + } + + return $map; + } + + /** + * Remove classes which could not have been loaded by namespace autoloaders + * + * @param array $classes found classes in given file + * @param string $filePath current file + * @param string $baseNamespace prefix of given autoload mapping + * @param string $namespaceType psr-0|psr-4 + * @param string $basePath root directory of given autoload mapping + * @param ?\Composer\IO\IOInterface $io IO object + * @return array valid classes + */ + private static function filterByNamespace($classes, $filePath, $baseNamespace, $namespaceType, $basePath, $io) + { + $validClasses = []; + $rejectedClasses = []; + + $realSubPath = substr($filePath, strlen($basePath) + 1); + $dotPosition = strrpos($realSubPath, '.'); + $realSubPath = substr($realSubPath, 0, $dotPosition === false ? PHP_INT_MAX : $dotPosition); + + foreach ($classes as $class) { + // silently skip if ns doesn't have common root + if ('' !== $baseNamespace && 0 !== strpos($class, $baseNamespace)) { + continue; + } + // transform class name to file path and validate + if ('psr-0' === $namespaceType) { + $namespaceLength = strrpos($class, '\\'); + if (false !== $namespaceLength) { + $namespace = substr($class, 0, $namespaceLength + 1); + $className = substr($class, $namespaceLength + 1); + $subPath = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) + . str_replace('_', DIRECTORY_SEPARATOR, $className); + } else { + $subPath = str_replace('_', DIRECTORY_SEPARATOR, $class); + } + } elseif ('psr-4' === $namespaceType) { + $subNamespace = ('' !== $baseNamespace) ? substr($class, strlen($baseNamespace)) : $class; + $subPath = str_replace('\\', DIRECTORY_SEPARATOR, $subNamespace); + } else { + throw new \RuntimeException("namespaceType must be psr-0 or psr-4, $namespaceType given"); + } + if ($subPath === $realSubPath) { + $validClasses[] = $class; + } else { + $rejectedClasses[] = $class; + } + } + // warn only if no valid classes, else silently skip invalid + if (empty($validClasses)) { + foreach ($rejectedClasses as $class) { + if ($io) { + $io->writeError("Class $class located in " . Preg::replace('{^' . preg_quote(getcwd()) . '}', '.', $filePath, 1) . " does not comply with $namespaceType autoloading standard. Skipping."); + } + } + + return []; + } + + return $validClasses; + } + + /** + * Extract the classes in the given file + * + * @param string $path The file to check + * @throws \RuntimeException + * @return array The found classes + */ + private static function findClasses($path) + { + $extraTypes = self::getExtraTypes(); + + // Use @ here instead of Silencer to actively suppress 'unhelpful' output + // @link https://github.com/composer/composer/pull/4886 + $contents = @php_strip_whitespace($path); + if (!$contents) { + if (!file_exists($path)) { + $message = 'File at "%s" does not exist, check your classmap definitions'; + } elseif (!is_readable($path)) { + $message = 'File at "%s" is not readable, check its permissions'; + } elseif ('' === trim((string) file_get_contents($path))) { + // The input file was really empty and thus contains no classes + return []; + } else { + $message = 'File at "%s" could not be parsed as PHP, it may be binary or corrupted'; + } + $error = error_get_last(); + if (isset($error['message'])) { + $message .= PHP_EOL . 'The following message may be helpful:' . PHP_EOL . $error['message']; + } + throw new \RuntimeException(sprintf($message, $path)); + } + + // return early if there is no chance of matching anything in this file + Preg::matchAll('{\b(?:class|interface|trait' . $extraTypes . ')\s}i', $contents, $matches); + if (!$matches) { + return []; + } + + // strip heredocs/nowdocs + $contents = preg_replace('{<<<[ \t]*([\'"]?)(\w+)\\1(?:\r\n|\n|\r)(?:.*?)(?:\r\n|\n|\r)(?:\s*)\\2(?=\s+|[;,.)])}s', 'null', $contents); + // strip strings + $contents = preg_replace('{"[^"\\\\]*+(\\\\.[^"\\\\]*+)*+"|\'[^\'\\\\]*+(\\\\.[^\'\\\\]*+)*+\'}s', 'null', $contents); + // strip leading non-php code if needed + if (substr($contents, 0, 2) !== '(?:[^<]++|<(?!\?))*+<\?}s', '?>'); + if (false !== $pos && false === strpos(substr($contents, $pos), '])(?Pclass|interface|trait' . $extraTypes . ') \s++ (?P[a-zA-Z_\x7f-\xff:][a-zA-Z0-9_\x7f-\xff:\-]*+) + | \b(?])(?Pnamespace) (?P\s++[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+(?:\s*+\\\\\s*+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+)*+)? \s*+ [\{;] + ) + }ix', $contents, $matches); + + $classes = []; + $namespace = ''; + + for ($i = 0, $len = count($matches['type']); $i < $len; $i++) { + if (!empty($matches['ns'][$i])) { + $namespace = str_replace([' ', "\t", "\r", "\n"], '', $matches['nsname'][$i]) . '\\'; + } else { + $name = $matches['name'][$i]; + // skip anon classes extending/implementing + if ($name === 'extends' || $name === 'implements') { + continue; + } + if ($name[0] === ':') { + // This is an XHP class, https://github.com/facebook/xhp + $name = 'xhp' . substr(str_replace(['-', ':'], ['_', '__'], $name), 1); + } elseif ($matches['type'][$i] === 'enum') { + // something like: + // enum Foo: int { HERP = '123'; } + // The regex above captures the colon, which isn't part of + // the class name. + // or: + // enum Foo:int { HERP = '123'; } + // The regex above captures the colon and type, which isn't part of + // the class name. + $colonPos = strrpos($name, ':'); + if (false !== $colonPos) { + $name = substr($name, 0, $colonPos); + } + } + $classes[] = ltrim($namespace . $name, '\\'); + } + } + + return $classes; + } + + /** + * @return string + */ + private static function getExtraTypes() + { + static $extraTypes = null; + + if (null === $extraTypes) { + $extraTypes = ''; + if (PHP_VERSION_ID >= 80100 || (defined('HHVM_VERSION') && version_compare(HHVM_VERSION, '3.3', '>='))) { + $extraTypes .= '|enum'; + } + + self::setTypeConfig(array_merge(['class', 'interface', 'trait'], array_filter(explode('|', $extraTypes)))); + } + + return $extraTypes; + } + + /** + * @param string[] $types + * @return void + * + * @see \Composer\Autoload\PhpFileCleaner + * @author Jordi Boggiano + * @author Johannes M. Schmitt + */ + private static function setTypeConfig($types) + { + foreach ($types as $type) { + self::$typeConfig[$type[0]] = [ + 'name' => $type, + 'length' => strlen($type), + 'pattern' => '{.\b(?])' . $type . '\s++[a-zA-Z_\x7f-\xff:][a-zA-Z0-9_\x7f-\xff:\-]*+}Ais', + ]; + } + + self::$restPattern = '{[^?"\' + * @copyright 2017 Charles A. Peterson / Fruitcake Studio (http://www.fruitcakestudio.nl) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link https://github.com/barryvdh/laravel-ide-helper + */ + +namespace Barryvdh\LaravelIdeHelper\Console; + +use Barryvdh\LaravelIdeHelper\Eloquent; +use Illuminate\Console\Command; +use Illuminate\Filesystem\Filesystem; + +/** + * A command to add \Eloquent mixin to Eloquent\Model + * + * @author Charles A. Peterson + */ +class EloquentCommand extends Command +{ + /** + * The console command name. + * + * @var string + */ + protected $name = 'ide-helper:eloquent'; + + /** + * @var Filesystem $files + */ + protected $files; + + /** + * The console command description. + * + * @var string + */ + protected $description = 'Add \Eloquent helper to \Eloquent\Model'; + + /** + * @param Filesystem $files + */ + public function __construct(Filesystem $files) + { + parent::__construct(); + $this->files = $files; + } + + /** + * Execute the console command. + * + * @return void + */ + public function handle() + { + Eloquent::writeEloquentModelHelper($this, $this->files); + } +} diff --git a/vendor/barryvdh/laravel-ide-helper/src/Console/GeneratorCommand.php b/vendor/barryvdh/laravel-ide-helper/src/Console/GeneratorCommand.php new file mode 100644 index 00000000..40758ecf --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/src/Console/GeneratorCommand.php @@ -0,0 +1,174 @@ + + * @copyright 2014 Barry vd. Heuvel / Fruitcake Studio (http://www.fruitcakestudio.nl) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link https://github.com/barryvdh/laravel-ide-helper + */ + +namespace Barryvdh\LaravelIdeHelper\Console; + +use Barryvdh\LaravelIdeHelper\Eloquent; +use Barryvdh\LaravelIdeHelper\Generator; +use Illuminate\Console\Command; +use Illuminate\Filesystem\Filesystem; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputOption; + +/** + * A command to generate autocomplete information for your IDE + * + * @author Barry vd. Heuvel + */ +class GeneratorCommand extends Command +{ + /** + * The console command name. + * + * @var string + */ + protected $name = 'ide-helper:generate'; + + /** + * The console command description. + * + * @var string + */ + protected $description = 'Generate a new IDE Helper file.'; + + /** @var \Illuminate\Config\Repository */ + protected $config; + + /** @var \Illuminate\Filesystem\Filesystem */ + protected $files; + + /** @var \Illuminate\View\Factory */ + protected $view; + + protected $onlyExtend; + + + /** + * + * @param \Illuminate\Config\Repository $config + * @param \Illuminate\Filesystem\Filesystem $files + * @param \Illuminate\View\Factory $view + */ + public function __construct( + /*ConfigRepository */ + $config, + Filesystem $files, + /* Illuminate\View\Factory */ + $view + ) { + $this->config = $config; + $this->files = $files; + $this->view = $view; + parent::__construct(); + } + + /** + * Execute the console command. + * + * @return void + */ + public function handle() + { + if ( + file_exists(base_path() . '/vendor/compiled.php') || + file_exists(base_path() . '/bootstrap/cache/compiled.php') || + file_exists(base_path() . '/storage/framework/compiled.php') + ) { + $this->error( + 'Error generating IDE Helper: first delete your compiled file (php artisan clear-compiled)' + ); + return; + } + + $filename = $this->argument('filename'); + + // Add the php extension if missing + // This is a backwards-compatible shim and can be removed in the future + if (substr($filename, -4, 4) !== '.php') { + $filename .= '.php'; + } + + if ($this->option('memory')) { + $this->useMemoryDriver(); + } + + + $helpers = ''; + if ($this->option('helpers') || ($this->config->get('ide-helper.include_helpers'))) { + foreach ($this->config->get('ide-helper.helper_files', []) as $helper) { + if (file_exists($helper)) { + $helpers .= str_replace([''], '', $this->files->get($helper)); + } + } + } else { + $helpers = ''; + } + + $generator = new Generator($this->config, $this->view, $this->getOutput(), $helpers); + $content = $generator->generate(); + $written = $this->files->put($filename, $content); + + if ($written !== false) { + $this->info("A new helper file was written to $filename"); + + if ($this->option('write_mixins')) { + Eloquent::writeEloquentModelHelper($this, $this->files); + } + } else { + $this->error("The helper file could not be created at $filename"); + } + } + + protected function useMemoryDriver() + { + //Use a sqlite database in memory, to avoid connection errors on Database facades + $this->config->set( + 'database.connections.sqlite', + [ + 'driver' => 'sqlite', + 'database' => ':memory:', + ] + ); + $this->config->set('database.default', 'sqlite'); + } + + /** + * Get the console command arguments. + * + * @return array + */ + protected function getArguments() + { + $filename = $this->config->get('ide-helper.filename'); + + return [ + [ + 'filename', InputArgument::OPTIONAL, 'The path to the helper file', $filename, + ], + ]; + } + + /** + * Get the console command options. + * + * @return array + */ + protected function getOptions() + { + $writeMixins = $this->config->get('ide-helper.write_eloquent_model_mixins'); + + return [ + ['write_mixins', 'W', InputOption::VALUE_OPTIONAL, 'Write mixins to Laravel Model?', $writeMixins], + ['helpers', 'H', InputOption::VALUE_NONE, 'Include the helper files'], + ['memory', 'M', InputOption::VALUE_NONE, 'Use sqlite memory driver'], + ]; + } +} diff --git a/vendor/barryvdh/laravel-ide-helper/src/Console/MetaCommand.php b/vendor/barryvdh/laravel-ide-helper/src/Console/MetaCommand.php new file mode 100644 index 00000000..f9dfbe7f --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/src/Console/MetaCommand.php @@ -0,0 +1,181 @@ + + * @copyright 2015 Barry vd. Heuvel / Fruitcake Studio (http://www.fruitcakestudio.nl) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link https://github.com/barryvdh/laravel-ide-helper + */ + +namespace Barryvdh\LaravelIdeHelper\Console; + +use Barryvdh\LaravelIdeHelper\Factories; +use Illuminate\Console\Command; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * A command to generate phpstorm meta data + * + * @author Barry vd. Heuvel + */ +class MetaCommand extends Command +{ + /** + * The console command name. + * + * @var string + */ + protected $name = 'ide-helper:meta'; + + /** + * The console command description. + * + * @var string + */ + protected $description = 'Generate metadata for PhpStorm'; + + /** @var \Illuminate\Contracts\Filesystem\Filesystem */ + protected $files; + + /** @var \Illuminate\Contracts\View\Factory */ + protected $view; + + /** @var \Illuminate\Contracts\Config\Repository */ + protected $config; + + protected $methods = [ + 'new \Illuminate\Contracts\Container\Container', + '\Illuminate\Container\Container::makeWith(0)', + '\Illuminate\Contracts\Container\Container::get(0)', + '\Illuminate\Contracts\Container\Container::make(0)', + '\Illuminate\Contracts\Container\Container::makeWith(0)', + '\App::get(0)', + '\App::make(0)', + '\App::makeWith(0)', + '\app(0)', + '\resolve(0)', + '\Psr\Container\ContainerInterface::get(0)', + ]; + + /** + * + * @param \Illuminate\Contracts\Filesystem\Filesystem $files + * @param \Illuminate\Contracts\View\Factory $view + * @param \Illuminate\Contracts\Config\Repository $config + */ + public function __construct($files, $view, $config) + { + $this->files = $files; + $this->view = $view; + $this->config = $config; + parent::__construct(); + } + + /** + * Execute the console command. + * + * @return void + */ + public function handle() + { + // Needs to run before exception handler is registered + $factories = $this->config->get('ide-helper.include_factory_builders') ? Factories::all() : []; + + $ourAutoloader = $this->registerClassAutoloadExceptions(); + + $bindings = []; + foreach ($this->getAbstracts() as $abstract) { + // Validator and seeder cause problems + if (in_array($abstract, ['validator', 'seeder'])) { + continue; + } + + try { + $concrete = $this->laravel->make($abstract); + $reflectionClass = new \ReflectionClass($concrete); + if (is_object($concrete) && !$reflectionClass->isAnonymous()) { + $bindings[$abstract] = get_class($concrete); + } + } catch (\Throwable $e) { + if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) { + $this->comment("Cannot make '$abstract': " . $e->getMessage()); + } + } + } + + $this->unregisterClassAutoloadExceptions($ourAutoloader); + + $content = $this->view->make('meta', [ + 'bindings' => $bindings, + 'methods' => $this->methods, + 'factories' => $factories, + ])->render(); + + $filename = $this->option('filename'); + $written = $this->files->put($filename, $content); + + if ($written !== false) { + $this->info("A new meta file was written to $filename"); + } else { + $this->error("The meta file could not be created at $filename"); + } + } + + /** + * Get a list of abstracts from the Laravel Application. + * + * @return array + */ + protected function getAbstracts() + { + $abstracts = $this->laravel->getBindings(); + + // Return the abstract names only + $keys = array_keys($abstracts); + + sort($keys); + + return $keys; + } + + /** + * Register an autoloader the throws exceptions when a class is not found. + * + * @return callable + */ + protected function registerClassAutoloadExceptions(): callable + { + $autoloader = function ($class) { + throw new \ReflectionException("Class '$class' not found."); + }; + spl_autoload_register($autoloader); + return $autoloader; + } + + /** + * Get the console command options. + * + * @return array + */ + protected function getOptions() + { + $filename = $this->config->get('ide-helper.meta_filename'); + + return [ + ['filename', 'F', InputOption::VALUE_OPTIONAL, 'The path to the meta file', $filename], + ]; + } + + /** + * Remove our custom autoloader that we pushed onto the autoload stack + * + * @param callable $ourAutoloader + */ + private function unregisterClassAutoloadExceptions(callable $ourAutoloader): void + { + spl_autoload_unregister($ourAutoloader); + } +} diff --git a/vendor/barryvdh/laravel-ide-helper/src/Console/ModelsCommand.php b/vendor/barryvdh/laravel-ide-helper/src/Console/ModelsCommand.php new file mode 100644 index 00000000..fd8dd015 --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/src/Console/ModelsCommand.php @@ -0,0 +1,1553 @@ + + * @copyright 2014 Barry vd. Heuvel / Fruitcake Studio (http://www.fruitcakestudio.nl) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link https://github.com/barryvdh/laravel-ide-helper + */ + +namespace Barryvdh\LaravelIdeHelper\Console; + +use Barryvdh\LaravelIdeHelper\ClassMapGenerator; +use Barryvdh\LaravelIdeHelper\Contracts\ModelHookInterface; +use Barryvdh\Reflection\DocBlock; +use Barryvdh\Reflection\DocBlock\Context; +use Barryvdh\Reflection\DocBlock\Serializer as DocBlockSerializer; +use Barryvdh\Reflection\DocBlock\Tag; +use Doctrine\DBAL\Exception as DBALException; +use Doctrine\DBAL\Types\Type; +use Illuminate\Console\Command; +use Illuminate\Contracts\Database\Eloquent\Castable; +use Illuminate\Contracts\Database\Eloquent\CastsAttributes; +use Illuminate\Database\Eloquent\Casts\Attribute; +use Illuminate\Database\Eloquent\Factories\Factory; +use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\HasManyThrough; +use Illuminate\Database\Eloquent\Relations\HasOne; +use Illuminate\Database\Eloquent\Relations\HasOneThrough; +use Illuminate\Database\Eloquent\Relations\MorphMany; +use Illuminate\Database\Eloquent\Relations\MorphOne; +use Illuminate\Database\Eloquent\Relations\MorphTo; +use Illuminate\Database\Eloquent\Relations\MorphToMany; +use Illuminate\Database\Eloquent\Relations\Relation; +use Illuminate\Filesystem\Filesystem; +use Illuminate\Support\Collection; +use Illuminate\Support\Str; +use phpDocumentor\Reflection\Types\ContextFactory; +use ReflectionClass; +use ReflectionNamedType; +use ReflectionObject; +use ReflectionType; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; +use Throwable; + +/** + * A command to generate autocomplete information for your IDE + * + * @author Barry vd. Heuvel + */ +class ModelsCommand extends Command +{ + protected const RELATION_TYPES = [ + 'hasMany' => HasMany::class, + 'hasManyThrough' => HasManyThrough::class, + 'hasOneThrough' => HasOneThrough::class, + 'belongsToMany' => BelongsToMany::class, + 'hasOne' => HasOne::class, + 'belongsTo' => BelongsTo::class, + 'morphOne' => MorphOne::class, + 'morphTo' => MorphTo::class, + 'morphMany' => MorphMany::class, + 'morphToMany' => MorphToMany::class, + 'morphedByMany' => MorphToMany::class, + ]; + + /** + * @var Filesystem $files + */ + protected $files; + + /** + * The console command name. + * + * @var string + */ + protected $name = 'ide-helper:models'; + + /** + * @var string + */ + protected $filename; + + /** + * The console command description. + * + * @var string + */ + protected $description = 'Generate autocompletion for models'; + + protected $write_model_magic_where; + protected $write_model_relation_count_properties; + protected $properties = []; + protected $methods = []; + protected $write = false; + protected $write_mixin = false; + protected $dirs = []; + protected $reset; + protected $keep_text; + protected $phpstorm_noinspections; + protected $write_model_external_builder_methods; + /** + * @var bool[string] + */ + protected $nullableColumns = []; + /** + * @var string[] + */ + protected $foreignKeyConstraintsColumns = []; + + /** + * During initialization we use Laravels Date Facade to + * determine the actual date class and store it here. + * + * @var string + */ + protected $dateClass; + + /** + * @param Filesystem $files + */ + public function __construct(Filesystem $files) + { + parent::__construct(); + $this->files = $files; + } + + /** + * Execute the console command. + * + * @return void + */ + public function handle() + { + $this->filename = $this->laravel['config']->get('ide-helper.models_filename', '_ide_helper_models.php'); + $filename = $this->option('filename') ?? $this->filename; + $this->write = $this->option('write'); + $this->write_mixin = $this->option('write-mixin'); + $this->dirs = array_merge( + $this->laravel['config']->get('ide-helper.model_locations', []), + $this->option('dir') + ); + $model = $this->argument('model'); + $ignore = $this->option('ignore'); + $this->reset = $this->option('reset'); + $this->phpstorm_noinspections = $this->option('phpstorm-noinspections'); + if ($this->option('smart-reset')) { + $this->keep_text = $this->reset = true; + } + $this->write_model_magic_where = $this->laravel['config']->get('ide-helper.write_model_magic_where', true); + $this->write_model_external_builder_methods = $this->laravel['config']->get('ide-helper.write_model_external_builder_methods', true); + $this->write_model_relation_count_properties = + $this->laravel['config']->get('ide-helper.write_model_relation_count_properties', true); + + $this->write = $this->write_mixin ? true : $this->write; + //If filename is default and Write is not specified, ask what to do + if (!$this->write && $filename === $this->filename && !$this->option('nowrite')) { + if ( + $this->confirm( + "Do you want to overwrite the existing model files? Choose no to write to $filename instead" + ) + ) { + $this->write = true; + } + } + + $this->dateClass = class_exists(\Illuminate\Support\Facades\Date::class) + ? '\\' . get_class(\Illuminate\Support\Facades\Date::now()) + : '\Illuminate\Support\Carbon'; + + $content = $this->generateDocs($model, $ignore); + + if (!$this->write || $this->write_mixin) { + $written = $this->files->put($filename, $content); + if ($written !== false) { + $this->info("Model information was written to $filename"); + } else { + $this->error("Failed to write model information to $filename"); + } + } + } + + + /** + * Get the console command arguments. + * + * @return array + */ + protected function getArguments() + { + return [ + ['model', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Which models to include', []], + ]; + } + + /** + * Get the console command options. + * + * @return array + */ + protected function getOptions() + { + return [ + ['filename', 'F', InputOption::VALUE_OPTIONAL, 'The path to the helper file'], + ['dir', 'D', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, + 'The model dir, supports glob patterns', [], ], + ['write', 'W', InputOption::VALUE_NONE, 'Write to Model file'], + ['write-mixin', 'M', InputOption::VALUE_NONE, + "Write models to {$this->filename} and adds @mixin to each model, avoiding IDE duplicate declaration warnings", + ], + ['nowrite', 'N', InputOption::VALUE_NONE, 'Don\'t write to Model file'], + ['reset', 'R', InputOption::VALUE_NONE, 'Remove the original phpdocs instead of appending'], + ['smart-reset', 'r', InputOption::VALUE_NONE, 'Refresh the properties/methods list, but keep the text'], + ['phpstorm-noinspections', 'p', InputOption::VALUE_NONE, + 'Add PhpFullyQualifiedNameUsageInspection and PhpUnnecessaryFullyQualifiedNameInspection PHPStorm ' . + 'noinspection tags', + ], + ['ignore', 'I', InputOption::VALUE_OPTIONAL, 'Which models to ignore', ''], + ]; + } + + protected function generateDocs($loadModels, $ignore = '') + { + $output = " + */ +\n\n"; + + $hasDoctrine = interface_exists('Doctrine\DBAL\Driver'); + + if (empty($loadModels)) { + $models = $this->loadModels(); + } else { + $models = []; + foreach ($loadModels as $model) { + $models = array_merge($models, explode(',', $model)); + } + } + + $ignore = array_merge( + explode(',', $ignore), + $this->laravel['config']->get('ide-helper.ignored_models', []) + ); + + foreach ($models as $name) { + if (in_array($name, $ignore)) { + if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) { + $this->comment("Ignoring model '$name'"); + } + continue; + } + $this->properties = []; + $this->methods = []; + if (class_exists($name)) { + try { + // handle abstract classes, interfaces, ... + $reflectionClass = new ReflectionClass($name); + + if (!$reflectionClass->isSubclassOf('Illuminate\Database\Eloquent\Model')) { + continue; + } + + $this->comment("Loading model '$name'", OutputInterface::VERBOSITY_VERBOSE); + + if (!$reflectionClass->IsInstantiable()) { + // ignore abstract class or interface + continue; + } + + $model = $this->laravel->make($name); + + if ($hasDoctrine) { + $this->getPropertiesFromTable($model); + } + + if (method_exists($model, 'getCasts')) { + $this->castPropertiesType($model); + } + + $this->getPropertiesFromMethods($model); + $this->getSoftDeleteMethods($model); + $this->getCollectionMethods($model); + $this->getFactoryMethods($model); + + $this->runModelHooks($model); + + $output .= $this->createPhpDocs($name); + $ignore[] = $name; + $this->nullableColumns = []; + } catch (Throwable $e) { + $this->error('Exception: ' . $e->getMessage() . + "\nCould not analyze class $name.\n\nTrace:\n" . + $e->getTraceAsString()); + } + } + } + + if (!$hasDoctrine) { + $this->error( + 'Warning: `"doctrine/dbal": "~2.3"` is required to load database information. ' . + 'Please require that in your composer.json and run `composer update`.' + ); + } + + return $output; + } + + + protected function loadModels() + { + $models = []; + foreach ($this->dirs as $dir) { + if (is_dir(base_path($dir))) { + $dir = base_path($dir); + } + + $dirs = glob($dir, GLOB_ONLYDIR); + foreach ($dirs as $dir) { + if (!is_dir($dir)) { + $this->error("Cannot locate directory '{$dir}'"); + continue; + } + + if (file_exists($dir)) { + $classMap = ClassMapGenerator::createMap($dir); + + // Sort list so it's stable across different environments + ksort($classMap); + + foreach ($classMap as $model => $path) { + $models[] = $model; + } + } + } + } + return $models; + } + + /** + * cast the properties's type from $casts. + * + * @param \Illuminate\Database\Eloquent\Model $model + */ + public function castPropertiesType($model) + { + $casts = $model->getCasts(); + foreach ($casts as $name => $type) { + if (Str::startsWith($type, 'decimal:')) { + $type = 'decimal'; + } elseif (Str::startsWith($type, 'custom_datetime:')) { + $type = 'date'; + } elseif (Str::startsWith($type, 'date:')) { + $type = 'date'; + } elseif (Str::startsWith($type, 'datetime:')) { + $type = 'date'; + } elseif (Str::startsWith($type, 'immutable_custom_datetime:')) { + $type = 'immutable_date'; + } elseif (Str::startsWith($type, 'encrypted:')) { + $type = Str::after($type, ':'); + } + + $params = []; + + switch ($type) { + case 'encrypted': + $realType = 'mixed'; + break; + case 'boolean': + case 'bool': + $realType = 'boolean'; + break; + case 'decimal': + case 'string': + $realType = 'string'; + break; + case 'array': + case 'json': + $realType = 'array'; + break; + case 'object': + $realType = 'object'; + break; + case 'int': + case 'integer': + case 'timestamp': + $realType = 'integer'; + break; + case 'real': + case 'double': + case 'float': + $realType = 'float'; + break; + case 'date': + case 'datetime': + $realType = $this->dateClass; + break; + case 'immutable_date': + case 'immutable_datetime': + $realType = '\Carbon\CarbonImmutable'; + break; + case 'collection': + $realType = '\Illuminate\Support\Collection'; + break; + default: + // In case of an optional custom cast parameter , only evaluate + // the `$type` until the `:` + $type = strtok($type, ':'); + $realType = class_exists($type) ? ('\\' . $type) : 'mixed'; + $this->setProperty($name, null, true, true); + + $params = strtok(':'); + $params = $params ? explode(',', $params) : []; + break; + } + + if (!isset($this->properties[$name])) { + continue; + } + + $realType = $this->checkForCastableCasts($realType, $params); + $realType = $this->checkForCustomLaravelCasts($realType); + $realType = $this->getTypeOverride($realType); + $this->properties[$name]['type'] = $this->getTypeInModel($model, $realType); + + if (isset($this->nullableColumns[$name])) { + $this->properties[$name]['type'] .= '|null'; + } + } + } + + /** + * Returns the override type for the give type. + * + * @param string $type + * @return string|null + */ + protected function getTypeOverride($type) + { + $typeOverrides = $this->laravel['config']->get('ide-helper.type_overrides', []); + + return $typeOverrides[$type] ?? $type; + } + + /** + * Load the properties from the database table. + * + * @param \Illuminate\Database\Eloquent\Model $model + * + * @throws DBALException If custom field failed to register + */ + public function getPropertiesFromTable($model) + { + $table = $model->getConnection()->getTablePrefix() . $model->getTable(); + $schema = $model->getConnection()->getDoctrineSchemaManager(); + $databasePlatform = $schema->getDatabasePlatform(); + $databasePlatform->registerDoctrineTypeMapping('enum', 'string'); + + $platformName = $databasePlatform->getName(); + $customTypes = $this->laravel['config']->get("ide-helper.custom_db_types.{$platformName}", []); + foreach ($customTypes as $yourTypeName => $doctrineTypeName) { + try { + if (!Type::hasType($yourTypeName)) { + Type::addType($yourTypeName, get_class(Type::getType($doctrineTypeName))); + } + } catch (DBALException $exception) { + $this->error("Failed registering custom db type \"$yourTypeName\" as \"$doctrineTypeName\""); + throw $exception; + } + $databasePlatform->registerDoctrineTypeMapping($yourTypeName, $doctrineTypeName); + } + + $database = null; + if (strpos($table, '.')) { + [$database, $table] = explode('.', $table); + } + + $columns = $schema->listTableColumns($table, $database); + + if (!$columns) { + return; + } + + $this->setForeignKeys($schema, $table); + foreach ($columns as $column) { + $name = $column->getName(); + if (in_array($name, $model->getDates())) { + $type = $this->dateClass; + } else { + $type = $column->getType()->getName(); + switch ($type) { + case 'string': + case 'text': + case 'date': + case 'time': + case 'guid': + case 'datetimetz': + case 'datetime': + case 'decimal': + $type = 'string'; + break; + case 'integer': + case 'bigint': + case 'smallint': + $type = 'integer'; + break; + case 'boolean': + switch ($platformName) { + case 'sqlite': + case 'mysql': + $type = 'integer'; + break; + default: + $type = 'boolean'; + break; + } + break; + case 'float': + $type = 'float'; + break; + default: + $type = 'mixed'; + break; + } + } + + $comment = $column->getComment(); + if (!$column->getNotnull()) { + $this->nullableColumns[$name] = true; + } + $this->setProperty( + $name, + $this->getTypeInModel($model, $type), + true, + true, + $comment, + !$column->getNotnull() + ); + if ($this->write_model_magic_where) { + $builderClass = $this->write_model_external_builder_methods + ? get_class($model->newModelQuery()) + : '\Illuminate\Database\Eloquent\Builder'; + + $this->setMethod( + Str::camel('where_' . $name), + $this->getClassNameInDestinationFile($model, $builderClass) + . '|' + . $this->getClassNameInDestinationFile($model, get_class($model)), + ['$value'] + ); + } + } + } + + /** + * @param \Illuminate\Database\Eloquent\Model $model + */ + public function getPropertiesFromMethods($model) + { + $methods = get_class_methods($model); + if ($methods) { + sort($methods); + foreach ($methods as $method) { + $reflection = new \ReflectionMethod($model, $method); + $type = $this->getReturnTypeFromReflection($reflection); + $isAttribute = is_a($type, '\Illuminate\Database\Eloquent\Casts\Attribute', true); + if ( + Str::startsWith($method, 'get') && Str::endsWith( + $method, + 'Attribute' + ) && $method !== 'getAttribute' + ) { + //Magic getAttribute + $name = Str::snake(substr($method, 3, -9)); + if (!empty($name)) { + $type = $this->getReturnType($reflection); + $type = $this->getTypeInModel($model, $type); + $comment = $this->getCommentFromDocBlock($reflection); + $this->setProperty($name, $type, true, null, $comment); + } + } elseif ($isAttribute) { + $name = Str::snake($method); + $types = $this->getAttributeReturnType($model, $method); + + if ($types->has('get')) { + $type = $this->getTypeInModel($model, $types['get']); + $comment = $this->getCommentFromDocBlock($reflection); + $this->setProperty($name, $type, true, null, $comment); + } + + if ($types->has('set')) { + $comment = $this->getCommentFromDocBlock($reflection); + $this->setProperty($name, null, null, true, $comment); + } + } elseif ( + Str::startsWith($method, 'set') && Str::endsWith( + $method, + 'Attribute' + ) && $method !== 'setAttribute' + ) { + //Magic setAttribute + $name = Str::snake(substr($method, 3, -9)); + if (!empty($name)) { + $comment = $this->getCommentFromDocBlock($reflection); + $this->setProperty($name, null, null, true, $comment); + } + } elseif (Str::startsWith($method, 'scope') && $method !== 'scopeQuery') { + //Magic setAttribute + $name = Str::camel(substr($method, 5)); + if (!empty($name)) { + $comment = $this->getCommentFromDocBlock($reflection); + $args = $this->getParameters($reflection); + //Remove the first ($query) argument + array_shift($args); + $builder = $this->getClassNameInDestinationFile( + $reflection->getDeclaringClass(), + get_class($model->newModelQuery()) + ); + $modelName = $this->getClassNameInDestinationFile( + $reflection->getDeclaringClass(), + $reflection->getDeclaringClass()->getName() + ); + $this->setMethod($name, $builder . '|' . $modelName, $args, $comment); + } + } elseif (in_array($method, ['query', 'newQuery', 'newModelQuery'])) { + $builder = $this->getClassNameInDestinationFile($model, get_class($model->newModelQuery())); + + $this->setMethod( + $method, + $builder . '|' . $this->getClassNameInDestinationFile($model, get_class($model)) + ); + + if ($this->write_model_external_builder_methods) { + $this->writeModelExternalBuilderMethods($model); + } + } elseif ( + !method_exists('Illuminate\Database\Eloquent\Model', $method) + && !Str::startsWith($method, 'get') + ) { + //Use reflection to inspect the code, based on Illuminate/Support/SerializableClosure.php + if ($returnType = $reflection->getReturnType()) { + $type = $returnType instanceof ReflectionNamedType + ? $returnType->getName() + : (string)$returnType; + } else { + // php 7.x type or fallback to docblock + $type = (string)$this->getReturnTypeFromDocBlock($reflection); + } + + $file = new \SplFileObject($reflection->getFileName()); + $file->seek($reflection->getStartLine() - 1); + + $code = ''; + while ($file->key() < $reflection->getEndLine()) { + $code .= $file->current(); + $file->next(); + } + $code = trim(preg_replace('/\s\s+/', '', $code)); + $begin = strpos($code, 'function('); + $code = substr($code, $begin, strrpos($code, '}') - $begin + 1); + + foreach ( + $this->getRelationTypes() as $relation => $impl + ) { + $search = '$this->' . $relation . '('; + if (stripos($code, $search) || ltrim($impl, '\\') === ltrim((string)$type, '\\')) { + //Resolve the relation's model to a Relation object. + $methodReflection = new \ReflectionMethod($model, $method); + if ($methodReflection->getNumberOfParameters()) { + continue; + } + + $comment = $this->getCommentFromDocBlock($reflection); + // Adding constraints requires reading model properties which + // can cause errors. Since we don't need constraints we can + // disable them when we fetch the relation to avoid errors. + $relationObj = Relation::noConstraints(function () use ($model, $method) { + try { + return $model->$method(); + } catch (Throwable $e) { + $this->warn(sprintf('Error resolving relation model of %s:%s() : %s', get_class($model), $method, $e->getMessage())); + + return null; + } + }); + + if ($relationObj instanceof Relation) { + $relatedModel = $this->getClassNameInDestinationFile( + $model, + get_class($relationObj->getRelated()) + ); + + if (strpos(get_class($relationObj), 'Many') !== false) { + //Collection or array of models (because Collection is Arrayable) + $relatedClass = '\\' . get_class($relationObj->getRelated()); + $collectionClass = $this->getCollectionClass($relatedClass); + $collectionClassNameInModel = $this->getClassNameInDestinationFile( + $model, + $collectionClass + ); + $this->setProperty( + $method, + $collectionClassNameInModel . '|' . $relatedModel . '[]', + true, + null, + $comment + ); + if ($this->write_model_relation_count_properties) { + $this->setProperty( + Str::snake($method) . '_count', + 'int|null', + true, + false + // What kind of comments should be added to the relation count here? + ); + } + } elseif ($relation === 'morphTo') { + // Model isn't specified because relation is polymorphic + $this->setProperty( + $method, + $this->getClassNameInDestinationFile($model, Model::class) . '|\Eloquent', + true, + null, + $comment + ); + } else { + //Single model is returned + $this->setProperty( + $method, + $relatedModel, + true, + null, + $comment, + $this->isRelationNullable($relation, $relationObj) + ); + } + } + } + } + } + } + } + } + + /** + * Check if the relation is nullable + * + * @param string $relation + * @param Relation $relationObj + * + * @return bool + */ + protected function isRelationNullable(string $relation, Relation $relationObj): bool + { + $reflectionObj = new ReflectionObject($relationObj); + + if (in_array($relation, ['hasOne', 'hasOneThrough', 'morphOne'], true)) { + $defaultProp = $reflectionObj->getProperty('withDefault'); + $defaultProp->setAccessible(true); + + return !$defaultProp->getValue($relationObj); + } + + if (!$reflectionObj->hasProperty('foreignKey')) { + return false; + } + + $fkProp = $reflectionObj->getProperty('foreignKey'); + $fkProp->setAccessible(true); + + if ($relation === 'belongsTo') { + return isset($this->nullableColumns[$fkProp->getValue($relationObj)]) || + !in_array($fkProp->getValue($relationObj), $this->foreignKeyConstraintsColumns, true); + } + + return isset($this->nullableColumns[$fkProp->getValue($relationObj)]); + } + + /** + * @param string $name + * @param string|null $type + * @param bool|null $read + * @param bool|null $write + * @param string|null $comment + * @param bool $nullable + */ + public function setProperty($name, $type = null, $read = null, $write = null, $comment = '', $nullable = false) + { + if (!isset($this->properties[$name])) { + $this->properties[$name] = []; + $this->properties[$name]['type'] = 'mixed'; + $this->properties[$name]['read'] = false; + $this->properties[$name]['write'] = false; + $this->properties[$name]['comment'] = (string) $comment; + } + if ($type !== null) { + $newType = $this->getTypeOverride($type); + if ($nullable) { + $newType .= '|null'; + } + $this->properties[$name]['type'] = $newType; + } + if ($read !== null) { + $this->properties[$name]['read'] = $read; + } + if ($write !== null) { + $this->properties[$name]['write'] = $write; + } + } + + public function setMethod($name, $type = '', $arguments = [], $comment = '') + { + $methods = array_change_key_case($this->methods, CASE_LOWER); + + if (!isset($methods[strtolower($name)])) { + $this->methods[$name] = []; + $this->methods[$name]['type'] = $type; + $this->methods[$name]['arguments'] = $arguments; + $this->methods[$name]['comment'] = $comment; + } + } + + public function unsetMethod($name) + { + unset($this->methods[strtolower($name)]); + } + + public function getMethodType(Model $model, string $classType) + { + $modelName = $this->getClassNameInDestinationFile($model, get_class($model)); + $builder = $this->getClassNameInDestinationFile($model, $classType); + return $builder . '|' . $modelName; + } + + /** + * @param string $class + * @return string + */ + protected function createPhpDocs($class) + { + $reflection = new ReflectionClass($class); + $namespace = $reflection->getNamespaceName(); + $classname = $reflection->getShortName(); + $originalDoc = $reflection->getDocComment(); + $keyword = $this->getClassKeyword($reflection); + $interfaceNames = array_diff_key( + $reflection->getInterfaceNames(), + $reflection->getParentClass()->getInterfaceNames() + ); + + if ($this->reset) { + $phpdoc = new DocBlock('', new Context($namespace)); + if ($this->keep_text) { + $phpdoc->setText( + (new DocBlock($reflection, new Context($namespace)))->getText() + ); + } + } else { + $phpdoc = new DocBlock($reflection, new Context($namespace)); + } + + if (!$phpdoc->getText()) { + $phpdoc->setText($class); + } + + $properties = []; + $methods = []; + foreach ($phpdoc->getTags() as $tag) { + $name = $tag->getName(); + if ($name == 'property' || $name == 'property-read' || $name == 'property-write') { + $properties[] = $tag->getVariableName(); + } elseif ($name == 'method') { + $methods[] = $tag->getMethodName(); + } + } + + foreach ($this->properties as $name => $property) { + $name = "\$$name"; + + if ($this->hasCamelCaseModelProperties()) { + $name = Str::camel($name); + } + + if (in_array($name, $properties)) { + continue; + } + if ($property['read'] && $property['write']) { + $attr = 'property'; + } elseif ($property['write']) { + $attr = 'property-write'; + } else { + $attr = 'property-read'; + } + + $tagLine = trim("@{$attr} {$property['type']} {$name} {$property['comment']}"); + $tag = Tag::createInstance($tagLine, $phpdoc); + $phpdoc->appendTag($tag); + } + + ksort($this->methods); + + foreach ($this->methods as $name => $method) { + if (in_array($name, $methods)) { + continue; + } + $arguments = implode(', ', $method['arguments']); + $tagLine = "@method static {$method['type']} {$name}({$arguments})"; + if ($method['comment'] !== '') { + $tagLine .= " {$method['comment']}"; + } + $tag = Tag::createInstance($tagLine, $phpdoc); + $phpdoc->appendTag($tag); + } + + if ($this->write && !$phpdoc->getTagsByName('mixin')) { + $eloquentClassNameInModel = $this->getClassNameInDestinationFile($reflection, 'Eloquent'); + $phpdoc->appendTag(Tag::createInstance('@mixin ' . $eloquentClassNameInModel, $phpdoc)); + } + if ($this->phpstorm_noinspections) { + /** + * Facades, Eloquent API + * @see https://www.jetbrains.com/help/phpstorm/php-fully-qualified-name-usage.html + */ + $phpdoc->appendTag(Tag::createInstance('@noinspection PhpFullyQualifiedNameUsageInspection', $phpdoc)); + /** + * Relations, other models in the same namespace + * @see https://www.jetbrains.com/help/phpstorm/php-unnecessary-fully-qualified-name.html + */ + $phpdoc->appendTag( + Tag::createInstance('@noinspection PhpUnnecessaryFullyQualifiedNameInspection', $phpdoc) + ); + } + + $serializer = new DocBlockSerializer(); + $docComment = $serializer->getDocComment($phpdoc); + + if ($this->write_mixin) { + $phpdocMixin = new DocBlock($reflection, new Context($namespace)); + // remove all mixin tags prefixed with IdeHelper + foreach ($phpdocMixin->getTagsByName('mixin') as $tag) { + if (Str::startsWith($tag->getContent(), 'IdeHelper')) { + $phpdocMixin->deleteTag($tag); + } + } + + $mixinClassName = "IdeHelper{$classname}"; + $phpdocMixin->appendTag(Tag::createInstance("@mixin {$mixinClassName}", $phpdocMixin)); + $mixinDocComment = $serializer->getDocComment($phpdocMixin); + // remove blank lines if there's no text + if (!$phpdocMixin->getText()) { + $mixinDocComment = preg_replace("/\s\*\s*\n/", '', $mixinDocComment); + } + + foreach ($phpdoc->getTagsByName('mixin') as $tag) { + if (Str::startsWith($tag->getContent(), 'IdeHelper')) { + $phpdoc->deleteTag($tag); + } + } + $docComment = $serializer->getDocComment($phpdoc); + } + + if ($this->write) { + $modelDocComment = $this->write_mixin ? $mixinDocComment : $docComment; + $filename = $reflection->getFileName(); + $contents = $this->files->get($filename); + if ($originalDoc) { + $contents = str_replace($originalDoc, $modelDocComment, $contents); + } else { + $replace = "{$modelDocComment}\n"; + $pos = strpos($contents, "final class {$classname}") ?: strpos($contents, "class {$classname}"); + if ($pos !== false) { + $contents = substr_replace($contents, $replace, $pos, 0); + } + } + if ($this->files->put($filename, $contents)) { + $this->info('Written new phpDocBlock to ' . $filename); + } + } + + $classname = $this->write_mixin ? $mixinClassName : $classname; + $output = "namespace {$namespace}{\n{$docComment}\n\t{$keyword}class {$classname} "; + + if (!$this->write_mixin) { + $output .= "extends \Eloquent "; + + if ($interfaceNames) { + $interfaces = implode(', \\', $interfaceNames); + $output .= "implements \\{$interfaces} "; + } + } + + return $output . "{}\n}\n\n"; + } + + /** + * Get the parameters and format them correctly + * + * @param $method + * @return array + * @throws \ReflectionException + */ + public function getParameters($method) + { + //Loop through the default values for parameters, and make the correct output string + $paramsWithDefault = []; + /** @var \ReflectionParameter $param */ + foreach ($method->getParameters() as $param) { + $paramStr = $param->isVariadic() ? '...$' . $param->getName() : '$' . $param->getName(); + + if ($paramType = $this->getParamType($method, $param)) { + $paramStr = $paramType . ' ' . $paramStr; + } + + if ($param->isOptional() && $param->isDefaultValueAvailable()) { + $default = $param->getDefaultValue(); + if (is_bool($default)) { + $default = $default ? 'true' : 'false'; + } elseif (is_array($default)) { + $default = '[]'; + } elseif (is_null($default)) { + $default = 'null'; + } elseif (is_int($default)) { + //$default = $default; + } else { + $default = "'" . trim($default) . "'"; + } + + $paramStr .= " = $default"; + } + + $paramsWithDefault[] = $paramStr; + } + return $paramsWithDefault; + } + + /** + * Determine a model classes' collection type. + * + * @see http://laravel.com/docs/eloquent-collections#custom-collections + * @param string $className + * @return string + */ + protected function getCollectionClass($className) + { + // Return something in the very very unlikely scenario the model doesn't + // have a newCollection() method. + if (!method_exists($className, 'newCollection')) { + return '\Illuminate\Database\Eloquent\Collection'; + } + + /** @var \Illuminate\Database\Eloquent\Model $model */ + $model = new $className(); + return '\\' . get_class($model->newCollection()); + } + + /** + * Returns the available relation types + */ + protected function getRelationTypes(): array + { + $configuredRelations = $this->laravel['config']->get('ide-helper.additional_relation_types', []); + return array_merge(self::RELATION_TYPES, $configuredRelations); + } + + /** + * @return bool + */ + protected function hasCamelCaseModelProperties() + { + return $this->laravel['config']->get('ide-helper.model_camel_case_properties', false); + } + + protected function getAttributeReturnType(Model $model, string $method): Collection + { + /** @var Attribute $attribute */ + $attribute = $model->{$method}(); + + return collect([ + 'get' => $attribute->get ? optional(new \ReflectionFunction($attribute->get))->getReturnType() : null, + 'set' => $attribute->set ? optional(new \ReflectionFunction($attribute->set))->getReturnType() : null, + ]) + ->filter() + ->map(function ($type) { + if ($type instanceof \ReflectionUnionType) { + $types =collect($type->getTypes()) + /** @var ReflectionType $reflectionType */ + ->map(function ($reflectionType) { + return collect($this->extractReflectionTypes($reflectionType)); + }) + ->flatten(); + } else { + $types = collect($this->extractReflectionTypes($type)); + } + + if ($type->allowsNull()) { + $types->push('null'); + } + + return $types->join('|'); + }); + } + + protected function getReturnType(\ReflectionMethod $reflection): ?string + { + $type = $this->getReturnTypeFromDocBlock($reflection); + if ($type) { + return $type; + } + + return $this->getReturnTypeFromReflection($reflection); + } + + /** + * Get method comment based on it DocBlock comment + * + * @param \ReflectionMethod $reflection + * + * @return null|string + */ + protected function getCommentFromDocBlock(\ReflectionMethod $reflection) + { + $phpDocContext = (new ContextFactory())->createFromReflector($reflection); + $context = new Context( + $phpDocContext->getNamespace(), + $phpDocContext->getNamespaceAliases() + ); + $comment = ''; + $phpdoc = new DocBlock($reflection, $context); + + if ($phpdoc->hasTag('comment')) { + $comment = $phpdoc->getTagsByName('comment')[0]->getContent(); + } + + return $comment; + } + + /** + * Get method return type based on it DocBlock comment + * + * @param \ReflectionMethod $reflection + * + * @return null|string + */ + protected function getReturnTypeFromDocBlock(\ReflectionMethod $reflection, \Reflector $reflectorForContext = null) + { + $phpDocContext = (new ContextFactory())->createFromReflector($reflectorForContext ?? $reflection); + $context = new Context( + $phpDocContext->getNamespace(), + $phpDocContext->getNamespaceAliases() + ); + $type = null; + $phpdoc = new DocBlock($reflection, $context); + + if ($phpdoc->hasTag('return')) { + $type = $phpdoc->getTagsByName('return')[0]->getType(); + } + + return $type; + } + + protected function getReturnTypeFromReflection(\ReflectionMethod $reflection): ?string + { + $returnType = $reflection->getReturnType(); + if (!$returnType) { + return null; + } + + $types = $this->extractReflectionTypes($returnType); + + $type = implode('|', $types); + + if ($returnType->allowsNull()) { + $type .='|null'; + } + + return $type; + } + + + /** + * Generates methods provided by the SoftDeletes trait + * @param \Illuminate\Database\Eloquent\Model $model + */ + protected function getSoftDeleteMethods($model) + { + $traits = class_uses_recursive($model); + if (in_array('Illuminate\\Database\\Eloquent\\SoftDeletes', $traits)) { + $modelName = $this->getClassNameInDestinationFile($model, get_class($model)); + $builder = $this->getClassNameInDestinationFile($model, \Illuminate\Database\Query\Builder::class); + $this->setMethod('withTrashed', $builder . '|' . $modelName, []); + $this->setMethod('withoutTrashed', $builder . '|' . $modelName, []); + $this->setMethod('onlyTrashed', $builder . '|' . $modelName, []); + } + } + + /** + * Generate factory method from "HasFactory" trait. + * + * @param \Illuminate\Database\Eloquent\Model $model + */ + protected function getFactoryMethods($model) + { + if (!class_exists(Factory::class)) { + return; + } + + $modelName = get_class($model); + + + $traits = class_uses_recursive($modelName); + if (!in_array('Illuminate\\Database\\Eloquent\\Factories\\HasFactory', $traits)) { + return; + } + + if ($modelName::newFactory()) { + $factory = get_class($modelName::newFactory()); + } else { + $factory = Factory::resolveFactoryName($modelName); + } + + $factory = '\\' . trim($factory, '\\'); + + if (!class_exists($factory)) { + return; + } + + $this->setMethod('factory', $factory, ['...$parameters']); + } + + /** + * Generates methods that return collections + * @param \Illuminate\Database\Eloquent\Model $model + */ + protected function getCollectionMethods($model) + { + $collectionClass = $this->getCollectionClass(get_class($model)); + + if ($collectionClass !== '\\' . \Illuminate\Database\Eloquent\Collection::class) { + $collectionClassInModel = $this->getClassNameInDestinationFile($model, $collectionClass); + + $this->setMethod('get', $collectionClassInModel . '|static[]', ['$columns = [\'*\']']); + $this->setMethod('all', $collectionClassInModel . '|static[]', ['$columns = [\'*\']']); + } + } + + /** + * @param ReflectionClass $reflection + * @return string + */ + protected function getClassKeyword(ReflectionClass $reflection) + { + if ($reflection->isFinal()) { + $keyword = 'final '; + } elseif ($reflection->isAbstract()) { + $keyword = 'abstract '; + } else { + $keyword = ''; + } + + return $keyword; + } + + protected function checkForCastableCasts(string $type, array $params = []): string + { + if (!class_exists($type) || !interface_exists(Castable::class)) { + return $type; + } + + $reflection = new \ReflectionClass($type); + + if (!$reflection->implementsInterface(Castable::class)) { + return $type; + } + + $cast = call_user_func([$type, 'castUsing'], $params); + + if (is_string($cast) && !is_object($cast)) { + return $cast; + } + + $castReflection = new ReflectionObject($cast); + + $methodReflection = $castReflection->getMethod('get'); + + return $this->getReturnTypeFromReflection($methodReflection) ?? + $this->getReturnTypeFromDocBlock($methodReflection, $reflection) ?? + 'mixed'; + } + + /** + * @param string $type + * @return string|null + * @throws \ReflectionException + */ + protected function checkForCustomLaravelCasts(string $type): ?string + { + if (!class_exists($type) || !interface_exists(CastsAttributes::class)) { + return $type; + } + + $reflection = new \ReflectionClass($type); + + if (!$reflection->implementsInterface(CastsAttributes::class)) { + return $type; + } + + $methodReflection = new \ReflectionMethod($type, 'get'); + + $reflectionType = $this->getReturnTypeFromReflection($methodReflection); + + if ($reflectionType === null) { + $reflectionType = $this->getReturnTypeFromDocBlock($methodReflection); + } + + if ($reflectionType === 'static' || $reflectionType === '$this') { + $reflectionType = $type; + } + + return $reflectionType; + } + + protected function getTypeInModel(object $model, ?string $type): ?string + { + if ($type === null) { + return null; + } + + if (class_exists($type)) { + $type = $this->getClassNameInDestinationFile($model, $type); + } + + return $type; + } + + protected function getClassNameInDestinationFile(object $model, string $className): string + { + $reflection = $model instanceof ReflectionClass + ? $model + : new ReflectionObject($model) + ; + + $className = trim($className, '\\'); + $writingToExternalFile = !$this->write || $this->write_mixin; + $classIsNotInExternalFile = $reflection->getName() !== $className; + $forceFQCN = $this->laravel['config']->get('ide-helper.force_fqn', false); + + if (($writingToExternalFile && $classIsNotInExternalFile) || $forceFQCN) { + return '\\' . $className; + } + + $usedClassNames = $this->getUsedClassNames($reflection); + return $usedClassNames[$className] ?? ('\\' . $className); + } + + /** + * @param ReflectionClass $reflection + * @return string[] + */ + protected function getUsedClassNames(ReflectionClass $reflection): array + { + $namespaceAliases = array_flip((new ContextFactory())->createFromReflector($reflection)->getNamespaceAliases()); + $namespaceAliases[$reflection->getName()] = $reflection->getShortName(); + + return $namespaceAliases; + } + + protected function writeModelExternalBuilderMethods(Model $model): void + { + $fullBuilderClass = '\\' . get_class($model->newModelQuery()); + $newBuilderMethods = get_class_methods($fullBuilderClass); + $originalBuilderMethods = get_class_methods('\Illuminate\Database\Eloquent\Builder'); + + // diff the methods between the new builder and original one + // and create helpers for the ones that are new + $newMethodsFromNewBuilder = array_diff($newBuilderMethods, $originalBuilderMethods); + + if (!$newMethodsFromNewBuilder) { + return; + } + + // after we have retrieved the builder's methods + // get the class of the builder based on the FQCN option + $builderClassBasedOnFQCNOption = $this->getClassNameInDestinationFile($model, get_class($model->newModelQuery())); + + foreach ($newMethodsFromNewBuilder as $builderMethod) { + $reflection = new \ReflectionMethod($fullBuilderClass, $builderMethod); + $args = $this->getParameters($reflection); + + $this->setMethod( + $builderMethod, + $builderClassBasedOnFQCNOption . '|' . $this->getClassNameInDestinationFile($model, get_class($model)), + $args + ); + } + } + + protected function getParamType(\ReflectionMethod $method, \ReflectionParameter $parameter): ?string + { + if ($paramType = $parameter->getType()) { + $types = $this->extractReflectionTypes($paramType); + + $type = implode('|', $types); + + if ($paramType->allowsNull()) { + if (count($types)==1) { + $type = '?' . $type; + } else { + $type .='|null'; + } + } + + return $type; + } + + $docComment = $method->getDocComment(); + + if (!$docComment) { + return null; + } + + preg_match( + '/@param ((?:(?:[\w?|\\\\<>])+(?:\[])?)+)/', + $docComment ?? '', + $matches + ); + $type = $matches[1] ?? ''; + + if (strpos($type, '|') !== false) { + $types = explode('|', $type); + + // if we have more than 2 types + // we return null as we cannot use unions in php yet + if (count($types) > 2) { + return null; + } + + $hasNull = false; + + foreach ($types as $currentType) { + if ($currentType === 'null') { + $hasNull = true; + continue; + } + + // if we didn't find null assign the current type to the type we want + $type = $currentType; + } + + // if we haven't found null type set + // we return null as we cannot use unions with different types yet + if (!$hasNull) { + return null; + } + + $type = '?' . $type; + } + + // convert to proper type hint types in php + $type = str_replace(['boolean', 'integer'], ['bool', 'int'], $type); + + $allowedTypes = [ + 'int', + 'bool', + 'string', + 'float', + ]; + + // we replace the ? with an empty string so we can check the actual type + if (!in_array(str_replace('?', '', $type), $allowedTypes)) { + return null; + } + + // if we have a match on index 1 + // then we have found the type of the variable if not we return null + return $type; + } + + protected function extractReflectionTypes(ReflectionType $reflection_type) + { + if ($reflection_type instanceof ReflectionNamedType) { + $types[] = $this->getReflectionNamedType($reflection_type); + } else { + $types = []; + foreach ($reflection_type->getTypes() as $named_type) { + if ($named_type->getName()==='null') { + continue; + } + + $types[] = $this->getReflectionNamedType($named_type); + } + } + + return $types; + } + + protected function getReflectionNamedType(ReflectionNamedType $paramType): string + { + $parameterName = $paramType->getName(); + if (!$paramType->isBuiltin()) { + $parameterName = '\\' . $parameterName; + } + + return $parameterName; + } + + /** + * @param \Illuminate\Database\Eloquent\Model $model + * @throws \Illuminate\Contracts\Container\BindingResolutionException + * @throws \RuntimeException + */ + protected function runModelHooks($model): void + { + $hooks = $this->laravel['config']->get('ide-helper.model_hooks', []); + + foreach ($hooks as $hook) { + $hookInstance = $this->laravel->make($hook); + + if (!$hookInstance instanceof ModelHookInterface) { + throw new \RuntimeException( + 'Your IDE helper model hook must implement Barryvdh\LaravelIdeHelper\Contracts\ModelHookInterface' + ); + } + + $hookInstance->run($this, $model); + } + } + + /** + * @param \Doctrine\DBAL\Schema\AbstractSchemaManager $schema + * @param string $table + * @throws DBALException + */ + protected function setForeignKeys($schema, $table) + { + foreach ($schema->listTableForeignKeys($table) as $foreignKeyConstraint) { + foreach ($foreignKeyConstraint->getLocalColumns() as $columnName) { + $this->foreignKeyConstraintsColumns[] = $columnName; + } + } + } +} diff --git a/vendor/barryvdh/laravel-ide-helper/src/Contracts/ModelHookInterface.php b/vendor/barryvdh/laravel-ide-helper/src/Contracts/ModelHookInterface.php new file mode 100644 index 00000000..52124704 --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/src/Contracts/ModelHookInterface.php @@ -0,0 +1,11 @@ + + */ + +namespace Barryvdh\LaravelIdeHelper; + +use Barryvdh\Reflection\DocBlock; +use Barryvdh\Reflection\DocBlock\Context; +use Barryvdh\Reflection\DocBlock\Serializer as DocBlockSerializer; +use Barryvdh\Reflection\DocBlock\Tag; +use Illuminate\Console\Command; +use Illuminate\Filesystem\Filesystem; + +class Eloquent +{ + /** + * Write mixin helper to the Eloquent\Model + * This is needed since laravel/framework v5.4.29 + * + * @param Command $command + * @param Filesystem $files + * + * @return void + */ + public static function writeEloquentModelHelper(Command $command, Filesystem $files) + { + $class = 'Illuminate\Database\Eloquent\Model'; + + $reflection = new \ReflectionClass($class); + $namespace = $reflection->getNamespaceName(); + $originalDoc = $reflection->getDocComment(); + + if (!$originalDoc) { + $command->info('Unexpected no document on ' . $class); + } + $phpdoc = new DocBlock($reflection, new Context($namespace)); + + $mixins = $phpdoc->getTagsByName('mixin'); + $expectedMixins = [ + '\Eloquent' => false, + '\Illuminate\Database\Eloquent\Builder' => false, + '\Illuminate\Database\Query\Builder' => false, + ]; + + foreach ($mixins as $m) { + $mixin = $m->getContent(); + + if (isset($expectedMixins[$mixin])) { + $command->info('Tag Exists: @mixin ' . $mixin . ' in ' . $class); + + $expectedMixins[$mixin] = true; + } + } + + $changed = false; + foreach ($expectedMixins as $expectedMixin => $present) { + if ($present === false) { + $phpdoc->appendTag(Tag::createInstance('@mixin ' . $expectedMixin, $phpdoc)); + + $changed = true; + } + } + + // If nothing's changed, stop here. + if (!$changed) { + return; + } + + $serializer = new DocBlockSerializer(); + $serializer->getDocComment($phpdoc); + $docComment = $serializer->getDocComment($phpdoc); + + /* + The new DocBlock is appended to the beginning of the class declaration. + Since there is no DocBlock, the declaration is used as a guide. + */ + if (!$originalDoc) { + $originalDoc = 'abstract class Model implements'; + + $docComment .= "\nabstract class Model implements"; + } + + $filename = $reflection->getFileName(); + if (!$filename) { + $command->error('Filename not found ' . $class); + return; + } + + $contents = $files->get($filename); + if (!$contents) { + $command->error('No file contents found ' . $filename); + return; + } + + $count = 0; + $contents = str_replace($originalDoc, $docComment, $contents, $count); + if ($count <= 0) { + $command->error('Content did not change ' . $contents); + return; + } + + if (!$files->put($filename, $contents)) { + $command->error('File write failed to ' . $filename); + return; + } + + $command->info('Wrote expected docblock to ' . $filename); + } +} diff --git a/vendor/barryvdh/laravel-ide-helper/src/Factories.php b/vendor/barryvdh/laravel-ide-helper/src/Factories.php new file mode 100644 index 00000000..97d91ef0 --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/src/Factories.php @@ -0,0 +1,36 @@ +getProperty('definitions'); + $definitions->setAccessible(true); + + foreach ($definitions->getValue($factory) as $factory_target => $config) { + try { + $factories[] = new ReflectionClass($factory_target); + } catch (Exception $exception) { + } + } + } + + return $factories; + } + + protected static function isLaravelSevenOrLower() + { + return class_exists('Illuminate\Database\Eloquent\Factory'); + } +} diff --git a/vendor/barryvdh/laravel-ide-helper/src/Generator.php b/vendor/barryvdh/laravel-ide-helper/src/Generator.php new file mode 100644 index 00000000..9f0438fd --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/src/Generator.php @@ -0,0 +1,313 @@ + + * @copyright 2014 Barry vd. Heuvel / Fruitcake Studio (http://www.fruitcakestudio.nl) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link https://github.com/barryvdh/laravel-ide-helper + */ + +namespace Barryvdh\LaravelIdeHelper; + +use Illuminate\Foundation\AliasLoader; +use Illuminate\Support\Collection; +use Illuminate\Support\Str; +use Illuminate\Support\Traits\Macroable; +use ReflectionClass; +use Symfony\Component\Console\Output\OutputInterface; + +class Generator +{ + /** @var \Illuminate\Config\Repository */ + protected $config; + + /** @var \Illuminate\View\Factory */ + protected $view; + + /** @var \Symfony\Component\Console\Output\OutputInterface */ + protected $output; + + protected $extra = []; + protected $magic = []; + protected $interfaces = []; + protected $helpers; + + /** + * @param \Illuminate\Config\Repository $config + * @param \Illuminate\View\Factory $view + * @param \Symfony\Component\Console\Output\OutputInterface $output + * @param string $helpers + */ + public function __construct( + /*ConfigRepository */ + $config, + /* Illuminate\View\Factory */ + $view, + OutputInterface $output = null, + $helpers = '' + ) { + $this->config = $config; + $this->view = $view; + + // Find the drivers to add to the extra/interfaces + $this->detectDrivers(); + + $this->extra = array_merge($this->extra, $this->config->get('ide-helper.extra'), []); + $this->magic = array_merge($this->magic, $this->config->get('ide-helper.magic'), []); + $this->interfaces = array_merge($this->interfaces, $this->config->get('ide-helper.interfaces'), []); + // Make all interface classes absolute + foreach ($this->interfaces as &$interface) { + $interface = '\\' . ltrim($interface, '\\'); + } + $this->helpers = $helpers; + } + + /** + * Generate the helper file contents; + * + * @return string; + */ + public function generate() + { + $app = app(); + return $this->view->make('helper') + ->with('namespaces_by_extends_ns', $this->getAliasesByExtendsNamespace()) + ->with('namespaces_by_alias_ns', $this->getAliasesByAliasNamespace()) + ->with('helpers', $this->helpers) + ->with('version', $app->version()) + ->with('include_fluent', $this->config->get('ide-helper.include_fluent', true)) + ->with('factories', $this->config->get('ide-helper.include_factory_builders') ? Factories::all() : []) + ->render(); + } + + protected function detectDrivers() + { + $defaultUserModel = config('auth.providers.users.model', config('auth.model', 'App\User')); + $this->interfaces['\Illuminate\Contracts\Auth\Authenticatable'] = $defaultUserModel; + + try { + if ( + class_exists('Auth') && is_a('Auth', '\Illuminate\Support\Facades\Auth', true) + && app()->bound('auth') + ) { + $class = get_class(\Auth::guard()); + $this->extra['Auth'] = [$class]; + $this->interfaces['\Illuminate\Auth\UserProviderInterface'] = $class; + } + } catch (\Exception $e) { + } + + try { + if (class_exists('DB') && is_a('DB', '\Illuminate\Support\Facades\DB', true)) { + $class = get_class(\DB::connection()); + $this->extra['DB'] = [$class]; + $this->interfaces['\Illuminate\Database\ConnectionInterface'] = $class; + } + } catch (\Exception $e) { + } + + try { + if (class_exists('Cache') && is_a('Cache', '\Illuminate\Support\Facades\Cache', true)) { + $driver = get_class(\Cache::driver()); + $store = get_class(\Cache::getStore()); + $this->extra['Cache'] = [$driver, $store]; + $this->interfaces['\Illuminate\Cache\StoreInterface'] = $store; + } + } catch (\Exception $e) { + } + + try { + if (class_exists('Queue') && is_a('Queue', '\Illuminate\Support\Facades\Queue', true)) { + $class = get_class(\Queue::connection()); + $this->extra['Queue'] = [$class]; + $this->interfaces['\Illuminate\Queue\QueueInterface'] = $class; + } + } catch (\Exception $e) { + } + + try { + if (class_exists('SSH') && is_a('SSH', '\Illuminate\Support\Facades\SSH', true)) { + $class = get_class(\SSH::connection()); + $this->extra['SSH'] = [$class]; + $this->interfaces['\Illuminate\Remote\ConnectionInterface'] = $class; + } + } catch (\Exception $e) { + } + + try { + if (class_exists('Storage') && is_a('Storage', '\Illuminate\Support\Facades\Storage', true)) { + $class = get_class(\Storage::disk()); + $this->extra['Storage'] = [$class]; + $this->interfaces['\Illuminate\Contracts\Filesystem\Filesystem'] = $class; + } + } catch (\Exception $e) { + } + } + + /** + * Find all aliases that are valid for us to render + * + * @return Collection + */ + protected function getValidAliases() + { + $aliases = new Collection(); + + // Get all aliases + foreach ($this->getAliases() as $name => $facade) { + // Skip the Redis facade, if not available (otherwise Fatal PHP Error) + if ($facade == 'Illuminate\Support\Facades\Redis' && $name == 'Redis' && !class_exists('Predis\Client')) { + continue; + } + + $magicMethods = array_key_exists($name, $this->magic) ? $this->magic[$name] : []; + $alias = new Alias($this->config, $name, $facade, $magicMethods, $this->interfaces); + if ($alias->isValid()) { + //Add extra methods, from other classes (magic static calls) + if (array_key_exists($name, $this->extra)) { + $alias->addClass($this->extra[$name]); + } + + $aliases[] = $alias; + } + } + + return $aliases; + } + + /** + * Regroup aliases by namespace of extended classes + * + * @return Collection + */ + protected function getAliasesByExtendsNamespace() + { + $aliases = $this->getValidAliases(); + + $this->addMacroableClasses($aliases); + + return $aliases->groupBy(function (Alias $alias) { + return $alias->getExtendsNamespace(); + }); + } + + /** + * Regroup aliases by namespace of alias + * + * @return Collection + */ + protected function getAliasesByAliasNamespace() + { + return $this->getValidAliases()->groupBy(function (Alias $alias) { + return $alias->getNamespace(); + }); + } + + protected function getAliases() + { + // For Laravel, use the AliasLoader + if (class_exists('Illuminate\Foundation\AliasLoader')) { + return AliasLoader::getInstance()->getAliases(); + } + + $facades = [ + 'App' => 'Illuminate\Support\Facades\App', + 'Auth' => 'Illuminate\Support\Facades\Auth', + 'Bus' => 'Illuminate\Support\Facades\Bus', + 'DB' => 'Illuminate\Support\Facades\DB', + 'Cache' => 'Illuminate\Support\Facades\Cache', + 'Cookie' => 'Illuminate\Support\Facades\Cookie', + 'Crypt' => 'Illuminate\Support\Facades\Crypt', + 'Event' => 'Illuminate\Support\Facades\Event', + 'Hash' => 'Illuminate\Support\Facades\Hash', + 'Log' => 'Illuminate\Support\Facades\Log', + 'Mail' => 'Illuminate\Support\Facades\Mail', + 'Queue' => 'Illuminate\Support\Facades\Queue', + 'Request' => 'Illuminate\Support\Facades\Request', + 'Schema' => 'Illuminate\Support\Facades\Schema', + 'Session' => 'Illuminate\Support\Facades\Session', + 'Storage' => 'Illuminate\Support\Facades\Storage', + 'Validator' => 'Illuminate\Support\Facades\Validator', + 'Gate' => 'Illuminate\Support\Facades\Gate', + ]; + + $facades = array_merge($facades, $this->config->get('app.aliases', [])); + + // Only return the ones that actually exist + return array_filter( + $facades, + function ($alias) { + return class_exists($alias); + }, + ARRAY_FILTER_USE_KEY + ); + } + + /** + * Write a string as error output. + * + * @param string $string + * @return void + */ + protected function error($string) + { + if ($this->output) { + $this->output->writeln("$string"); + } else { + echo $string . "\r\n"; + } + } + + /** + * Add all macroable classes which are not already loaded as an alias and have defined macros. + * + * @param Collection $aliases + */ + protected function addMacroableClasses(Collection $aliases) + { + $macroable = $this->getMacroableClasses($aliases); + + foreach ($macroable as $class) { + $reflection = new ReflectionClass($class); + + if (!$reflection->getStaticProperties()['macros']) { + continue; + } + + $aliases[] = new Alias($this->config, $class, $class, [], $this->interfaces); + } + } + + /** + * Get all loaded macroable classes which are not loaded as an alias. + * + * @param Collection $aliases + * @return Collection + */ + protected function getMacroableClasses(Collection $aliases) + { + return (new Collection(get_declared_classes())) + ->filter(function ($class) { + $reflection = new ReflectionClass($class); + + // Filter out internal classes and class aliases + return !$reflection->isInternal() && $reflection->getName() === $class; + }) + ->filter(function ($class) { + $traits = class_uses_recursive($class); + + // Filter only classes with the macroable trait + return isset($traits[Macroable::class]); + }) + ->filter(function ($class) use ($aliases) { + $class = Str::start($class, '\\'); + + // Filter out aliases + return !$aliases->first(function (Alias $alias) use ($class) { + return $alias->getExtends() === $class; + }); + }); + } +} diff --git a/vendor/barryvdh/laravel-ide-helper/src/IdeHelperServiceProvider.php b/vendor/barryvdh/laravel-ide-helper/src/IdeHelperServiceProvider.php new file mode 100644 index 00000000..13b573f1 --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/src/IdeHelperServiceProvider.php @@ -0,0 +1,130 @@ + + * @copyright 2014 Barry vd. Heuvel / Fruitcake Studio (http://www.fruitcakestudio.nl) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link https://github.com/barryvdh/laravel-ide-helper + */ + +namespace Barryvdh\LaravelIdeHelper; + +use Barryvdh\LaravelIdeHelper\Console\EloquentCommand; +use Barryvdh\LaravelIdeHelper\Console\GeneratorCommand; +use Barryvdh\LaravelIdeHelper\Console\MetaCommand; +use Barryvdh\LaravelIdeHelper\Console\ModelsCommand; +use Barryvdh\LaravelIdeHelper\Listeners\GenerateModelHelper; +use Illuminate\Console\Events\CommandFinished; +use Illuminate\Contracts\Support\DeferrableProvider; +use Illuminate\Database\Events\MigrationsEnded; +use Illuminate\Support\ServiceProvider; +use Illuminate\View\Engines\EngineResolver; +use Illuminate\View\Engines\PhpEngine; +use Illuminate\View\Factory; +use Illuminate\View\FileViewFinder; + +class IdeHelperServiceProvider extends ServiceProvider implements DeferrableProvider +{ + /** + * Bootstrap the application events. + * + * @return void + */ + public function boot() + { + if (!$this->app->runningUnitTests() && $this->app['config']->get('ide-helper.post_migrate', [])) { + $this->app['events']->listen(CommandFinished::class, GenerateModelHelper::class); + $this->app['events']->listen(MigrationsEnded::class, function () { + GenerateModelHelper::$shouldRun = true; + }); + } + + if ($this->app->has('view')) { + $viewPath = __DIR__ . '/../resources/views'; + $this->loadViewsFrom($viewPath, 'ide-helper'); + } + + $configPath = __DIR__ . '/../config/ide-helper.php'; + if (function_exists('config_path')) { + $publishPath = config_path('ide-helper.php'); + } else { + $publishPath = base_path('config/ide-helper.php'); + } + $this->publishes([$configPath => $publishPath], 'config'); + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() + { + $configPath = __DIR__ . '/../config/ide-helper.php'; + $this->mergeConfigFrom($configPath, 'ide-helper'); + $localViewFactory = $this->createLocalViewFactory(); + + $this->app->singleton( + 'command.ide-helper.generate', + function ($app) use ($localViewFactory) { + return new GeneratorCommand($app['config'], $app['files'], $localViewFactory); + } + ); + + $this->app->singleton( + 'command.ide-helper.models', + function ($app) { + return new ModelsCommand($app['files']); + } + ); + + $this->app->singleton( + 'command.ide-helper.meta', + function ($app) use ($localViewFactory) { + return new MetaCommand($app['files'], $localViewFactory, $app['config']); + } + ); + + $this->app->singleton( + 'command.ide-helper.eloquent', + function ($app) { + return new EloquentCommand($app['files']); + } + ); + + $this->commands( + 'command.ide-helper.generate', + 'command.ide-helper.models', + 'command.ide-helper.meta', + 'command.ide-helper.eloquent' + ); + } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() + { + return ['command.ide-helper.generate', 'command.ide-helper.models']; + } + + /** + * @return Factory + */ + private function createLocalViewFactory() + { + $resolver = new EngineResolver(); + $resolver->register('php', function () { + return new PhpEngine($this->app['files']); + }); + $finder = new FileViewFinder($this->app['files'], [__DIR__ . '/../resources/views']); + $factory = new Factory($resolver, $finder, $this->app['events']); + $factory->addExtension('php', 'php'); + + return $factory; + } +} diff --git a/vendor/barryvdh/laravel-ide-helper/src/Listeners/GenerateModelHelper.php b/vendor/barryvdh/laravel-ide-helper/src/Listeners/GenerateModelHelper.php new file mode 100644 index 00000000..86e2bd4b --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/src/Listeners/GenerateModelHelper.php @@ -0,0 +1,52 @@ +artisan = $artisan; + $this->config = $config; + } + + /** + * Handle the event. + * + * @param CommandFinished $event + */ + public function handle(CommandFinished $event) + { + if (!self::$shouldRun) { + return; + } + + self::$shouldRun = false; + + foreach ($this->config->get('ide-helper.post_migrate', []) as $command) { + $this->artisan->call($command, [], $event->output); + } + } +} diff --git a/vendor/barryvdh/laravel-ide-helper/src/Macro.php b/vendor/barryvdh/laravel-ide-helper/src/Macro.php new file mode 100644 index 00000000..77cc5a6e --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/src/Macro.php @@ -0,0 +1,127 @@ +phpdoc = new DocBlock($method); + + $this->addLocationToPhpDoc(); + + // Add macro parameters if they are missed in original docblock + if (!$this->phpdoc->hasTag('param')) { + foreach ($method->getParameters() as $parameter) { + $reflectionType = $parameter->getType(); + + $type = $this->concatReflectionTypes($reflectionType); + + /** @psalm-suppress UndefinedClass */ + if ($reflectionType && !$reflectionType instanceof \ReflectionUnionType && $reflectionType->allowsNull()) { + $type .= '|null'; + } + + $type = $type ?: 'mixed'; + + $name = $parameter->isVariadic() ? '...' : ''; + $name .= '$' . $parameter->getName(); + + $this->phpdoc->appendTag(Tag::createInstance("@param {$type} {$name}")); + } + } + + // Add macro return type if it missed in original docblock + if ($method->hasReturnType() && !$this->phpdoc->hasTag('return')) { + $builder = EloquentBuilder::class; + $return = $method->getReturnType(); + + $type = $this->concatReflectionTypes($return); + + /** @psalm-suppress UndefinedClass */ + if (!$return instanceof \ReflectionUnionType) { + $type .= $this->root === "\\{$builder}" && $return->getName() === $builder ? '|static' : ''; + $type .= $return->allowsNull() ? '|null' : ''; + } + + $this->phpdoc->appendTag(Tag::createInstance("@return {$type}")); + } + } + + protected function concatReflectionTypes(?\ReflectionType $type): string + { + /** @psalm-suppress UndefinedClass */ + $returnTypes = $type instanceof \ReflectionUnionType + ? $type->getTypes() + : [$type]; + + return Collection::make($returnTypes) + ->filter() + ->map->getName() + ->implode('|'); + } + + protected function addLocationToPhpDoc() + { + if ($this->method->name === '__invoke') { + $enclosingClass = $this->method->getDeclaringClass(); + } else { + $enclosingClass = $this->method->getClosureScopeClass(); + } + + if (!$enclosingClass) { + return; + } + /** @var \ReflectionMethod $enclosingMethod */ + $enclosingMethod = Collection::make($enclosingClass->getMethods()) + ->first(function (\ReflectionMethod $method) { + return $method->getStartLine() <= $this->method->getStartLine() + && $method->getEndLine() >= $this->method->getEndLine(); + }); + + if ($enclosingMethod) { + $this->phpdoc->appendTag(Tag::createInstance( + '@see \\' . $enclosingClass->getName() . '::' . $enclosingMethod->getName() . '()' + )); + } + } + + /** + * @param \ReflectionFunctionAbstract $method + * @param \ReflectionClass $class + */ + protected function initClassDefinedProperties($method, \ReflectionClass $class) + { + $this->namespace = $class->getNamespaceName(); + $this->declaringClassName = '\\' . ltrim($class->name, '\\'); + } +} diff --git a/vendor/barryvdh/laravel-ide-helper/src/Method.php b/vendor/barryvdh/laravel-ide-helper/src/Method.php new file mode 100644 index 00000000..f7f7ffaa --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/src/Method.php @@ -0,0 +1,379 @@ + + * @copyright 2014 Barry vd. Heuvel / Fruitcake Studio (http://www.fruitcakestudio.nl) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link https://github.com/barryvdh/laravel-ide-helper + */ + +namespace Barryvdh\LaravelIdeHelper; + +use Barryvdh\Reflection\DocBlock; +use Barryvdh\Reflection\DocBlock\Context; +use Barryvdh\Reflection\DocBlock\Serializer as DocBlockSerializer; +use Barryvdh\Reflection\DocBlock\Tag; +use Barryvdh\Reflection\DocBlock\Tag\ParamTag; +use Barryvdh\Reflection\DocBlock\Tag\ReturnTag; +use Illuminate\Database\Eloquent\Builder; +use Illuminate\Support\Str; + +class Method +{ + /** @var \Barryvdh\Reflection\DocBlock */ + protected $phpdoc; + + /** @var \ReflectionMethod */ + protected $method; + + protected $output = ''; + protected $declaringClassName; + protected $name; + protected $namespace; + protected $params = []; + protected $params_with_default = []; + protected $interfaces = []; + protected $real_name; + protected $return = null; + protected $root; + protected $classAliases; + + /** + * @param \ReflectionMethod|\ReflectionFunctionAbstract $method + * @param string $alias + * @param \ReflectionClass $class + * @param string|null $methodName + * @param array $interfaces + * @param array $classAliases + */ + public function __construct($method, $alias, $class, $methodName = null, $interfaces = [], array $classAliases = []) + { + $this->method = $method; + $this->interfaces = $interfaces; + $this->classAliases = $classAliases; + $this->name = $methodName ?: $method->name; + $this->real_name = $method->isClosure() ? $this->name : $method->name; + $this->initClassDefinedProperties($method, $class); + + //Reference the 'real' function in the declaring class + $this->root = '\\' . ltrim($method->name === '__invoke' ? $method->getDeclaringClass()->getName() : $class->getName(), '\\'); + + //Create a DocBlock and serializer instance + $this->initPhpDoc($method); + + //Normalize the description and inherit the docs from parents/interfaces + try { + $this->normalizeParams($this->phpdoc); + $this->normalizeReturn($this->phpdoc); + $this->normalizeDescription($this->phpdoc); + } catch (\Exception $e) { + } + + //Get the parameters, including formatted default values + $this->getParameters($method); + + //Make the method static + $this->phpdoc->appendTag(Tag::createInstance('@static', $this->phpdoc)); + } + + /** + * @param \ReflectionMethod $method + */ + protected function initPhpDoc($method) + { + $this->phpdoc = new DocBlock($method, new Context($this->namespace, $this->classAliases)); + } + + /** + * @param \ReflectionMethod $method + * @param \ReflectionClass $class + */ + protected function initClassDefinedProperties($method, \ReflectionClass $class) + { + $declaringClass = $method->getDeclaringClass(); + $this->namespace = $declaringClass->getNamespaceName(); + $this->declaringClassName = '\\' . ltrim($declaringClass->name, '\\'); + } + + /** + * Get the class wherein the function resides + * + * @return string + */ + public function getDeclaringClass() + { + return $this->declaringClassName; + } + + /** + * Return the class from which this function would be called + * + * @return string + */ + public function getRoot() + { + return $this->root; + } + + /** + * @return bool + */ + public function isInstanceCall() + { + return !($this->method->isClosure() || $this->method->isStatic()); + } + + /** + * @return string + */ + public function getRootMethodCall() + { + if ($this->isInstanceCall()) { + return "\$instance->{$this->getRealName()}({$this->getParams()})"; + } else { + return "{$this->getRoot()}::{$this->getRealName()}({$this->getParams()})"; + } + } + + /** + * Get the docblock for this method + * + * @param string $prefix + * @return mixed + */ + public function getDocComment($prefix = "\t\t") + { + $serializer = new DocBlockSerializer(1, $prefix); + return $serializer->getDocComment($this->phpdoc); + } + + /** + * Get the method name + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Get the real method name + * + * @return string + */ + public function getRealName() + { + return $this->real_name; + } + + /** + * Get the parameters for this method + * + * @param bool $implode Wether to implode the array or not + * @return string + */ + public function getParams($implode = true) + { + return $implode ? implode(', ', $this->params) : $this->params; + } + + /** + * Get the parameters for this method including default values + * + * @param bool $implode Wether to implode the array or not + * @return string + */ + public function getParamsWithDefault($implode = true) + { + return $implode ? implode(', ', $this->params_with_default) : $this->params_with_default; + } + + /** + * Get the description and get the inherited docs. + * + * @param DocBlock $phpdoc + */ + protected function normalizeDescription(DocBlock $phpdoc) + { + //Get the short + long description from the DocBlock + $description = $phpdoc->getText(); + + //Loop through parents/interfaces, to fill in {@inheritdoc} + if (strpos($description, '{@inheritdoc}') !== false) { + $inheritdoc = $this->getInheritDoc($this->method); + $inheritDescription = $inheritdoc->getText(); + + $description = str_replace('{@inheritdoc}', $inheritDescription, $description); + $phpdoc->setText($description); + + $this->normalizeParams($inheritdoc); + $this->normalizeReturn($inheritdoc); + + //Add the tags that are inherited + $inheritTags = $inheritdoc->getTags(); + if ($inheritTags) { + /** @var Tag $tag */ + foreach ($inheritTags as $tag) { + $tag->setDocBlock(); + $phpdoc->appendTag($tag); + } + } + } + } + + /** + * Normalize the parameters + * + * @param DocBlock $phpdoc + */ + protected function normalizeParams(DocBlock $phpdoc) + { + //Get the return type and adjust them for beter autocomplete + $paramTags = $phpdoc->getTagsByName('param'); + if ($paramTags) { + /** @var ParamTag $tag */ + foreach ($paramTags as $tag) { + // Convert the keywords + $content = $this->convertKeywords($tag->getContent()); + $tag->setContent($content); + + // Get the expanded type and re-set the content + $content = $tag->getType() . ' ' . $tag->getVariableName() . ' ' . $tag->getDescription(); + $tag->setContent(trim($content)); + } + } + } + + /** + * Normalize the return tag (make full namespace, replace interfaces) + * + * @param DocBlock $phpdoc + */ + protected function normalizeReturn(DocBlock $phpdoc) + { + //Get the return type and adjust them for better autocomplete + $returnTags = $phpdoc->getTagsByName('return'); + + if (count($returnTags) === 0) { + $this->return = null; + return; + } + + /** @var ReturnTag $tag */ + $tag = reset($returnTags); + // Get the expanded type + $returnValue = $tag->getType(); + + // Replace the interfaces + foreach ($this->interfaces as $interface => $real) { + $returnValue = str_replace($interface, $real, $returnValue); + } + + // Set the changed content + $tag->setContent($returnValue . ' ' . $tag->getDescription()); + $this->return = $returnValue; + + if ($tag->getType() === '$this') { + Str::contains($this->root, Builder::class) + ? $tag->setType($this->root . '|static') + : $tag->setType($this->root); + } + } + + /** + * Convert keywords that are incorrect. + * + * @param string $string + * @return string + */ + protected function convertKeywords($string) + { + $string = str_replace('\Closure', 'Closure', $string); + $string = str_replace('Closure', '\Closure', $string); + $string = str_replace('dynamic', 'mixed', $string); + + return $string; + } + + /** + * Should the function return a value? + * + * @return bool + */ + public function shouldReturn() + { + if ($this->return !== 'void' && $this->method->name !== '__construct') { + return true; + } + + return false; + } + + /** + * Get the parameters and format them correctly + * + * @param \ReflectionMethod $method + * @return void + */ + public function getParameters($method) + { + //Loop through the default values for parameters, and make the correct output string + $params = []; + $paramsWithDefault = []; + foreach ($method->getParameters() as $param) { + $paramStr = $param->isVariadic() ? '...$' . $param->getName() : '$' . $param->getName(); + $params[] = $paramStr; + if ($param->isOptional() && !$param->isVariadic()) { + $default = $param->isDefaultValueAvailable() ? $param->getDefaultValue() : null; + if (is_bool($default)) { + $default = $default ? 'true' : 'false'; + } elseif (is_array($default)) { + $default = '[]'; + } elseif (is_null($default)) { + $default = 'null'; + } elseif (is_int($default)) { + //$default = $default; + } elseif (is_resource($default)) { + //skip to not fail + } else { + $default = var_export($default, true); + } + $paramStr .= " = $default"; + } + $paramsWithDefault[] = $paramStr; + } + + $this->params = $params; + $this->params_with_default = $paramsWithDefault; + } + + /** + * @param \ReflectionMethod $reflectionMethod + * @return DocBlock + */ + protected function getInheritDoc($reflectionMethod) + { + $parentClass = $reflectionMethod->getDeclaringClass()->getParentClass(); + + //Get either a parent or the interface + if ($parentClass) { + $method = $parentClass->getMethod($reflectionMethod->getName()); + } else { + $method = $reflectionMethod->getPrototype(); + } + if ($method) { + $namespace = $method->getDeclaringClass()->getNamespaceName(); + $phpdoc = new DocBlock($method, new Context($namespace, $this->classAliases)); + + if (strpos($phpdoc->getText(), '{@inheritdoc}') !== false) { + //Not at the end yet, try another parent/interface.. + return $this->getInheritDoc($method); + } + + return $phpdoc; + } + } +} diff --git a/vendor/barryvdh/laravel-ide-helper/src/UsesResolver.php b/vendor/barryvdh/laravel-ide-helper/src/UsesResolver.php new file mode 100644 index 00000000..205da9c6 --- /dev/null +++ b/vendor/barryvdh/laravel-ide-helper/src/UsesResolver.php @@ -0,0 +1,124 @@ + + * @copyright 2014 Barry vd. Heuvel / Fruitcake Studio (http://www.fruitcakestudio.nl) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link https://github.com/barryvdh/laravel-ide-helper + */ + +namespace Barryvdh\LaravelIdeHelper; + +use PhpParser\Node\Stmt\GroupUse; +use PhpParser\Node\Stmt\Namespace_; +use PhpParser\Node\Stmt\Use_; +use PhpParser\Node\Stmt\UseUse; +use PhpParser\ParserFactory; + +class UsesResolver +{ + /** + * @param string $classFQN + * @return array + */ + public function loadFromClass(string $classFQN): array + { + return $this->loadFromFile( + $classFQN, + (new \ReflectionClass($classFQN))->getFileName() + ); + } + + /** + * @param string $classFQN + * @param string $filename + * @return array + */ + public function loadFromFile(string $classFQN, string $filename): array + { + return $this->loadFromCode( + $classFQN, + file_get_contents( + $filename + ) + ); + } + + /** + * @param string $classFQN + * @param string $code + * @return array + */ + public function loadFromCode(string $classFQN, string $code): array + { + $classFQN = ltrim($classFQN, '\\'); + + $namespace = rtrim( + preg_replace( + '/([^\\\\]+)$/', + '', + $classFQN + ), + '\\' + ); + + $parser = (new ParserFactory())->create(ParserFactory::PREFER_PHP7); + $namespaceData = null; + + foreach ($parser->parse($code) as $node) { + if ($node instanceof Namespace_ && $node->name->toCodeString() === $namespace) { + $namespaceData = $node; + break; + } + } + + if ($namespaceData === null) { + return []; + } + + /** @var Namespace_ $namespaceData */ + + $aliases = []; + + foreach ($namespaceData->stmts as $stmt) { + if ($stmt instanceof Use_) { + if ($stmt->type !== Use_::TYPE_NORMAL) { + continue; + } + + foreach ($stmt->uses as $use) { + /** @var UseUse $use */ + + $alias = $use->alias ? + $use->alias->name : + self::classBasename($use->name->toCodeString()); + + $aliases[$alias] = '\\' . $use->name->toCodeString(); + } + } elseif ($stmt instanceof GroupUse) { + foreach ($stmt->uses as $use) { + /** @var UseUse $use */ + + $alias = $use->alias ? + $use->alias->name : + self::classBasename($use->name->toCodeString()); + + $aliases[$alias] = '\\' . $stmt->prefix->toCodeString() . '\\' . $use->name->toCodeString(); + } + } + } + + return $aliases; + } + + /** + * @param string $classFQN + * @return string + */ + protected static function classBasename(string $classFQN): string + { + return preg_replace('/^.*\\\\([^\\\\]+)$/', '$1', $classFQN); + } +} diff --git a/vendor/barryvdh/reflection-docblock/.github/workflows/run-tests.yml b/vendor/barryvdh/reflection-docblock/.github/workflows/run-tests.yml new file mode 100644 index 00000000..b272bec9 --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/.github/workflows/run-tests.yml @@ -0,0 +1,43 @@ +name: Unit Tests + +on: + push: + branches: + - master + pull_request: + branches: + - "*" + schedule: + - cron: '0 0 * * *' + +jobs: + php-tests: + runs-on: ubuntu-latest + timeout-minutes: 15 + env: + COMPOSER_NO_INTERACTION: 1 + + strategy: + matrix: + php: [8.1, 8.0, 7.4, 7.3, 7.2] + dependency-version: [prefer-lowest, prefer-stable] + + name: P${{ matrix.php }} - ${{ matrix.dependency-version }} + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + tools: composer:v2 + + - name: Install dependencies + run: | + composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress + + - name: Execute Unit Tests + run: vendor/bin/phpunit diff --git a/vendor/barryvdh/reflection-docblock/LICENSE b/vendor/barryvdh/reflection-docblock/LICENSE new file mode 100644 index 00000000..792e4040 --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2010 Mike van Riel + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/barryvdh/reflection-docblock/README.md b/vendor/barryvdh/reflection-docblock/README.md new file mode 100644 index 00000000..6405d1a1 --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/README.md @@ -0,0 +1,57 @@ +The ReflectionDocBlock Component [![Build Status](https://secure.travis-ci.org/phpDocumentor/ReflectionDocBlock.png)](https://travis-ci.org/phpDocumentor/ReflectionDocBlock) +================================ + +Introduction +------------ + +The ReflectionDocBlock component of phpDocumentor provides a DocBlock parser +that is 100% compatible with the [PHPDoc standard](http://phpdoc.org/docs/latest). + +With this component, a library can provide support for annotations via DocBlocks +or otherwise retrieve information that is embedded in a DocBlock. + +> **Note**: *this is a core component of phpDocumentor and is constantly being +> optimized for performance.* + +Installation +------------ + +You can install the component in the following ways: + +* Use the official Github repository (https://github.com/phpDocumentor/ReflectionDocBlock) +* Via Composer (http://packagist.org/packages/phpdocumentor/reflection-docblock) + +Usage +----- + +The ReflectionDocBlock component is designed to work in an identical fashion to +PHP's own Reflection extension (http://php.net/manual/en/book.reflection.php). + +Parsing can be initiated by instantiating the +`\phpDocumentor\Reflection\DocBlock()` class and passing it a string containing +a DocBlock (including asterisks) or by passing an object supporting the +`getDocComment()` method. + +> *Examples of objects having the `getDocComment()` method are the +> `ReflectionClass` and the `ReflectionMethod` classes of the PHP +> Reflection extension* + +Example: + + $class = new ReflectionClass('MyClass'); + $phpdoc = new \phpDocumentor\Reflection\DocBlock($class); + +or + + $docblock = <<=5.3.3" + }, + "autoload": { + "psr-0": {"Barryvdh": ["src/"]} + }, + "require-dev": { + "phpunit/phpunit": "^8.5.14|^9" + }, + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" + }, + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + } +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock.php new file mode 100644 index 00000000..92960605 --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock.php @@ -0,0 +1,485 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection; + +use Barryvdh\Reflection\DocBlock\Tag; +use Barryvdh\Reflection\DocBlock\Context; +use Barryvdh\Reflection\DocBlock\Location; + +/** + * Parses the DocBlock for any structure. + * + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class DocBlock implements \Reflector +{ + /** @var string The opening line for this docblock. */ + protected $short_description = ''; + + /** + * @var DocBlock\Description The actual + * description for this docblock. + */ + protected $long_description = null; + + /** + * @var Tag[] An array containing all + * the tags in this docblock; except inline. + */ + protected $tags = array(); + + /** @var Context Information about the context of this DocBlock. */ + protected $context = null; + + /** @var Location Information about the location of this DocBlock. */ + protected $location = null; + + /** @var bool Is this DocBlock (the start of) a template? */ + protected $isTemplateStart = false; + + /** @var bool Does this DocBlock signify the end of a DocBlock template? */ + protected $isTemplateEnd = false; + + /** + * Parses the given docblock and populates the member fields. + * + * The constructor may also receive namespace information such as the + * current namespace and aliases. This information is used by some tags + * (e.g. @return, @param, etc.) to turn a relative Type into a FQCN. + * + * @param \Reflector|string $docblock A docblock comment (including + * asterisks) or reflector supporting the getDocComment method. + * @param Context $context The context in which the DocBlock + * occurs. + * @param Location $location The location within the file that this + * DocBlock occurs in. + * + * @throws \InvalidArgumentException if the given argument does not have the + * getDocComment method. + */ + public function __construct( + $docblock, + Context $context = null, + Location $location = null + ) { + if (is_object($docblock)) { + if (!method_exists($docblock, 'getDocComment')) { + throw new \InvalidArgumentException( + 'Invalid object passed; the given reflector must support ' + . 'the getDocComment method' + ); + } + + $docblock = $docblock->getDocComment(); + } + + $docblock = $this->cleanInput($docblock); + + list($templateMarker, $short, $long, $tags) = $this->splitDocBlock($docblock); + $this->isTemplateStart = $templateMarker === '#@+'; + $this->isTemplateEnd = $templateMarker === '#@-'; + $this->short_description = $short; + $this->long_description = new DocBlock\Description($long, $this); + $this->parseTags($tags); + + $this->context = $context; + $this->location = $location; + } + + /** + * Strips the asterisks from the DocBlock comment. + * + * @param string $comment String containing the comment text. + * + * @return string + */ + protected function cleanInput($comment) + { + $comment = trim( + preg_replace( + '#[ \t]*(?:\/\*\*|\*\/|\*)?[ \t]{0,1}(.*)?#u', + '$1', + $comment + ) + ); + + // reg ex above is not able to remove */ from a single line docblock + if (substr($comment, -2) == '*/') { + $comment = trim(substr($comment, 0, -2)); + } + + // normalize strings + $comment = str_replace(array("\r\n", "\r"), "\n", $comment); + + return $comment; + } + + /** + * Splits the DocBlock into a template marker, summary, description and block of tags. + * + * @param string $comment Comment to split into the sub-parts. + * + * @author Richard van Velzen (@_richardJ) Special thanks to Richard for the regex responsible for the split. + * @author Mike van Riel for extending the regex with template marker support. + * + * @return string[] containing the template marker (if any), summary, description and a string containing the tags. + */ + protected function splitDocBlock($comment) + { + // Performance improvement cheat: if the first character is an @ then only tags are in this DocBlock. This + // method does not split tags so we return this verbatim as the fourth result (tags). This saves us the + // performance impact of running a regular expression + if (strpos($comment, '@') === 0) { + return array('', '', '', $comment); + } + + // clears all extra horizontal whitespace from the line endings to prevent parsing issues + $comment = preg_replace('/\h*$/Sum', '', $comment); + + /* + * Splits the docblock into a template marker, short description, long description and tags section + * + * - The template marker is empty, #@+ or #@- if the DocBlock starts with either of those (a newline may + * occur after it and will be stripped). + * - The short description is started from the first character until a dot is encountered followed by a + * newline OR two consecutive newlines (horizontal whitespace is taken into account to consider spacing + * errors). This is optional. + * - The long description, any character until a new line is encountered followed by an @ and word + * characters (a tag). This is optional. + * - Tags; the remaining characters + * + * Big thanks to RichardJ for contributing this Regular Expression + */ + preg_match( + '/ + \A + # 1. Extract the template marker + (?:(\#\@\+|\#\@\-)\n?)? + + # 2. Extract the summary + (?: + (?! @\pL ) # The summary may not start with an @ + ( + [^\n.]+ + (?: + (?! \. \n | \n{2} ) # End summary upon a dot followed by newline or two newlines + [\n.] (?! [ \t]* @\pL ) # End summary when an @ is found as first character on a new line + [^\n.]+ # Include anything else + )* + \.? + )? + ) + + # 3. Extract the description + (?: + \s* # Some form of whitespace _must_ precede a description because a summary must be there + (?! @\pL ) # The description may not start with an @ + ( + [^\n]+ + (?: \n+ + (?! [ \t]* @\pL ) # End description when an @ is found as first character on a new line + [^\n]+ # Include anything else + )* + ) + )? + + # 4. Extract the tags (anything that follows) + (\s+ [\s\S]*)? # everything that follows + /ux', + $comment, + $matches + ); + array_shift($matches); + + while (count($matches) < 4) { + $matches[] = ''; + } + + return $matches; + } + + /** + * Creates the tag objects. + * + * @param string $tags Tag block to parse. + * + * @return void + */ + protected function parseTags($tags) + { + $result = array(); + $tags = trim($tags); + if ('' !== $tags) { + if ('@' !== $tags[0]) { + throw new \LogicException( + 'A tag block started with text instead of an actual tag,' + . ' this makes the tag block invalid: ' . $tags + ); + } + foreach (explode("\n", $tags) as $tag_line) { + if (isset($tag_line[0]) && ($tag_line[0] === '@')) { + $result[] = $tag_line; + } else { + $result[count($result) - 1] .= "\n" . $tag_line; + } + } + + // create proper Tag objects + foreach ($result as $key => $tag_line) { + $result[$key] = Tag::createInstance(trim($tag_line), $this); + } + } + + $this->tags = $result; + } + + /** + * Gets the text portion of the doc block. + * + * Gets the text portion (short and long description combined) of the doc + * block. + * + * @return string The text portion of the doc block. + */ + public function getText() + { + $short = $this->getShortDescription(); + $long = $this->getLongDescription()->getContents(); + + if ($long) { + return "{$short}\n\n{$long}"; + } else { + return $short; + } + } + + /** + * Set the text portion of the doc block. + * + * Sets the text portion (short and long description combined) of the doc + * block. + * + * @param string $docblock The new text portion of the doc block. + * + * @return $this This doc block. + */ + public function setText($comment) + { + list(,$short, $long) = $this->splitDocBlock($comment); + $this->short_description = $short; + $this->long_description = new DocBlock\Description($long, $this); + return $this; + } + /** + * Returns the opening line or also known as short description. + * + * @return string + */ + public function getShortDescription() + { + return $this->short_description; + } + + /** + * Returns the full description or also known as long description. + * + * @return DocBlock\Description + */ + public function getLongDescription() + { + return $this->long_description; + } + + /** + * Returns whether this DocBlock is the start of a Template section. + * + * A Docblock may serve as template for a series of subsequent DocBlocks. This is indicated by a special marker + * (`#@+`) that is appended directly after the opening `/**` of a DocBlock. + * + * An example of such an opening is: + * + * ``` + * /**#@+ + * * My DocBlock + * * / + * ``` + * + * The description and tags (not the summary!) are copied onto all subsequent DocBlocks and also applied to all + * elements that follow until another DocBlock is found that contains the closing marker (`#@-`). + * + * @see self::isTemplateEnd() for the check whether a closing marker was provided. + * + * @return boolean + */ + public function isTemplateStart() + { + return $this->isTemplateStart; + } + + /** + * Returns whether this DocBlock is the end of a Template section. + * + * @see self::isTemplateStart() for a more complete description of the Docblock Template functionality. + * + * @return boolean + */ + public function isTemplateEnd() + { + return $this->isTemplateEnd; + } + + /** + * Returns the current context. + * + * @return Context + */ + public function getContext() + { + return $this->context; + } + + /** + * Returns the current location. + * + * @return Location + */ + public function getLocation() + { + return $this->location; + } + + /** + * Returns the tags for this DocBlock. + * + * @return Tag[] + */ + public function getTags() + { + return $this->tags; + } + + /** + * Returns an array of tags matching the given name. If no tags are found + * an empty array is returned. + * + * @param string $name String to search by. + * + * @return Tag[] + */ + public function getTagsByName($name) + { + $result = array(); + + /** @var Tag $tag */ + foreach ($this->getTags() as $tag) { + if ($tag->getName() != $name) { + continue; + } + + $result[] = $tag; + } + + return $result; + } + + /** + * Checks if a tag of a certain type is present in this DocBlock. + * + * @param string $name Tag name to check for. + * + * @return bool + */ + public function hasTag($name) + { + /** @var Tag $tag */ + foreach ($this->getTags() as $tag) { + if ($tag->getName() == $name) { + return true; + } + } + + return false; + } + + /** + * Appends a tag at the end of the list of tags. + * + * @param Tag $tag The tag to add. + * + * @return Tag The newly added tag. + * + * @throws \LogicException When the tag belongs to a different DocBlock. + */ + public function appendTag(Tag $tag) + { + if (null === $tag->getDocBlock()) { + $tag->setDocBlock($this); + } + + if ($tag->getDocBlock() === $this) { + $this->tags[] = $tag; + } else { + throw new \LogicException( + 'This tag belongs to a different DocBlock object.' + ); + } + + return $tag; + } + + /** + * Deletes a tag from the list of tags. + * + * @param Tag $tag The tag to be deleted. + * + * @return bool True if the tag was deleted. + */ + public function deleteTag(Tag $tag) + { + if (($key = array_search($tag, $this->tags)) !== false) { + unset($this->tags[$key]); + + return true; + } + + return false; + } + + /** + * Builds a string representation of this object. + * + * @todo determine the exact format as used by PHP Reflection and + * implement it. + * + * @return string + * @codeCoverageIgnore Not yet implemented + */ + public static function export() + { + throw new \Exception('Not yet implemented'); + } + + /** + * Returns the exported information (we should use the export static method + * BUT this throws an exception at this point). + * + * @return string + * @codeCoverageIgnore Not yet implemented + */ + public function __toString() + { + return 'Not yet implemented'; + } +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Context.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Context.php new file mode 100644 index 00000000..bbc97b48 --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Context.php @@ -0,0 +1,154 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection\DocBlock; + +/** + * The context in which a DocBlock occurs. + * + * @author Vasil Rangelov + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class Context +{ + /** @var string The current namespace. */ + protected $namespace = ''; + + /** @var array List of namespace aliases => Fully Qualified Namespace. */ + protected $namespace_aliases = array(); + + /** @var string Name of the structural element, within the namespace. */ + protected $lsen = ''; + + /** + * Cteates a new context. + * @param string $namespace The namespace where this DocBlock + * resides in. + * @param array $namespace_aliases List of namespace aliases => Fully + * Qualified Namespace. + * @param string $lsen Name of the structural element, within + * the namespace. + */ + public function __construct( + $namespace = '', + array $namespace_aliases = array(), + $lsen = '' + ) { + if (!empty($namespace)) { + $this->setNamespace($namespace); + } + $this->setNamespaceAliases($namespace_aliases); + $this->setLSEN($lsen); + } + + /** + * @return string The namespace where this DocBlock resides in. + */ + public function getNamespace() + { + return $this->namespace; + } + + /** + * @return array List of namespace aliases => Fully Qualified Namespace. + */ + public function getNamespaceAliases() + { + return $this->namespace_aliases; + } + + /** + * Returns the Local Structural Element Name. + * + * @return string Name of the structural element, within the namespace. + */ + public function getLSEN() + { + return $this->lsen; + } + + /** + * Sets a new namespace. + * + * Sets a new namespace for the context. Leading and trailing slashes are + * trimmed, and the keywords "global" and "default" are treated as aliases + * to no namespace. + * + * @param string $namespace The new namespace to set. + * + * @return $this + */ + public function setNamespace($namespace) + { + if ('global' !== $namespace + && 'default' !== $namespace + ) { + // Srip leading and trailing slash + $this->namespace = trim((string)$namespace, '\\'); + } else { + $this->namespace = ''; + } + return $this; + } + + /** + * Sets the namespace aliases, replacing all previous ones. + * + * @param array $namespace_aliases List of namespace aliases => Fully + * Qualified Namespace. + * + * @return $this + */ + public function setNamespaceAliases(array $namespace_aliases) + { + $this->namespace_aliases = array(); + foreach ($namespace_aliases as $alias => $fqnn) { + $this->setNamespaceAlias($alias, $fqnn); + } + return $this; + } + + /** + * Adds a namespace alias to the context. + * + * @param string $alias The alias name (the part after "as", or the last + * part of the Fully Qualified Namespace Name) to add. + * @param string $fqnn The Fully Qualified Namespace Name for this alias. + * Any form of leading/trailing slashes are accepted, but what will be + * stored is a name, prefixed with a slash, and no trailing slash. + * + * @return $this + */ + public function setNamespaceAlias($alias, $fqnn) + { + $this->namespace_aliases[$alias] = '\\' . trim((string)$fqnn, '\\'); + return $this; + } + + /** + * Sets a new Local Structural Element Name. + * + * Sets a new Local Structural Element Name. A local name also contains + * punctuation determining the kind of structural element (e.g. trailing "(" + * and ")" for functions and methods). + * + * @param string $lsen The new local name of a structural element. + * + * @return $this + */ + public function setLSEN($lsen) + { + $this->lsen = (string)$lsen; + return $this; + } +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Description.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Description.php new file mode 100644 index 00000000..c2e2f237 --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Description.php @@ -0,0 +1,223 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection\DocBlock; + +use Barryvdh\Reflection\DocBlock; + +/** + * Parses a Description of a DocBlock or tag. + * + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class Description implements \Reflector +{ + /** @var string */ + protected $contents = ''; + + /** @var array The contents, as an array of strings and Tag objects. */ + protected $parsedContents = null; + + /** @var DocBlock The DocBlock which this description belongs to. */ + protected $docblock = null; + + /** + * Populates the fields of a description. + * + * @param string $content The description's conetnts. + * @param DocBlock $docblock The DocBlock which this description belongs to. + */ + public function __construct($content, DocBlock $docblock = null) + { + $this->setContent($content)->setDocBlock($docblock); + } + + /** + * Gets the text of this description. + * + * @return string + */ + public function getContents() + { + return $this->contents; + } + + /** + * Sets the text of this description. + * + * @param string $content The new text of this description. + * + * @return $this + */ + public function setContent($content) + { + $this->contents = trim($content); + + $this->parsedContents = null; + return $this; + } + + /** + * Returns the parsed text of this description. + * + * @return array An array of strings and tag objects, in the order they + * occur within the description. + */ + public function getParsedContents() + { + if (null === $this->parsedContents) { + $this->parsedContents = preg_split( + '/\{ + # "{@}" is not a valid inline tag. This ensures that + # we do not treat it as one, but treat it literally. + (?!@\}) + # We want to capture the whole tag line, but without the + # inline tag delimiters. + (\@ + # Match everything up to the next delimiter. + [^{}]* + # Nested inline tag content should not be captured, or + # it will appear in the result separately. + (?: + # Match nested inline tags. + (?: + # Because we did not catch the tag delimiters + # earlier, we must be explicit with them here. + # Notice that this also matches "{}", as a way + # to later introduce it as an escape sequence. + \{(?1)?\} + | + # Make sure we match hanging "{". + \{ + ) + # Match content after the nested inline tag. + [^{}]* + )* # If there are more inline tags, match them as well. + # We use "*" since there may not be any nested inline + # tags. + ) + \}/Sux', + $this->contents, + -1, + PREG_SPLIT_DELIM_CAPTURE + ); + + $count = count($this->parsedContents); + for ($i=1; $i<$count; $i += 2) { + $this->parsedContents[$i] = Tag::createInstance( + $this->parsedContents[$i], + $this->docblock + ); + } + + //In order to allow "literal" inline tags, the otherwise invalid + //sequence "{@}" is changed to "@", and "{}" is changed to "}". + //See unit tests for examples. + for ($i=0; $i<$count; $i += 2) { + $this->parsedContents[$i] = str_replace( + array('{@}', '{}'), + array('@', '}'), + $this->parsedContents[$i] + ); + } + } + return $this->parsedContents; + } + + /** + * Return a formatted variant of the Long Description using MarkDown. + * + * @todo this should become a more intelligent piece of code where the + * configuration contains a setting what format long descriptions are. + * + * @codeCoverageIgnore Will be removed soon, in favor of adapters at + * PhpDocumentor itself that will process text in various formats. + * + * @return string + */ + public function getFormattedContents() + { + $result = $this->contents; + + // if the long description contains a plain HTML element, surround + // it with a pre element. Please note that we explicitly used str_replace + // and not preg_replace to gain performance + if (strpos($result, '') !== false) { + $result = str_replace( + array('', "\r\n", "\n", "\r", ''), + array('
', '', '', '', '
'), + $result + ); + } + + if (class_exists('Parsedown')) { + $markdown = \Parsedown::instance(); + $result = $markdown->parse($result); + } elseif (class_exists('dflydev\markdown\MarkdownExtraParser')) { + $markdown = new \dflydev\markdown\MarkdownExtraParser(); + $result = $markdown->transformMarkdown($result); + } + + return trim($result); + } + + /** + * Gets the docblock this tag belongs to. + * + * @return DocBlock The docblock this description belongs to. + */ + public function getDocBlock() + { + return $this->docblock; + } + + /** + * Sets the docblock this tag belongs to. + * + * @param DocBlock $docblock The new docblock this description belongs to. + * Setting NULL removes any association. + * + * @return $this + */ + public function setDocBlock(DocBlock $docblock = null) + { + $this->docblock = $docblock; + + return $this; + } + + /** + * Builds a string representation of this object. + * + * @todo determine the exact format as used by PHP Reflection + * and implement it. + * + * @return void + * @codeCoverageIgnore Not yet implemented + */ + public static function export() + { + throw new \Exception('Not yet implemented'); + } + + /** + * Returns the long description as a string. + * + * @return string + */ + public function __toString() + { + return $this->getContents(); + } +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Location.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Location.php new file mode 100644 index 00000000..3d16f7c2 --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Location.php @@ -0,0 +1,76 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection\DocBlock; + +/** + * The location a DocBlock occurs within a file. + * + * @author Vasil Rangelov + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class Location +{ + /** @var int Line where the DocBlock text starts. */ + protected $lineNumber = 0; + + /** @var int Column where the DocBlock text starts. */ + protected $columnNumber = 0; + + public function __construct( + $lineNumber = 0, + $columnNumber = 0 + ) { + $this->setLineNumber($lineNumber)->setColumnNumber($columnNumber); + } + + /** + * @return int Line where the DocBlock text starts. + */ + public function getLineNumber() + { + return $this->lineNumber; + } + + /** + * + * @param type $lineNumber + * @return $this + */ + public function setLineNumber($lineNumber) + { + $this->lineNumber = (int)$lineNumber; + + return $this; + } + + /** + * @return int Column where the DocBlock text starts. + */ + public function getColumnNumber() + { + return $this->columnNumber; + } + + /** + * + * @param int $columnNumber + * @return $this + */ + public function setColumnNumber($columnNumber) + { + $this->columnNumber = (int)$columnNumber; + + return $this; + } +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Serializer.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Serializer.php new file mode 100644 index 00000000..aabe06ac --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Serializer.php @@ -0,0 +1,235 @@ + + * @copyright 2013 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection\DocBlock; + +use Barryvdh\Reflection\DocBlock; + +/** + * Serializes a DocBlock instance. + * + * @author Barry vd. Heuvel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class Serializer +{ + + /** @var string The string to indent the comment with. */ + protected $indentString = ' '; + + /** @var int The number of times the indent string is repeated. */ + protected $indent = 0; + + /** @var bool Whether to indent the first line. */ + protected $isFirstLineIndented = true; + + /** @var int|null The max length of a line. */ + protected $lineLength = null; + + /** @var bool Separate tag groups. */ + protected $separateTags = false; + + /** + * Create a Serializer instance. + * + * @param int $indent The number of times the indent string is + * repeated. + * @param string $indentString The string to indent the comment with. + * @param bool $indentFirstLine Whether to indent the first line. + * @param int|null $lineLength The max length of a line or NULL to + * disable line wrapping. + * @param bool $separateTags Separate tag groups. + */ + public function __construct( + $indent = 0, + $indentString = ' ', + $indentFirstLine = true, + $lineLength = null, + $separateTags = false + ) { + $this->setIndentationString($indentString); + $this->setIndent($indent); + $this->setIsFirstLineIndented($indentFirstLine); + $this->setLineLength($lineLength); + $this->setSeparateTags($separateTags); + } + + /** + * Sets the string to indent comments with. + * + * @param string $indentationString The string to indent comments with. + * + * @return $this This serializer object. + */ + public function setIndentationString($indentString) + { + $this->indentString = (string)$indentString; + return $this; + } + + /** + * Gets the string to indent comments with. + * + * @return string The indent string. + */ + public function getIndentationString() + { + return $this->indentString; + } + + /** + * Sets the number of indents. + * + * @param int $indent The number of times the indent string is repeated. + * + * @return $this This serializer object. + */ + public function setIndent($indent) + { + $this->indent = (int)$indent; + return $this; + } + + /** + * Gets the number of indents. + * + * @return int The number of times the indent string is repeated. + */ + public function getIndent() + { + return $this->indent; + } + + /** + * Sets whether or not the first line should be indented. + * + * Sets whether or not the first line (the one with the "/**") should be + * indented. + * + * @param bool $indentFirstLine The new value for this setting. + * + * @return $this This serializer object. + */ + public function setIsFirstLineIndented($indentFirstLine) + { + $this->isFirstLineIndented = (bool)$indentFirstLine; + return $this; + } + + /** + * Gets whether or not the first line should be indented. + * + * @return bool Whether or not the first line should be indented. + */ + public function isFirstLineIndented() + { + return $this->isFirstLineIndented; + } + + /** + * Sets the line length. + * + * Sets the length of each line in the serialization. Content will be + * wrapped within this limit. + * + * @param int|null $lineLength The length of each line. NULL to disable line + * wrapping altogether. + * + * @return $this This serializer object. + */ + public function setLineLength($lineLength) + { + $this->lineLength = null === $lineLength ? null : (int)$lineLength; + return $this; + } + + /** + * Gets the line length. + * + * @return int|null The length of each line or NULL if line wrapping is + * disabled. + */ + public function getLineLength() + { + return $this->lineLength; + } + + /** + * Sets whether there should be an empty line between tag groups. + * + * @param bool $separateTags The new value for this setting. + * + * @return $this This serializer object. + */ + public function setSeparateTags($separateTags) + { + $this->separateTags = (bool)$separateTags; + return $this; + } + + /** + * Gets whether there should be an empty line between tag groups. + * + * @return bool Whether there should be an empty line between tag groups. + */ + public function getSeparateTags() + { + return $this->separateTags; + } + + /** + * Generate a DocBlock comment. + * + * @param DocBlock The DocBlock to serialize. + * + * @return string The serialized doc block. + */ + public function getDocComment(DocBlock $docblock) + { + $indent = str_repeat($this->indentString, $this->indent); + $firstIndent = $this->isFirstLineIndented ? $indent : ''; + + $text = $docblock->getText(); + if ($this->lineLength) { + //3 === strlen(' * ') + $wrapLength = $this->lineLength - strlen($indent) - 3; + $text = wordwrap($text, $wrapLength); + } + $text = str_replace("\n", "\n{$indent} * ", $text); + + $comment = "{$firstIndent}/**\n{$indent} * {$text}\n{$indent} *\n"; + + $tags = array_values($docblock->getTags()); + + /** @var Tag $tag */ + foreach ($tags as $key => $tag) { + $nextTag = isset($tags[$key + 1]) ? $tags[$key + 1] : null; + + $tagText = (string) $tag; + if ($this->lineLength) { + $tagText = wordwrap($tagText, $wrapLength); + } + $tagText = str_replace("\n", "\n{$indent} * ", $tagText); + + $comment .= "{$indent} * {$tagText}\n"; + + if ($this->separateTags && $nextTag !== null && ! $tag->inSameGroup($nextTag)) { + $comment .= "{$indent} *\n"; + } + } + + $comment .= $indent . ' */'; + + return $comment; + } +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag.php new file mode 100644 index 00000000..14a1a483 --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag.php @@ -0,0 +1,410 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection\DocBlock; + +use Barryvdh\Reflection\DocBlock; + +/** + * Parses a tag definition for a DocBlock. + * + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class Tag implements \Reflector +{ + /** + * PCRE regular expression matching a tag name. + */ + const REGEX_TAGNAME = '[\w\-\_\\\\]+'; + + /** @var string Name of the tag */ + protected $tag = ''; + + /** + * @var string|null Content of the tag. + * When set to NULL, it means it needs to be regenerated. + */ + protected $content = ''; + + /** @var string Description of the content of this tag */ + protected $description = ''; + + /** + * @var array|null The description, as an array of strings and Tag objects. + * When set to NULL, it means it needs to be regenerated. + */ + protected $parsedDescription = null; + + /** @var Location Location of the tag. */ + protected $location = null; + + /** @var DocBlock The DocBlock which this tag belongs to. */ + protected $docblock = null; + + /** + * @var array An array with a tag as a key, and an FQCN to a class that + * handles it as an array value. The class is expected to inherit this + * class. + */ + private static $tagHandlerMappings = array( + 'author' + => '\Barryvdh\Reflection\DocBlock\Tag\AuthorTag', + 'covers' + => '\Barryvdh\Reflection\DocBlock\Tag\CoversTag', + 'deprecated' + => '\Barryvdh\Reflection\DocBlock\Tag\DeprecatedTag', + 'example' + => '\Barryvdh\Reflection\DocBlock\Tag\ExampleTag', + 'link' + => '\Barryvdh\Reflection\DocBlock\Tag\LinkTag', + 'method' + => '\Barryvdh\Reflection\DocBlock\Tag\MethodTag', + 'param' + => '\Barryvdh\Reflection\DocBlock\Tag\ParamTag', + 'property-read' + => '\Barryvdh\Reflection\DocBlock\Tag\PropertyReadTag', + 'property' + => '\Barryvdh\Reflection\DocBlock\Tag\PropertyTag', + 'property-write' + => '\Barryvdh\Reflection\DocBlock\Tag\PropertyWriteTag', + 'return' + => '\Barryvdh\Reflection\DocBlock\Tag\ReturnTag', + 'see' + => '\Barryvdh\Reflection\DocBlock\Tag\SeeTag', + 'since' + => '\Barryvdh\Reflection\DocBlock\Tag\SinceTag', + 'source' + => '\Barryvdh\Reflection\DocBlock\Tag\SourceTag', + 'throw' + => '\Barryvdh\Reflection\DocBlock\Tag\ThrowsTag', + 'throws' + => '\Barryvdh\Reflection\DocBlock\Tag\ThrowsTag', + 'uses' + => '\Barryvdh\Reflection\DocBlock\Tag\UsesTag', + 'var' + => '\Barryvdh\Reflection\DocBlock\Tag\VarTag', + 'version' + => '\Barryvdh\Reflection\DocBlock\Tag\VersionTag' + ); + + /** + * Factory method responsible for instantiating the correct sub type. + * + * @param string $tag_line The text for this tag, including description. + * @param DocBlock $docblock The DocBlock which this tag belongs to. + * @param Location $location Location of the tag. + * + * @throws \InvalidArgumentException if an invalid tag line was presented. + * + * @return static A new tag object. + */ + final public static function createInstance( + $tag_line, + DocBlock $docblock = null, + Location $location = null + ) { + if (!preg_match( + '/^@(' . self::REGEX_TAGNAME . ')(?:\s*([^\s].*)|$)?/us', + $tag_line, + $matches + )) { + throw new \InvalidArgumentException( + 'Invalid tag_line detected: ' . $tag_line + ); + } + + $handler = __CLASS__; + if (isset(self::$tagHandlerMappings[$matches[1]])) { + $handler = self::$tagHandlerMappings[$matches[1]]; + } elseif (isset($docblock)) { + $tagName = (string)new Type\Collection( + array($matches[1]), + $docblock->getContext() + ); + + if (isset(self::$tagHandlerMappings[$tagName])) { + $handler = self::$tagHandlerMappings[$tagName]; + } + } + + return new $handler( + $matches[1], + isset($matches[2]) ? $matches[2] : '', + $docblock, + $location + ); + } + + /** + * Registers a handler for tags. + * + * Registers a handler for tags. The class specified is autoloaded if it's + * not available. It must inherit from this class. + * + * @param string $tag Name of tag to regiser a handler for. When + * registering a namespaced tag, the full name, along with a prefixing + * slash MUST be provided. + * @param string|null $handler FQCN of handler. Specifing NULL removes the + * handler for the specified tag, if any. + * + * @return bool TRUE on success, FALSE on failure. + */ + final public static function registerTagHandler($tag, $handler) + { + $tag = trim((string)$tag); + + if (null === $handler) { + unset(self::$tagHandlerMappings[$tag]); + return true; + } + + if ('' !== $tag + && class_exists($handler, true) + && is_subclass_of($handler, __CLASS__) + && !strpos($tag, '\\') //Accept no slash, and 1st slash at offset 0. + ) { + self::$tagHandlerMappings[$tag] = $handler; + return true; + } + + return false; + } + + /** + * Parses a tag and populates the member variables. + * + * @param string $name Name of the tag. + * @param string $content The contents of the given tag. + * @param DocBlock $docblock The DocBlock which this tag belongs to. + * @param Location $location Location of the tag. + */ + public function __construct( + $name, + $content, + DocBlock $docblock = null, + Location $location = null + ) { + $this + ->setName($name) + ->setContent($content) + ->setDocBlock($docblock) + ->setLocation($location); + } + + /** + * Gets the name of this tag. + * + * @return string The name of this tag. + */ + public function getName() + { + return $this->tag; + } + + /** + * Sets the name of this tag. + * + * @param string $name The new name of this tag. + * + * @return $this + * @throws \InvalidArgumentException When an invalid tag name is provided. + */ + public function setName($name) + { + if (!preg_match('/^' . self::REGEX_TAGNAME . '$/u', $name)) { + throw new \InvalidArgumentException( + 'Invalid tag name supplied: ' . $name + ); + } + + $this->tag = $name; + + return $this; + } + + /** + * Gets the content of this tag. + * + * @return string + */ + public function getContent() + { + if (null === $this->content) { + $this->content = $this->description; + } + + return $this->content; + } + + /** + * Sets the content of this tag. + * + * @param string $content The new content of this tag. + * + * @return $this + */ + public function setContent($content) + { + $this->setDescription($content); + $this->content = $content; + + return $this; + } + + /** + * Gets the description component of this tag. + * + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Sets the description component of this tag. + * + * @param string $description The new description component of this tag. + * + * @return $this + */ + public function setDescription($description) + { + $this->content = null; + $this->parsedDescription = null; + $this->description = trim($description); + + return $this; + } + + /** + * Gets the parsed text of this description. + * + * @return array An array of strings and tag objects, in the order they + * occur within the description. + */ + public function getParsedDescription() + { + if (null === $this->parsedDescription) { + $description = new Description($this->description, $this->docblock); + $this->parsedDescription = $description->getParsedContents(); + } + return $this->parsedDescription; + } + + /** + * Gets the docblock this tag belongs to. + * + * @return DocBlock The docblock this tag belongs to. + */ + public function getDocBlock() + { + return $this->docblock; + } + + /** + * Sets the docblock this tag belongs to. + * + * @param DocBlock $docblock The new docblock this tag belongs to. Setting + * NULL removes any association. + * + * @return $this + */ + public function setDocBlock(DocBlock $docblock = null) + { + $this->docblock = $docblock; + + return $this; + } + + /** + * Gets the location of the tag. + * + * @return Location The tag's location. + */ + public function getLocation() + { + return $this->location; + } + + /** + * Sets the location of the tag. + * + * @param Location $location The new location of the tag. + * + * @return $this + */ + public function setLocation(Location $location = null) + { + $this->location = $location; + + return $this; + } + + /** + * If the given tags should be together or apart. + * + * @param Tag $tag + * + * @return bool + */ + public function inSameGroup(Tag $tag) + { + $firstName = $this->getName(); + $secondName = $tag->getName(); + + if ($firstName === $secondName) { + return true; + } + + $groups = array( + array('deprecated', 'link', 'see', 'since'), + array('author', 'copyright', 'license'), + array('category', 'package', 'subpackage'), + array('property', 'property-read', 'property-write'), + array('param', 'return'), + ); + + foreach ($groups as $group) { + if (in_array($firstName, $group, true) && in_array($secondName, $group, true)) { + return true; + } + } + + return false; + } + + /** + * Builds a string representation of this object. + * + * @todo determine the exact format as used by PHP Reflection and implement it. + * + * @return void + * @codeCoverageIgnore Not yet implemented + */ + public static function export() + { + throw new \Exception('Not yet implemented'); + } + + /** + * Returns the tag as a serialized string + * + * @return string + */ + public function __toString() + { + return "@{$this->getName()} {$this->getContent()}"; + } +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/AuthorTag.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/AuthorTag.php new file mode 100644 index 00000000..0e3f8096 --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/AuthorTag.php @@ -0,0 +1,131 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection\DocBlock\Tag; + +use Barryvdh\Reflection\DocBlock\Tag; + +/** + * Reflection class for an @author tag in a Docblock. + * + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class AuthorTag extends Tag +{ + /** + * PCRE regular expression matching any valid value for the name component. + */ + const REGEX_AUTHOR_NAME = '[^\<]*'; + + /** + * PCRE regular expression matching any valid value for the email component. + */ + const REGEX_AUTHOR_EMAIL = '[^\>]*'; + + /** @var string The name of the author */ + protected $authorName = ''; + + /** @var string The email of the author */ + protected $authorEmail = ''; + + public function getContent() + { + if (null === $this->content) { + $this->content = $this->authorName; + if ('' != $this->authorEmail) { + $this->content .= "<{$this->authorEmail}>"; + } + } + + return $this->content; + } + + /** + * {@inheritdoc} + */ + public function setContent($content) + { + parent::setContent($content); + if (preg_match( + '/^(' . self::REGEX_AUTHOR_NAME . + ')(\<(' . self::REGEX_AUTHOR_EMAIL . + ')\>)?$/u', + $this->description, + $matches + )) { + $this->authorName = trim($matches[1]); + if (isset($matches[3])) { + $this->authorEmail = trim($matches[3]); + } + } + + return $this; + } + + /** + * Gets the author's name. + * + * @return string The author's name. + */ + public function getAuthorName() + { + return $this->authorName; + } + + /** + * Sets the author's name. + * + * @param string $authorName The new author name. + * An invalid value will set an empty string. + * + * @return $this + */ + public function setAuthorName($authorName) + { + $this->content = null; + $this->authorName + = preg_match('/^' . self::REGEX_AUTHOR_NAME . '$/u', $authorName) + ? $authorName : ''; + + return $this; + } + + /** + * Gets the author's email. + * + * @return string The author's email. + */ + public function getAuthorEmail() + { + return $this->authorEmail; + } + + /** + * Sets the author's email. + * + * @param string $authorEmail The new author email. + * An invalid value will set an empty string. + * + * @return $this + */ + public function setAuthorEmail($authorEmail) + { + $this->authorEmail + = preg_match('/^' . self::REGEX_AUTHOR_EMAIL . '$/u', $authorEmail) + ? $authorEmail : ''; + + $this->content = null; + return $this; + } +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/CoversTag.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/CoversTag.php new file mode 100644 index 00000000..51ce1055 --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/CoversTag.php @@ -0,0 +1,24 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection\DocBlock\Tag; + +/** + * Reflection class for a @covers tag in a Docblock. + * + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class CoversTag extends SeeTag +{ +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/DeprecatedTag.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/DeprecatedTag.php new file mode 100644 index 00000000..670a736c --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/DeprecatedTag.php @@ -0,0 +1,26 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection\DocBlock\Tag; + +use Barryvdh\Reflection\DocBlock\Tag\VersionTag; + +/** + * Reflection class for a @deprecated tag in a Docblock. + * + * @author Vasil Rangelov + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class DeprecatedTag extends VersionTag +{ +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/ExampleTag.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/ExampleTag.php new file mode 100644 index 00000000..5c96d4de --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/ExampleTag.php @@ -0,0 +1,156 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection\DocBlock\Tag; + +use Barryvdh\Reflection\DocBlock\Tag; + +/** + * Reflection class for a @example tag in a Docblock. + * + * @author Vasil Rangelov + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class ExampleTag extends SourceTag +{ + /** + * @var string Path to a file to use as an example. + * May also be an absolute URI. + */ + protected $filePath = ''; + + /** + * @var bool Whether the file path component represents an URI. + * This determines how the file portion appears at {@link getContent()}. + */ + protected $isURI = false; + + /** + * {@inheritdoc} + */ + public function getContent() + { + if (null === $this->content) { + $filePath = ''; + if ($this->isURI) { + if (false === strpos($this->filePath, ':')) { + $filePath = str_replace( + '%2F', + '/', + rawurlencode($this->filePath) + ); + } else { + $filePath = $this->filePath; + } + } else { + $filePath = '"' . $this->filePath . '"'; + } + + $this->content = $filePath . ' ' . parent::getContent(); + } + + return $this->content; + } + /** + * {@inheritdoc} + */ + public function setContent($content) + { + Tag::setContent($content); + if (preg_match( + '/^ + # File component + (?: + # File path in quotes + \"([^\"]+)\" + | + # File URI + (\S+) + ) + # Remaining content (parsed by SourceTag) + (?:\s+(.*))? + $/sux', + $this->description, + $matches + )) { + if ('' !== $matches[1]) { + $this->setFilePath($matches[1]); + } else { + $this->setFileURI($matches[2]); + } + + if (isset($matches[3])) { + parent::setContent($matches[3]); + } else { + $this->setDescription(''); + } + $this->content = $content; + } + + return $this; + } + + /** + * Returns the file path. + * + * @return string Path to a file to use as an example. + * May also be an absolute URI. + */ + public function getFilePath() + { + return $this->filePath; + } + + /** + * Sets the file path. + * + * @param string $filePath The new file path to use for the example. + * + * @return $this + */ + public function setFilePath($filePath) + { + $this->isURI = false; + $this->filePath = trim($filePath); + + $this->content = null; + return $this; + } + + /** + * Sets the file path as an URI. + * + * This function is equivalent to {@link setFilePath()}, except that it + * convers an URI to a file path before that. + * + * There is no getFileURI(), as {@link getFilePath()} is compatible. + * + * @param type $uri The new file URI to use as an example. + */ + public function setFileURI($uri) + { + $this->isURI = true; + if (false === strpos($uri, ':')) { + //Relative URL + $this->filePath = rawurldecode( + str_replace(array('/', '\\'), '%2F', $uri) + ); + } else { + //Absolute URL or URI. + $this->filePath = $uri; + } + + $this->content = null; + return $this; + } +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/LinkTag.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/LinkTag.php new file mode 100644 index 00000000..ee91af9d --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/LinkTag.php @@ -0,0 +1,81 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection\DocBlock\Tag; + +use Barryvdh\Reflection\DocBlock\Tag; + +/** + * Reflection class for a @link tag in a Docblock. + * + * @author Ben Selby + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class LinkTag extends Tag +{ + /** @var string */ + protected $link = ''; + + /** + * {@inheritdoc} + */ + public function getContent() + { + if (null === $this->content) { + $this->content = "{$this->link} {$this->description}"; + } + + return $this->content; + } + + /** + * {@inheritdoc} + */ + public function setContent($content) + { + parent::setContent($content); + $parts = preg_split('/\s+/Su', $this->description, 2); + + $this->link = $parts[0]; + + $this->setDescription(isset($parts[1]) ? $parts[1] : $parts[0]); + + $this->content = $content; + return $this; + } + + /** + * Gets the link + * + * @return string + */ + public function getLink() + { + return $this->link; + } + + /** + * Sets the link + * + * @param string $link The link + * + * @return $this + */ + public function setLink($link) + { + $this->link = $link; + + $this->content = null; + return $this; + } +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/MethodTag.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/MethodTag.php new file mode 100644 index 00000000..5674c941 --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/MethodTag.php @@ -0,0 +1,217 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection\DocBlock\Tag; + +use Barryvdh\Reflection\DocBlock\Tag; + +/** + * Reflection class for a @method in a Docblock. + * + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class MethodTag extends ReturnTag +{ + + /** @var string */ + protected $method_name = ''; + + /** @var string */ + protected $arguments = ''; + + /** @var bool */ + protected $isStatic = false; + + /** + * {@inheritdoc} + */ + public function getContent() + { + if (null === $this->content) { + $this->content = ''; + if ($this->isStatic) { + $this->content .= 'static '; + } + $this->content .= $this->type . + " {$this->method_name}({$this->arguments}) " . + $this->description; + } + + return $this->content; + } + + /** + * {@inheritdoc} + */ + public function setContent($content) + { + Tag::setContent($content); + // 1. none or more whitespace + // 2. optionally the keyword "static" followed by whitespace + // 3. optionally a word with underscores followed by whitespace : as + // type for the return value + // 4. then optionally a word with underscores followed by () and + // whitespace : as method name as used by phpDocumentor + // 5. then a word with underscores, followed by ( and any character + // until a ) and whitespace : as method name with signature + // 6. any remaining text : as description + if (preg_match( + '/^ + # Static keyword + # Declates a static method ONLY if type is also present + (?: + (static) + \s+ + )? + # Return type + (?: + ( + (?:[\w\|_\\\\]*\$this[\w\|_\\\\]*) + | + (?: + (?:[\w\|_\\\\]+) + # array notation + (?:\[\])* + )* + ) + \s+ + )? + # Legacy method name (not captured) + (?: + [\w_]+\(\)\s+ + )? + # Method name + ([\w\|_\\\\]+) + # Arguments + \(([^\)]*)\) + \s* + # Description + (.*) + $/sux', + $this->description, + $matches + )) { + list( + , + $static, + $this->type, + $this->method_name, + $this->arguments, + $this->description + ) = $matches; + if ($static) { + if (!$this->type) { + $this->type = 'static'; + } else { + $this->isStatic = true; + } + } else { + if (!$this->type) { + $this->type = 'void'; + } + } + $this->parsedDescription = null; + } + + return $this; + } + + /** + * Sets the name of this method. + * + * @param string $method_name The name of the method. + * + * @return $this + */ + public function setMethodName($method_name) + { + $this->method_name = $method_name; + + $this->content = null; + return $this; + } + + /** + * Retrieves the method name. + * + * @return string + */ + public function getMethodName() + { + return $this->method_name; + } + + /** + * Sets the arguments for this method. + * + * @param string $arguments A comma-separated arguments line. + * + * @return void + */ + public function setArguments($arguments) + { + $this->arguments = $arguments; + + $this->content = null; + return $this; + } + + /** + * Returns an array containing each argument as array of type and name. + * + * Please note that the argument sub-array may only contain 1 element if no + * type was specified. + * + * @return string[] + */ + public function getArguments() + { + if (empty($this->arguments)) { + return array(); + } + + $arguments = explode(',', $this->arguments); + foreach ($arguments as $key => $value) { + $arguments[$key] = explode(' ', trim($value)); + } + + return $arguments; + } + + /** + * Checks whether the method tag describes a static method or not. + * + * @return bool TRUE if the method declaration is for a static method, FALSE + * otherwise. + */ + public function isStatic() + { + return $this->isStatic; + } + + /** + * Sets a new value for whether the method is static or not. + * + * @param bool $isStatic The new value to set. + * + * @return $this + */ + public function setIsStatic($isStatic) + { + $this->isStatic = $isStatic; + + $this->content = null; + return $this; + } +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/ParamTag.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/ParamTag.php new file mode 100644 index 00000000..d9a13614 --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/ParamTag.php @@ -0,0 +1,119 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection\DocBlock\Tag; + +use Barryvdh\Reflection\DocBlock\Tag; + +/** + * Reflection class for a @param tag in a Docblock. + * + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class ParamTag extends ReturnTag +{ + /** @var string */ + protected $variableName = ''; + + /** @var bool determines whether this is a variadic argument */ + protected $isVariadic = false; + + /** + * {@inheritdoc} + */ + public function getContent() + { + if (null === $this->content) { + $this->content + = "{$this->type} {$this->variableName} {$this->description}"; + } + return $this->content; + } + /** + * {@inheritdoc} + */ + public function setContent($content) + { + Tag::setContent($content); + $parts = preg_split( + '/(\s+)/Su', + $this->description, + 3, + PREG_SPLIT_DELIM_CAPTURE + ); + + // if the first item that is encountered is not a variable; it is a type + if (isset($parts[0]) + && (strlen($parts[0]) > 0) + && ($parts[0][0] !== '$') + ) { + $this->type = array_shift($parts); + array_shift($parts); + } + + // if the next item starts with a $ or ...$ it must be the variable name + if (isset($parts[0]) + && (strlen($parts[0]) > 0) + && ($parts[0][0] == '$' || substr($parts[0], 0, 4) === '...$') + ) { + $this->variableName = array_shift($parts); + array_shift($parts); + + if (substr($this->variableName, 0, 3) === '...') { + $this->isVariadic = true; + $this->variableName = substr($this->variableName, 3); + } + } + + $this->setDescription(implode('', $parts)); + + $this->content = $content; + return $this; + } + + /** + * Returns the variable's name. + * + * @return string + */ + public function getVariableName() + { + return $this->variableName; + } + + /** + * Sets the variable's name. + * + * @param string $name The new name for this variable. + * + * @return $this + */ + public function setVariableName($name) + { + $this->variableName = $name; + + $this->content = null; + return $this; + } + + /** + * Returns whether this tag is variadic. + * + * @return boolean + */ + public function isVariadic() + { + return $this->isVariadic; + } +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/PropertyReadTag.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/PropertyReadTag.php new file mode 100644 index 00000000..a5d27aa0 --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/PropertyReadTag.php @@ -0,0 +1,24 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection\DocBlock\Tag; + +/** + * Reflection class for a @property-read tag in a Docblock. + * + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class PropertyReadTag extends PropertyTag +{ +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/PropertyTag.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/PropertyTag.php new file mode 100644 index 00000000..a440429f --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/PropertyTag.php @@ -0,0 +1,24 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection\DocBlock\Tag; + +/** + * Reflection class for a @property tag in a Docblock. + * + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class PropertyTag extends ParamTag +{ +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/PropertyWriteTag.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/PropertyWriteTag.php new file mode 100644 index 00000000..435ffc26 --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/PropertyWriteTag.php @@ -0,0 +1,24 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection\DocBlock\Tag; + +/** + * Reflection class for a @property-write tag in a Docblock. + * + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class PropertyWriteTag extends PropertyTag +{ +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/ReturnTag.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/ReturnTag.php new file mode 100644 index 00000000..65b01e48 --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/ReturnTag.php @@ -0,0 +1,128 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection\DocBlock\Tag; + +use Barryvdh\Reflection\DocBlock\Tag; +use Barryvdh\Reflection\DocBlock\Type\Collection; + +/** + * Reflection class for a @return tag in a Docblock. + * + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class ReturnTag extends Tag +{ + /** @var string The raw type component. */ + protected $type = ''; + + /** @var Collection The parsed type component. */ + protected $types = null; + + /** + * {@inheritdoc} + */ + public function getContent() + { + if (null === $this->content) { + $this->content = "{$this->getType()} {$this->description}"; + } + + return $this->content; + } + + /** + * {@inheritdoc} + */ + public function setContent($content) + { + parent::setContent($content); + + $parts = preg_split('/(?description, 2); + + // any output is considered a type + $this->type = $parts[0]; + $this->types = null; + + $this->setDescription(isset($parts[1]) ? $parts[1] : ''); + + $this->content = $content; + return $this; + } + + /** + * Returns the unique types of the variable. + * + * @return string[] + */ + public function getTypes() + { + return $this->getTypesCollection()->getArrayCopy(); + } + + /** + * Returns the type section of the variable. + * + * @return string + */ + public function getType() + { + return (string) $this->getTypesCollection(); + } + + /** + * Set the type section of the variable + * + * @param string $type + * @return $this + */ + public function setType($type) + { + $this->type = $type; + $this->types = null; + $this->content = null; + return $this; + } + + /** + * Add a type to the type section of the variable + * + * @param string $type + * @return $this + */ + public function addType($type) + { + $this->type = $this->type . Collection::OPERATOR_OR . $type; + $this->types = null; + $this->content = null; + return $this; + } + + + /** + * Returns the type collection. + * + * @return void + */ + protected function getTypesCollection() + { + if (null === $this->types) { + $this->types = new Collection( + array($this->type), + $this->docblock ? $this->docblock->getContext() : null + ); + } + return $this->types; + } +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/SeeTag.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/SeeTag.php new file mode 100644 index 00000000..32b77dfa --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/SeeTag.php @@ -0,0 +1,81 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection\DocBlock\Tag; + +use Barryvdh\Reflection\DocBlock\Tag; + +/** + * Reflection class for a @see tag in a Docblock. + * + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class SeeTag extends Tag +{ + /** @var string */ + protected $refers = null; + + /** + * {@inheritdoc} + */ + public function getContent() + { + if (null === $this->content) { + $this->content = "{$this->refers} {$this->description}"; + } + return $this->content; + } + + /** + * {@inheritdoc} + */ + public function setContent($content) + { + parent::setContent($content); + $parts = preg_split('/\s+/Su', $this->description, 2); + + // any output is considered a type + $this->refers = $parts[0]; + + $this->setDescription(isset($parts[1]) ? $parts[1] : ''); + + $this->content = $content; + return $this; + } + + /** + * Gets the structural element this tag refers to. + * + * @return string + */ + public function getReference() + { + return $this->refers; + } + + /** + * Sets the structural element this tag refers to. + * + * @param string $refers The new type this tag refers to. + * + * @return $this + */ + public function setReference($refers) + { + $this->refers = $refers; + + $this->content = null; + return $this; + } +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/SinceTag.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/SinceTag.php new file mode 100644 index 00000000..f5673ea0 --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/SinceTag.php @@ -0,0 +1,26 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection\DocBlock\Tag; + +use Barryvdh\Reflection\DocBlock\Tag\VersionTag; + +/** + * Reflection class for a @since tag in a Docblock. + * + * @author Vasil Rangelov + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class SinceTag extends VersionTag +{ +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/SourceTag.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/SourceTag.php new file mode 100644 index 00000000..09416e9b --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/SourceTag.php @@ -0,0 +1,137 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection\DocBlock\Tag; + +use Barryvdh\Reflection\DocBlock\Tag; + +/** + * Reflection class for a @source tag in a Docblock. + * + * @author Vasil Rangelov + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class SourceTag extends Tag +{ + /** + * @var int The starting line, relative to the structural element's + * location. + */ + protected $startingLine = 1; + + /** + * @var int|null The number of lines, relative to the starting line. NULL + * means "to the end". + */ + protected $lineCount = null; + + /** + * {@inheritdoc} + */ + public function getContent() + { + if (null === $this->content) { + $this->content + = "{$this->startingLine} {$this->lineCount} {$this->description}"; + } + + return $this->content; + } + + /** + * {@inheritdoc} + */ + public function setContent($content) + { + parent::setContent($content); + if (preg_match( + '/^ + # Starting line + ([1-9]\d*) + \s* + # Number of lines + (?: + ((?1)) + \s+ + )? + # Description + (.*) + $/sux', + $this->description, + $matches + )) { + $this->startingLine = (int)$matches[1]; + if (isset($matches[2]) && '' !== $matches[2]) { + $this->lineCount = (int)$matches[2]; + } + $this->setDescription($matches[3]); + $this->content = $content; + } + + return $this; + } + + /** + * Gets the starting line. + * + * @return int The starting line, relative to the structural element's + * location. + */ + public function getStartingLine() + { + return $this->startingLine; + } + + /** + * Sets the starting line. + * + * @param int $startingLine The new starting line, relative to the + * structural element's location. + * + * @return $this + */ + public function setStartingLine($startingLine) + { + $this->startingLine = $startingLine; + + $this->content = null; + return $this; + } + + /** + * Returns the number of lines. + * + * @return int|null The number of lines, relative to the starting line. NULL + * means "to the end". + */ + public function getLineCount() + { + return $this->lineCount; + } + + /** + * Sets the number of lines. + * + * @param int|null $lineCount The new number of lines, relative to the + * starting line. NULL means "to the end". + * + * @return $this + */ + public function setLineCount($lineCount) + { + $this->lineCount = $lineCount; + + $this->content = null; + return $this; + } +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/ThrowsTag.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/ThrowsTag.php new file mode 100644 index 00000000..fc428ca3 --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/ThrowsTag.php @@ -0,0 +1,24 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection\DocBlock\Tag; + +/** + * Reflection class for a @throws tag in a Docblock. + * + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class ThrowsTag extends ReturnTag +{ +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/UsesTag.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/UsesTag.php new file mode 100644 index 00000000..572f568f --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/UsesTag.php @@ -0,0 +1,24 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection\DocBlock\Tag; + +/** + * Reflection class for a @uses tag in a Docblock. + * + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class UsesTag extends SeeTag +{ +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/VarTag.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/VarTag.php new file mode 100644 index 00000000..3760c8da --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/VarTag.php @@ -0,0 +1,24 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection\DocBlock\Tag; + +/** + * Reflection class for a @var tag in a Docblock. + * + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class VarTag extends ParamTag +{ +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/VersionTag.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/VersionTag.php new file mode 100644 index 00000000..dc8e321b --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/VersionTag.php @@ -0,0 +1,108 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection\DocBlock\Tag; + +use Barryvdh\Reflection\DocBlock\Tag; + +/** + * Reflection class for a @version tag in a Docblock. + * + * @author Vasil Rangelov + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class VersionTag extends Tag +{ + /** + * PCRE regular expression matching a version vector. + * Assumes the "x" modifier. + */ + const REGEX_VECTOR = '(?: + # Normal release vectors. + \d\S* + | + # VCS version vectors. Per PHPCS, they are expected to + # follow the form of the VCS name, followed by ":", followed + # by the version vector itself. + # By convention, popular VCSes like CVS, SVN and GIT use "$" + # around the actual version vector. + [^\s\:]+\:\s*\$[^\$]+\$ + )'; + + /** @var string The version vector. */ + protected $version = ''; + + public function getContent() + { + if (null === $this->content) { + $this->content = "{$this->version} {$this->description}"; + } + + return $this->content; + } + + /** + * {@inheritdoc} + */ + public function setContent($content) + { + parent::setContent($content); + + if (preg_match( + '/^ + # The version vector + (' . self::REGEX_VECTOR . ') + \s* + # The description + (.+)? + $/sux', + $this->description, + $matches + )) { + $this->version = $matches[1]; + $this->setDescription(isset($matches[2]) ? $matches[2] : ''); + $this->content = $content; + } + + return $this; + } + + /** + * Gets the version section of the tag. + * + * @return string The version section of the tag. + */ + public function getVersion() + { + return $this->version; + } + + /** + * Sets the version section of the tag. + * + * @param string $version The new version section of the tag. + * An invalid value will set an empty string. + * + * @return $this + */ + public function setVersion($version) + { + $this->version + = preg_match('/^' . self::REGEX_VECTOR . '$/ux', $version) + ? $version + : ''; + + $this->content = null; + return $this; + } +} diff --git a/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Type/Collection.php b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Type/Collection.php new file mode 100644 index 00000000..82d64fa5 --- /dev/null +++ b/vendor/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Type/Collection.php @@ -0,0 +1,283 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace Barryvdh\Reflection\DocBlock\Type; + +use Barryvdh\Reflection\DocBlock\Context; + +/** + * Collection + * + * @author Mike van Riel + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ +class Collection extends \ArrayObject +{ + /** @var string Definition of the OR operator for types */ + const OPERATOR_OR = '|'; + + /** @var string Definition of the ARRAY operator for types */ + const OPERATOR_ARRAY = '[]'; + + /** @var string Definition of the NAMESPACE operator in PHP */ + const OPERATOR_NAMESPACE = '\\'; + + /** @var string[] List of recognized keywords */ + protected static $keywords = array( + 'string', 'int', 'integer', 'bool', 'boolean', 'float', 'double', + 'object', 'mixed', 'array', 'resource', 'void', 'null', 'scalar', + 'callback', 'callable', 'false', 'true', 'self', '$this', 'static' + ); + + /** + * Current invoking location. + * + * This is used to prepend to type with a relative location. + * May also be 'default' or 'global', in which case they are ignored. + * + * @var Context + */ + protected $context = null; + + /** + * Registers the namespace and aliases; uses that to add and expand the + * given types. + * + * @param string[] $types Array containing a list of types to add to this + * container. + * @param Context $location The current invoking location. + */ + public function __construct( + array $types = array(), + Context $context = null + ) { + $this->context = null === $context ? new Context() : $context; + + foreach ($types as $type) { + $this->add($type); + } + } + + /** + * Returns the current invoking location. + * + * @return Context + */ + public function getContext() + { + return $this->context; + } + + /** + * Adds a new type to the collection and expands it if it contains a + * relative namespace. + * + * If a class in the type contains a relative namespace than this collection + * will try to expand that into a FQCN. + * + * @param string $type A 'Type' as defined in the phpDocumentor + * documentation. + * + * @throws \InvalidArgumentException if a non-string argument is passed. + * + * @see http://phpdoc.org/docs/latest/for-users/types.html for the + * definition of a type. + * + * @return void + */ + public function add($type) + { + if (!is_string($type)) { + throw new \InvalidArgumentException( + 'A type should be represented by a string, received: ' + .var_export($type, true) + ); + } + + // separate the type by the OR operator + $type_parts = $this->explode($type); + foreach ($type_parts as $part) { + $expanded_type = $this->expand($part); + if ($expanded_type) { + $this[] = $expanded_type; + } + } + } + + /** + * Returns a string representation of the collection. + * + * @return string The resolved types across the collection, separated with + * {@link self::OPERATOR_OR}. + */ + public function __toString() + { + return implode(self::OPERATOR_OR, $this->getArrayCopy()); + } + + /** + * Analyzes the given union of types and returns separated by OR operator + * single types. + * + * @param string $type The type or union of types + * + * @return array + */ + protected function explode($type) + { + $type_parts = []; + $curr_type = ''; + $nest_level = 0; + + foreach (str_split($type) as $char) { + if ($char === self::OPERATOR_OR && $nest_level === 0) { + $type_parts[] = $curr_type; + $curr_type = ''; + } else { + if ($char === '<') { + $nest_level++; + } else if ($char === '>') { + $nest_level--; + } + + $curr_type .= $char; + } + } + + $type_parts[] = $curr_type; + + return $type_parts; + } + + /** + * Analyzes the given type and returns the FQCN variant. + * + * When a type is provided this method checks whether it is not a keyword or + * Fully Qualified Class Name. If so it will use the given namespace and + * aliases to expand the type to a FQCN representation. + * + * This method only works as expected if the namespace and aliases are set; + * no dynamic reflection is being performed here. + * + * @param string $type The relative or absolute type. + * + * @uses getNamespace to determine with what to prefix the type name. + * @uses getNamespaceAliases to check whether the first part of the relative + * type name should not be replaced with another namespace. + * + * @return string + */ + protected function expand($type) + { + $type = trim($type); + if (!$type) { + return ''; + } + + if (substr($type, 0, 6) === 'array<' && substr($type, -1) === '>') { + return $type; + } + + if ($this->isTypeAnArray($type)) { + return $this->expand(substr($type, 0, -2)) . self::OPERATOR_ARRAY; + } + + if ($this->isRelativeType($type) && !$this->isTypeAKeyword($type)) { + + if($this->shouldBeAbsolute($type)){ + return self::OPERATOR_NAMESPACE . $type; + } + + $type_parts = explode(self::OPERATOR_NAMESPACE, $type, 2); + + $namespace_aliases = $this->context->getNamespaceAliases(); + // if the first segment is not an alias; prepend namespace name and + // return + if (!isset($namespace_aliases[$type_parts[0]]) && + !isset($namespace_aliases[strstr($type_parts[0], '::', true)])) { + $namespace = $this->context->getNamespace(); + if ('' !== $namespace) { + $namespace .= self::OPERATOR_NAMESPACE; + } + return self::OPERATOR_NAMESPACE . $namespace . $type; + } + + if (strpos($type_parts[0], '::')) { + $type_parts[] = strstr($type_parts[0], '::'); + $type_parts[0] = $namespace_aliases[strstr($type_parts[0], '::', true)]; + return implode('', $type_parts); + } + + $type_parts[0] = $namespace_aliases[$type_parts[0]]; + $type = implode(self::OPERATOR_NAMESPACE, $type_parts); + } + + return $type; + } + + /** + * Detects whether the given type represents an array. + * + * @param string $type A relative or absolute type as defined in the + * phpDocumentor documentation. + * + * @return bool + */ + protected function isTypeAnArray($type) + { + return substr($type, -2) === self::OPERATOR_ARRAY; + } + + /** + * Detects whether the given type represents a PHPDoc keyword. + * + * @param string $type A relative or absolute type as defined in the + * phpDocumentor documentation. + * + * @return bool + */ + protected function isTypeAKeyword($type) + { + return in_array(strtolower($type), static::$keywords, true); + } + + /** + * Detects whether the given type represents a relative or absolute path. + * + * This method will detect keywords as being absolute; even though they are + * not preceeded by a namespace separator. + * + * @param string $type A relative or absolute type as defined in the + * phpDocumentor documentation. + * + * @return bool + */ + protected function isRelativeType($type) + { + return ($type[0] !== self::OPERATOR_NAMESPACE) + || $this->isTypeAKeyword($type); + } + + /** + * Detects if the type should actually be absolute, by checking if it exists. + * + * @param string $type A relative or absolute type as defined in the + * phpDocumentor documentation. + * + * @return bool + */ + protected function shouldBeAbsolute($type){ + return class_exists($type); + } +} diff --git a/vendor/bin/doctrine-dbal b/vendor/bin/doctrine-dbal new file mode 100755 index 00000000..e86bf8dc --- /dev/null +++ b/vendor/bin/doctrine-dbal @@ -0,0 +1,120 @@ +#!/usr/bin/env php +realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + include("phpvfscomposer://" . __DIR__ . '/..'.'/doctrine/dbal/bin/doctrine-dbal'); + exit(0); + } +} + +include __DIR__ . '/..'.'/doctrine/dbal/bin/doctrine-dbal'; diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index eb975cac..5d6baa7a 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -17,6 +17,7 @@ return array( 'App\\Http\\Controllers\\Auth\\ResetPasswordController' => $baseDir . '/app/Http/Controllers/Auth/ResetPasswordController.php', 'App\\Http\\Controllers\\Controller' => $baseDir . '/app/Http/Controllers/Controller.php', 'App\\Http\\Controllers\\HomeController' => $baseDir . '/app/Http/Controllers/HomeController.php', + 'App\\Http\\Controllers\\ImportController' => $baseDir . '/app/Http/Controllers/ImportController.php', 'App\\Http\\Controllers\\ItemController' => $baseDir . '/app/Http/Controllers/ItemController.php', 'App\\Http\\Controllers\\ItemRestController' => $baseDir . '/app/Http/Controllers/ItemRestController.php', 'App\\Http\\Controllers\\SearchController' => $baseDir . '/app/Http/Controllers/SearchController.php', @@ -54,6 +55,7 @@ return array( 'App\\SupportedApps\\AriaNg\\AriaNg' => $baseDir . '/app/SupportedApps/AriaNg/AriaNg.php', 'App\\SupportedApps\\Atlantis\\Atlantis' => $baseDir . '/app/SupportedApps/Atlantis/Atlantis.php', 'App\\SupportedApps\\Bastillion\\Bastillion' => $baseDir . '/app/SupportedApps/Bastillion/Bastillion.php', + 'App\\SupportedApps\\Jellyfin\\Jellyfin' => $baseDir . '/app/SupportedApps/Jellyfin/Jellyfin.php', 'App\\SupportedApps\\Jira\\Jira' => $baseDir . '/app/SupportedApps/Jira/Jira.php', 'App\\SupportedApps\\Kibana\\Kibana' => $baseDir . '/app/SupportedApps/Kibana/Kibana.php', 'App\\SupportedApps\\MotionEye\\MotionEye' => $baseDir . '/app/SupportedApps/MotionEye/MotionEye.php', @@ -74,6 +76,46 @@ return array( 'App\\SupportedApps\\UniFi\\UniFi' => $baseDir . '/app/SupportedApps/UniFi/UniFi.php', 'App\\User' => $baseDir . '/app/User.php', 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', + 'Barryvdh\\LaravelIdeHelper\\Alias' => $vendorDir . '/barryvdh/laravel-ide-helper/src/Alias.php', + 'Barryvdh\\LaravelIdeHelper\\ClassMapGenerator' => $vendorDir . '/barryvdh/laravel-ide-helper/src/ClassMapGenerator.php', + 'Barryvdh\\LaravelIdeHelper\\Console\\EloquentCommand' => $vendorDir . '/barryvdh/laravel-ide-helper/src/Console/EloquentCommand.php', + 'Barryvdh\\LaravelIdeHelper\\Console\\GeneratorCommand' => $vendorDir . '/barryvdh/laravel-ide-helper/src/Console/GeneratorCommand.php', + 'Barryvdh\\LaravelIdeHelper\\Console\\MetaCommand' => $vendorDir . '/barryvdh/laravel-ide-helper/src/Console/MetaCommand.php', + 'Barryvdh\\LaravelIdeHelper\\Console\\ModelsCommand' => $vendorDir . '/barryvdh/laravel-ide-helper/src/Console/ModelsCommand.php', + 'Barryvdh\\LaravelIdeHelper\\Contracts\\ModelHookInterface' => $vendorDir . '/barryvdh/laravel-ide-helper/src/Contracts/ModelHookInterface.php', + 'Barryvdh\\LaravelIdeHelper\\Eloquent' => $vendorDir . '/barryvdh/laravel-ide-helper/src/Eloquent.php', + 'Barryvdh\\LaravelIdeHelper\\Factories' => $vendorDir . '/barryvdh/laravel-ide-helper/src/Factories.php', + 'Barryvdh\\LaravelIdeHelper\\Generator' => $vendorDir . '/barryvdh/laravel-ide-helper/src/Generator.php', + 'Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider' => $vendorDir . '/barryvdh/laravel-ide-helper/src/IdeHelperServiceProvider.php', + 'Barryvdh\\LaravelIdeHelper\\Listeners\\GenerateModelHelper' => $vendorDir . '/barryvdh/laravel-ide-helper/src/Listeners/GenerateModelHelper.php', + 'Barryvdh\\LaravelIdeHelper\\Macro' => $vendorDir . '/barryvdh/laravel-ide-helper/src/Macro.php', + 'Barryvdh\\LaravelIdeHelper\\Method' => $vendorDir . '/barryvdh/laravel-ide-helper/src/Method.php', + 'Barryvdh\\LaravelIdeHelper\\UsesResolver' => $vendorDir . '/barryvdh/laravel-ide-helper/src/UsesResolver.php', + 'Barryvdh\\Reflection\\DocBlock' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock.php', + 'Barryvdh\\Reflection\\DocBlock\\Context' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Context.php', + 'Barryvdh\\Reflection\\DocBlock\\Description' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Description.php', + 'Barryvdh\\Reflection\\DocBlock\\Location' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Location.php', + 'Barryvdh\\Reflection\\DocBlock\\Serializer' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Serializer.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\AuthorTag' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/AuthorTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\CoversTag' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/CoversTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\DeprecatedTag' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/DeprecatedTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\ExampleTag' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/ExampleTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\LinkTag' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/LinkTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\MethodTag' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/MethodTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\ParamTag' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/ParamTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\PropertyReadTag' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/PropertyReadTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\PropertyTag' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/PropertyTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\PropertyWriteTag' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/PropertyWriteTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\ReturnTag' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/ReturnTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\SeeTag' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/SeeTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\SinceTag' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/SinceTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\SourceTag' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/SourceTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\ThrowsTag' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/ThrowsTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\UsesTag' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/UsesTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\VarTag' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/VarTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\VersionTag' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/VersionTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Type\\Collection' => $vendorDir . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Type/Collection.php', 'Brick\\Math\\BigDecimal' => $vendorDir . '/brick/math/src/BigDecimal.php', 'Brick\\Math\\BigInteger' => $vendorDir . '/brick/math/src/BigInteger.php', 'Brick\\Math\\BigNumber' => $vendorDir . '/brick/math/src/BigNumber.php', @@ -178,6 +220,17 @@ return array( 'Collective\\Html\\HtmlFacade' => $vendorDir . '/laravelcollective/html/src/HtmlFacade.php', 'Collective\\Html\\HtmlServiceProvider' => $vendorDir . '/laravelcollective/html/src/HtmlServiceProvider.php', 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', + 'Composer\\Pcre\\MatchAllResult' => $vendorDir . '/composer/pcre/src/MatchAllResult.php', + 'Composer\\Pcre\\MatchAllStrictGroupsResult' => $vendorDir . '/composer/pcre/src/MatchAllStrictGroupsResult.php', + 'Composer\\Pcre\\MatchAllWithOffsetsResult' => $vendorDir . '/composer/pcre/src/MatchAllWithOffsetsResult.php', + 'Composer\\Pcre\\MatchResult' => $vendorDir . '/composer/pcre/src/MatchResult.php', + 'Composer\\Pcre\\MatchStrictGroupsResult' => $vendorDir . '/composer/pcre/src/MatchStrictGroupsResult.php', + 'Composer\\Pcre\\MatchWithOffsetsResult' => $vendorDir . '/composer/pcre/src/MatchWithOffsetsResult.php', + 'Composer\\Pcre\\PcreException' => $vendorDir . '/composer/pcre/src/PcreException.php', + 'Composer\\Pcre\\Preg' => $vendorDir . '/composer/pcre/src/Preg.php', + 'Composer\\Pcre\\Regex' => $vendorDir . '/composer/pcre/src/Regex.php', + 'Composer\\Pcre\\ReplaceResult' => $vendorDir . '/composer/pcre/src/ReplaceResult.php', + 'Composer\\Pcre\\UnexpectedNullMatchException' => $vendorDir . '/composer/pcre/src/UnexpectedNullMatchException.php', 'Cron\\AbstractField' => $vendorDir . '/dragonmantank/cron-expression/src/Cron/AbstractField.php', 'Cron\\CronExpression' => $vendorDir . '/dragonmantank/cron-expression/src/Cron/CronExpression.php', 'Cron\\DayOfMonthField' => $vendorDir . '/dragonmantank/cron-expression/src/Cron/DayOfMonthField.php', @@ -188,6 +241,7 @@ return array( 'Cron\\HoursField' => $vendorDir . '/dragonmantank/cron-expression/src/Cron/HoursField.php', 'Cron\\MinutesField' => $vendorDir . '/dragonmantank/cron-expression/src/Cron/MinutesField.php', 'Cron\\MonthField' => $vendorDir . '/dragonmantank/cron-expression/src/Cron/MonthField.php', + 'Database\\Factories\\ItemFactory' => $baseDir . '/database/factories/ItemFactory.php', 'Database\\Factories\\UserFactory' => $baseDir . '/database/factories/UserFactory.php', 'Database\\Seeders\\DatabaseSeeder' => $baseDir . '/database/seeders/DatabaseSeeder.php', 'Database\\Seeders\\SettingsSeeder' => $baseDir . '/database/seeders/SettingsSeeder.php', @@ -222,7 +276,333 @@ return array( 'Dflydev\\DotAccessData\\Exception\\InvalidPathException' => $vendorDir . '/dflydev/dot-access-data/src/Exception/InvalidPathException.php', 'Dflydev\\DotAccessData\\Exception\\MissingPathException' => $vendorDir . '/dflydev/dot-access-data/src/Exception/MissingPathException.php', 'Dflydev\\DotAccessData\\Util' => $vendorDir . '/dflydev/dot-access-data/src/Util.php', + 'Doctrine\\Common\\Cache\\Cache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php', + 'Doctrine\\Common\\Cache\\CacheProvider' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php', + 'Doctrine\\Common\\Cache\\ClearableCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/ClearableCache.php', + 'Doctrine\\Common\\Cache\\FlushableCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/FlushableCache.php', + 'Doctrine\\Common\\Cache\\MultiDeleteCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/MultiDeleteCache.php', + 'Doctrine\\Common\\Cache\\MultiGetCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/MultiGetCache.php', + 'Doctrine\\Common\\Cache\\MultiOperationCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/MultiOperationCache.php', + 'Doctrine\\Common\\Cache\\MultiPutCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/MultiPutCache.php', + 'Doctrine\\Common\\Cache\\Psr6\\CacheAdapter' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheAdapter.php', + 'Doctrine\\Common\\Cache\\Psr6\\CacheItem' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheItem.php', + 'Doctrine\\Common\\Cache\\Psr6\\DoctrineProvider' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/DoctrineProvider.php', + 'Doctrine\\Common\\Cache\\Psr6\\InvalidArgument' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/InvalidArgument.php', + 'Doctrine\\Common\\Cache\\Psr6\\TypedCacheItem' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/TypedCacheItem.php', + 'Doctrine\\Common\\EventArgs' => $vendorDir . '/doctrine/event-manager/src/EventArgs.php', + 'Doctrine\\Common\\EventManager' => $vendorDir . '/doctrine/event-manager/src/EventManager.php', + 'Doctrine\\Common\\EventSubscriber' => $vendorDir . '/doctrine/event-manager/src/EventSubscriber.php', 'Doctrine\\Common\\Lexer\\AbstractLexer' => $vendorDir . '/doctrine/lexer/lib/Doctrine/Common/Lexer/AbstractLexer.php', + 'Doctrine\\DBAL\\ArrayParameters\\Exception' => $vendorDir . '/doctrine/dbal/src/ArrayParameters/Exception.php', + 'Doctrine\\DBAL\\ArrayParameters\\Exception\\MissingNamedParameter' => $vendorDir . '/doctrine/dbal/src/ArrayParameters/Exception/MissingNamedParameter.php', + 'Doctrine\\DBAL\\ArrayParameters\\Exception\\MissingPositionalParameter' => $vendorDir . '/doctrine/dbal/src/ArrayParameters/Exception/MissingPositionalParameter.php', + 'Doctrine\\DBAL\\Cache\\ArrayResult' => $vendorDir . '/doctrine/dbal/src/Cache/ArrayResult.php', + 'Doctrine\\DBAL\\Cache\\CacheException' => $vendorDir . '/doctrine/dbal/src/Cache/CacheException.php', + 'Doctrine\\DBAL\\Cache\\QueryCacheProfile' => $vendorDir . '/doctrine/dbal/src/Cache/QueryCacheProfile.php', + 'Doctrine\\DBAL\\ColumnCase' => $vendorDir . '/doctrine/dbal/src/ColumnCase.php', + 'Doctrine\\DBAL\\Configuration' => $vendorDir . '/doctrine/dbal/src/Configuration.php', + 'Doctrine\\DBAL\\Connection' => $vendorDir . '/doctrine/dbal/src/Connection.php', + 'Doctrine\\DBAL\\ConnectionException' => $vendorDir . '/doctrine/dbal/src/ConnectionException.php', + 'Doctrine\\DBAL\\Connections\\PrimaryReadReplicaConnection' => $vendorDir . '/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php', + 'Doctrine\\DBAL\\Driver' => $vendorDir . '/doctrine/dbal/src/Driver.php', + 'Doctrine\\DBAL\\DriverManager' => $vendorDir . '/doctrine/dbal/src/DriverManager.php', + 'Doctrine\\DBAL\\Driver\\API\\ExceptionConverter' => $vendorDir . '/doctrine/dbal/src/Driver/API/ExceptionConverter.php', + 'Doctrine\\DBAL\\Driver\\API\\IBMDB2\\ExceptionConverter' => $vendorDir . '/doctrine/dbal/src/Driver/API/IBMDB2/ExceptionConverter.php', + 'Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter' => $vendorDir . '/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php', + 'Doctrine\\DBAL\\Driver\\API\\OCI\\ExceptionConverter' => $vendorDir . '/doctrine/dbal/src/Driver/API/OCI/ExceptionConverter.php', + 'Doctrine\\DBAL\\Driver\\API\\PostgreSQL\\ExceptionConverter' => $vendorDir . '/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php', + 'Doctrine\\DBAL\\Driver\\API\\SQLSrv\\ExceptionConverter' => $vendorDir . '/doctrine/dbal/src/Driver/API/SQLSrv/ExceptionConverter.php', + 'Doctrine\\DBAL\\Driver\\API\\SQLite\\ExceptionConverter' => $vendorDir . '/doctrine/dbal/src/Driver/API/SQLite/ExceptionConverter.php', + 'Doctrine\\DBAL\\Driver\\API\\SQLite\\UserDefinedFunctions' => $vendorDir . '/doctrine/dbal/src/Driver/API/SQLite/UserDefinedFunctions.php', + 'Doctrine\\DBAL\\Driver\\AbstractDB2Driver' => $vendorDir . '/doctrine/dbal/src/Driver/AbstractDB2Driver.php', + 'Doctrine\\DBAL\\Driver\\AbstractException' => $vendorDir . '/doctrine/dbal/src/Driver/AbstractException.php', + 'Doctrine\\DBAL\\Driver\\AbstractMySQLDriver' => $vendorDir . '/doctrine/dbal/src/Driver/AbstractMySQLDriver.php', + 'Doctrine\\DBAL\\Driver\\AbstractOracleDriver' => $vendorDir . '/doctrine/dbal/src/Driver/AbstractOracleDriver.php', + 'Doctrine\\DBAL\\Driver\\AbstractOracleDriver\\EasyConnectString' => $vendorDir . '/doctrine/dbal/src/Driver/AbstractOracleDriver/EasyConnectString.php', + 'Doctrine\\DBAL\\Driver\\AbstractPostgreSQLDriver' => $vendorDir . '/doctrine/dbal/src/Driver/AbstractPostgreSQLDriver.php', + 'Doctrine\\DBAL\\Driver\\AbstractSQLServerDriver' => $vendorDir . '/doctrine/dbal/src/Driver/AbstractSQLServerDriver.php', + 'Doctrine\\DBAL\\Driver\\AbstractSQLServerDriver\\Exception\\PortWithoutHost' => $vendorDir . '/doctrine/dbal/src/Driver/AbstractSQLServerDriver/Exception/PortWithoutHost.php', + 'Doctrine\\DBAL\\Driver\\AbstractSQLiteDriver' => $vendorDir . '/doctrine/dbal/src/Driver/AbstractSQLiteDriver.php', + 'Doctrine\\DBAL\\Driver\\AbstractSQLiteDriver\\Middleware\\EnableForeignKeys' => $vendorDir . '/doctrine/dbal/src/Driver/AbstractSQLiteDriver/Middleware/EnableForeignKeys.php', + 'Doctrine\\DBAL\\Driver\\Connection' => $vendorDir . '/doctrine/dbal/src/Driver/Connection.php', + 'Doctrine\\DBAL\\Driver\\Exception' => $vendorDir . '/doctrine/dbal/src/Driver/Exception.php', + 'Doctrine\\DBAL\\Driver\\Exception\\UnknownParameterType' => $vendorDir . '/doctrine/dbal/src/Driver/Exception/UnknownParameterType.php', + 'Doctrine\\DBAL\\Driver\\FetchUtils' => $vendorDir . '/doctrine/dbal/src/Driver/FetchUtils.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\Connection' => $vendorDir . '/doctrine/dbal/src/Driver/IBMDB2/Connection.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\DataSourceName' => $vendorDir . '/doctrine/dbal/src/Driver/IBMDB2/DataSourceName.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\Driver' => $vendorDir . '/doctrine/dbal/src/Driver/IBMDB2/Driver.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\Exception\\CannotCopyStreamToStream' => $vendorDir . '/doctrine/dbal/src/Driver/IBMDB2/Exception/CannotCopyStreamToStream.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\Exception\\CannotCreateTemporaryFile' => $vendorDir . '/doctrine/dbal/src/Driver/IBMDB2/Exception/CannotCreateTemporaryFile.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\Exception\\ConnectionError' => $vendorDir . '/doctrine/dbal/src/Driver/IBMDB2/Exception/ConnectionError.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\Exception\\ConnectionFailed' => $vendorDir . '/doctrine/dbal/src/Driver/IBMDB2/Exception/ConnectionFailed.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\Exception\\Factory' => $vendorDir . '/doctrine/dbal/src/Driver/IBMDB2/Exception/Factory.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\Exception\\PrepareFailed' => $vendorDir . '/doctrine/dbal/src/Driver/IBMDB2/Exception/PrepareFailed.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\Exception\\StatementError' => $vendorDir . '/doctrine/dbal/src/Driver/IBMDB2/Exception/StatementError.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\Result' => $vendorDir . '/doctrine/dbal/src/Driver/IBMDB2/Result.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\Statement' => $vendorDir . '/doctrine/dbal/src/Driver/IBMDB2/Statement.php', + 'Doctrine\\DBAL\\Driver\\Middleware' => $vendorDir . '/doctrine/dbal/src/Driver/Middleware.php', + 'Doctrine\\DBAL\\Driver\\Middleware\\AbstractConnectionMiddleware' => $vendorDir . '/doctrine/dbal/src/Driver/Middleware/AbstractConnectionMiddleware.php', + 'Doctrine\\DBAL\\Driver\\Middleware\\AbstractDriverMiddleware' => $vendorDir . '/doctrine/dbal/src/Driver/Middleware/AbstractDriverMiddleware.php', + 'Doctrine\\DBAL\\Driver\\Middleware\\AbstractResultMiddleware' => $vendorDir . '/doctrine/dbal/src/Driver/Middleware/AbstractResultMiddleware.php', + 'Doctrine\\DBAL\\Driver\\Middleware\\AbstractStatementMiddleware' => $vendorDir . '/doctrine/dbal/src/Driver/Middleware/AbstractStatementMiddleware.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Connection' => $vendorDir . '/doctrine/dbal/src/Driver/Mysqli/Connection.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Driver' => $vendorDir . '/doctrine/dbal/src/Driver/Mysqli/Driver.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Exception\\ConnectionError' => $vendorDir . '/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionError.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Exception\\ConnectionFailed' => $vendorDir . '/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionFailed.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Exception\\FailedReadingStreamOffset' => $vendorDir . '/doctrine/dbal/src/Driver/Mysqli/Exception/FailedReadingStreamOffset.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Exception\\HostRequired' => $vendorDir . '/doctrine/dbal/src/Driver/Mysqli/Exception/HostRequired.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Exception\\InvalidCharset' => $vendorDir . '/doctrine/dbal/src/Driver/Mysqli/Exception/InvalidCharset.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Exception\\InvalidOption' => $vendorDir . '/doctrine/dbal/src/Driver/Mysqli/Exception/InvalidOption.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Exception\\NonStreamResourceUsedAsLargeObject' => $vendorDir . '/doctrine/dbal/src/Driver/Mysqli/Exception/NonStreamResourceUsedAsLargeObject.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Exception\\StatementError' => $vendorDir . '/doctrine/dbal/src/Driver/Mysqli/Exception/StatementError.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Initializer' => $vendorDir . '/doctrine/dbal/src/Driver/Mysqli/Initializer.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Initializer\\Charset' => $vendorDir . '/doctrine/dbal/src/Driver/Mysqli/Initializer/Charset.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Initializer\\Options' => $vendorDir . '/doctrine/dbal/src/Driver/Mysqli/Initializer/Options.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Initializer\\Secure' => $vendorDir . '/doctrine/dbal/src/Driver/Mysqli/Initializer/Secure.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Result' => $vendorDir . '/doctrine/dbal/src/Driver/Mysqli/Result.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Statement' => $vendorDir . '/doctrine/dbal/src/Driver/Mysqli/Statement.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\Connection' => $vendorDir . '/doctrine/dbal/src/Driver/OCI8/Connection.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\ConvertPositionalToNamedPlaceholders' => $vendorDir . '/doctrine/dbal/src/Driver/OCI8/ConvertPositionalToNamedPlaceholders.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\Driver' => $vendorDir . '/doctrine/dbal/src/Driver/OCI8/Driver.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\Exception\\ConnectionFailed' => $vendorDir . '/doctrine/dbal/src/Driver/OCI8/Exception/ConnectionFailed.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\Exception\\Error' => $vendorDir . '/doctrine/dbal/src/Driver/OCI8/Exception/Error.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\Exception\\NonTerminatedStringLiteral' => $vendorDir . '/doctrine/dbal/src/Driver/OCI8/Exception/NonTerminatedStringLiteral.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\Exception\\SequenceDoesNotExist' => $vendorDir . '/doctrine/dbal/src/Driver/OCI8/Exception/SequenceDoesNotExist.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\Exception\\UnknownParameterIndex' => $vendorDir . '/doctrine/dbal/src/Driver/OCI8/Exception/UnknownParameterIndex.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\ExecutionMode' => $vendorDir . '/doctrine/dbal/src/Driver/OCI8/ExecutionMode.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\Middleware\\InitializeSession' => $vendorDir . '/doctrine/dbal/src/Driver/OCI8/Middleware/InitializeSession.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\Result' => $vendorDir . '/doctrine/dbal/src/Driver/OCI8/Result.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\Statement' => $vendorDir . '/doctrine/dbal/src/Driver/OCI8/Statement.php', + 'Doctrine\\DBAL\\Driver\\PDO\\Connection' => $vendorDir . '/doctrine/dbal/src/Driver/PDO/Connection.php', + 'Doctrine\\DBAL\\Driver\\PDO\\Exception' => $vendorDir . '/doctrine/dbal/src/Driver/PDO/Exception.php', + 'Doctrine\\DBAL\\Driver\\PDO\\MySQL\\Driver' => $vendorDir . '/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php', + 'Doctrine\\DBAL\\Driver\\PDO\\OCI\\Driver' => $vendorDir . '/doctrine/dbal/src/Driver/PDO/OCI/Driver.php', + 'Doctrine\\DBAL\\Driver\\PDO\\PgSQL\\Driver' => $vendorDir . '/doctrine/dbal/src/Driver/PDO/PgSQL/Driver.php', + 'Doctrine\\DBAL\\Driver\\PDO\\Result' => $vendorDir . '/doctrine/dbal/src/Driver/PDO/Result.php', + 'Doctrine\\DBAL\\Driver\\PDO\\SQLSrv\\Connection' => $vendorDir . '/doctrine/dbal/src/Driver/PDO/SQLSrv/Connection.php', + 'Doctrine\\DBAL\\Driver\\PDO\\SQLSrv\\Driver' => $vendorDir . '/doctrine/dbal/src/Driver/PDO/SQLSrv/Driver.php', + 'Doctrine\\DBAL\\Driver\\PDO\\SQLSrv\\Statement' => $vendorDir . '/doctrine/dbal/src/Driver/PDO/SQLSrv/Statement.php', + 'Doctrine\\DBAL\\Driver\\PDO\\SQLite\\Driver' => $vendorDir . '/doctrine/dbal/src/Driver/PDO/SQLite/Driver.php', + 'Doctrine\\DBAL\\Driver\\PDO\\Statement' => $vendorDir . '/doctrine/dbal/src/Driver/PDO/Statement.php', + 'Doctrine\\DBAL\\Driver\\Result' => $vendorDir . '/doctrine/dbal/src/Driver/Result.php', + 'Doctrine\\DBAL\\Driver\\SQLSrv\\Connection' => $vendorDir . '/doctrine/dbal/src/Driver/SQLSrv/Connection.php', + 'Doctrine\\DBAL\\Driver\\SQLSrv\\Driver' => $vendorDir . '/doctrine/dbal/src/Driver/SQLSrv/Driver.php', + 'Doctrine\\DBAL\\Driver\\SQLSrv\\Exception\\Error' => $vendorDir . '/doctrine/dbal/src/Driver/SQLSrv/Exception/Error.php', + 'Doctrine\\DBAL\\Driver\\SQLSrv\\Result' => $vendorDir . '/doctrine/dbal/src/Driver/SQLSrv/Result.php', + 'Doctrine\\DBAL\\Driver\\SQLSrv\\Statement' => $vendorDir . '/doctrine/dbal/src/Driver/SQLSrv/Statement.php', + 'Doctrine\\DBAL\\Driver\\SQLite3\\Connection' => $vendorDir . '/doctrine/dbal/src/Driver/SQLite3/Connection.php', + 'Doctrine\\DBAL\\Driver\\SQLite3\\Driver' => $vendorDir . '/doctrine/dbal/src/Driver/SQLite3/Driver.php', + 'Doctrine\\DBAL\\Driver\\SQLite3\\Exception' => $vendorDir . '/doctrine/dbal/src/Driver/SQLite3/Exception.php', + 'Doctrine\\DBAL\\Driver\\SQLite3\\Result' => $vendorDir . '/doctrine/dbal/src/Driver/SQLite3/Result.php', + 'Doctrine\\DBAL\\Driver\\SQLite3\\Statement' => $vendorDir . '/doctrine/dbal/src/Driver/SQLite3/Statement.php', + 'Doctrine\\DBAL\\Driver\\ServerInfoAwareConnection' => $vendorDir . '/doctrine/dbal/src/Driver/ServerInfoAwareConnection.php', + 'Doctrine\\DBAL\\Driver\\Statement' => $vendorDir . '/doctrine/dbal/src/Driver/Statement.php', + 'Doctrine\\DBAL\\Event\\ConnectionEventArgs' => $vendorDir . '/doctrine/dbal/src/Event/ConnectionEventArgs.php', + 'Doctrine\\DBAL\\Event\\Listeners\\OracleSessionInit' => $vendorDir . '/doctrine/dbal/src/Event/Listeners/OracleSessionInit.php', + 'Doctrine\\DBAL\\Event\\Listeners\\SQLSessionInit' => $vendorDir . '/doctrine/dbal/src/Event/Listeners/SQLSessionInit.php', + 'Doctrine\\DBAL\\Event\\Listeners\\SQLiteSessionInit' => $vendorDir . '/doctrine/dbal/src/Event/Listeners/SQLiteSessionInit.php', + 'Doctrine\\DBAL\\Event\\SchemaAlterTableAddColumnEventArgs' => $vendorDir . '/doctrine/dbal/src/Event/SchemaAlterTableAddColumnEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaAlterTableChangeColumnEventArgs' => $vendorDir . '/doctrine/dbal/src/Event/SchemaAlterTableChangeColumnEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaAlterTableEventArgs' => $vendorDir . '/doctrine/dbal/src/Event/SchemaAlterTableEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaAlterTableRemoveColumnEventArgs' => $vendorDir . '/doctrine/dbal/src/Event/SchemaAlterTableRemoveColumnEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaAlterTableRenameColumnEventArgs' => $vendorDir . '/doctrine/dbal/src/Event/SchemaAlterTableRenameColumnEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaColumnDefinitionEventArgs' => $vendorDir . '/doctrine/dbal/src/Event/SchemaColumnDefinitionEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaCreateTableColumnEventArgs' => $vendorDir . '/doctrine/dbal/src/Event/SchemaCreateTableColumnEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaCreateTableEventArgs' => $vendorDir . '/doctrine/dbal/src/Event/SchemaCreateTableEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaDropTableEventArgs' => $vendorDir . '/doctrine/dbal/src/Event/SchemaDropTableEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaEventArgs' => $vendorDir . '/doctrine/dbal/src/Event/SchemaEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaIndexDefinitionEventArgs' => $vendorDir . '/doctrine/dbal/src/Event/SchemaIndexDefinitionEventArgs.php', + 'Doctrine\\DBAL\\Event\\TransactionBeginEventArgs' => $vendorDir . '/doctrine/dbal/src/Event/TransactionBeginEventArgs.php', + 'Doctrine\\DBAL\\Event\\TransactionCommitEventArgs' => $vendorDir . '/doctrine/dbal/src/Event/TransactionCommitEventArgs.php', + 'Doctrine\\DBAL\\Event\\TransactionEventArgs' => $vendorDir . '/doctrine/dbal/src/Event/TransactionEventArgs.php', + 'Doctrine\\DBAL\\Event\\TransactionRollBackEventArgs' => $vendorDir . '/doctrine/dbal/src/Event/TransactionRollBackEventArgs.php', + 'Doctrine\\DBAL\\Events' => $vendorDir . '/doctrine/dbal/src/Events.php', + 'Doctrine\\DBAL\\Exception' => $vendorDir . '/doctrine/dbal/src/Exception.php', + 'Doctrine\\DBAL\\Exception\\ConnectionException' => $vendorDir . '/doctrine/dbal/src/Exception/ConnectionException.php', + 'Doctrine\\DBAL\\Exception\\ConnectionLost' => $vendorDir . '/doctrine/dbal/src/Exception/ConnectionLost.php', + 'Doctrine\\DBAL\\Exception\\ConstraintViolationException' => $vendorDir . '/doctrine/dbal/src/Exception/ConstraintViolationException.php', + 'Doctrine\\DBAL\\Exception\\DatabaseDoesNotExist' => $vendorDir . '/doctrine/dbal/src/Exception/DatabaseDoesNotExist.php', + 'Doctrine\\DBAL\\Exception\\DatabaseObjectExistsException' => $vendorDir . '/doctrine/dbal/src/Exception/DatabaseObjectExistsException.php', + 'Doctrine\\DBAL\\Exception\\DatabaseObjectNotFoundException' => $vendorDir . '/doctrine/dbal/src/Exception/DatabaseObjectNotFoundException.php', + 'Doctrine\\DBAL\\Exception\\DatabaseRequired' => $vendorDir . '/doctrine/dbal/src/Exception/DatabaseRequired.php', + 'Doctrine\\DBAL\\Exception\\DeadlockException' => $vendorDir . '/doctrine/dbal/src/Exception/DeadlockException.php', + 'Doctrine\\DBAL\\Exception\\DriverException' => $vendorDir . '/doctrine/dbal/src/Exception/DriverException.php', + 'Doctrine\\DBAL\\Exception\\ForeignKeyConstraintViolationException' => $vendorDir . '/doctrine/dbal/src/Exception/ForeignKeyConstraintViolationException.php', + 'Doctrine\\DBAL\\Exception\\InvalidArgumentException' => $vendorDir . '/doctrine/dbal/src/Exception/InvalidArgumentException.php', + 'Doctrine\\DBAL\\Exception\\InvalidFieldNameException' => $vendorDir . '/doctrine/dbal/src/Exception/InvalidFieldNameException.php', + 'Doctrine\\DBAL\\Exception\\InvalidLockMode' => $vendorDir . '/doctrine/dbal/src/Exception/InvalidLockMode.php', + 'Doctrine\\DBAL\\Exception\\LockWaitTimeoutException' => $vendorDir . '/doctrine/dbal/src/Exception/LockWaitTimeoutException.php', + 'Doctrine\\DBAL\\Exception\\NoKeyValue' => $vendorDir . '/doctrine/dbal/src/Exception/NoKeyValue.php', + 'Doctrine\\DBAL\\Exception\\NonUniqueFieldNameException' => $vendorDir . '/doctrine/dbal/src/Exception/NonUniqueFieldNameException.php', + 'Doctrine\\DBAL\\Exception\\NotNullConstraintViolationException' => $vendorDir . '/doctrine/dbal/src/Exception/NotNullConstraintViolationException.php', + 'Doctrine\\DBAL\\Exception\\ReadOnlyException' => $vendorDir . '/doctrine/dbal/src/Exception/ReadOnlyException.php', + 'Doctrine\\DBAL\\Exception\\RetryableException' => $vendorDir . '/doctrine/dbal/src/Exception/RetryableException.php', + 'Doctrine\\DBAL\\Exception\\SchemaDoesNotExist' => $vendorDir . '/doctrine/dbal/src/Exception/SchemaDoesNotExist.php', + 'Doctrine\\DBAL\\Exception\\ServerException' => $vendorDir . '/doctrine/dbal/src/Exception/ServerException.php', + 'Doctrine\\DBAL\\Exception\\SyntaxErrorException' => $vendorDir . '/doctrine/dbal/src/Exception/SyntaxErrorException.php', + 'Doctrine\\DBAL\\Exception\\TableExistsException' => $vendorDir . '/doctrine/dbal/src/Exception/TableExistsException.php', + 'Doctrine\\DBAL\\Exception\\TableNotFoundException' => $vendorDir . '/doctrine/dbal/src/Exception/TableNotFoundException.php', + 'Doctrine\\DBAL\\Exception\\UniqueConstraintViolationException' => $vendorDir . '/doctrine/dbal/src/Exception/UniqueConstraintViolationException.php', + 'Doctrine\\DBAL\\ExpandArrayParameters' => $vendorDir . '/doctrine/dbal/src/ExpandArrayParameters.php', + 'Doctrine\\DBAL\\FetchMode' => $vendorDir . '/doctrine/dbal/src/FetchMode.php', + 'Doctrine\\DBAL\\Id\\TableGenerator' => $vendorDir . '/doctrine/dbal/src/Id/TableGenerator.php', + 'Doctrine\\DBAL\\Id\\TableGeneratorSchemaVisitor' => $vendorDir . '/doctrine/dbal/src/Id/TableGeneratorSchemaVisitor.php', + 'Doctrine\\DBAL\\LockMode' => $vendorDir . '/doctrine/dbal/src/LockMode.php', + 'Doctrine\\DBAL\\Logging\\Connection' => $vendorDir . '/doctrine/dbal/src/Logging/Connection.php', + 'Doctrine\\DBAL\\Logging\\DebugStack' => $vendorDir . '/doctrine/dbal/src/Logging/DebugStack.php', + 'Doctrine\\DBAL\\Logging\\Driver' => $vendorDir . '/doctrine/dbal/src/Logging/Driver.php', + 'Doctrine\\DBAL\\Logging\\LoggerChain' => $vendorDir . '/doctrine/dbal/src/Logging/LoggerChain.php', + 'Doctrine\\DBAL\\Logging\\Middleware' => $vendorDir . '/doctrine/dbal/src/Logging/Middleware.php', + 'Doctrine\\DBAL\\Logging\\SQLLogger' => $vendorDir . '/doctrine/dbal/src/Logging/SQLLogger.php', + 'Doctrine\\DBAL\\Logging\\Statement' => $vendorDir . '/doctrine/dbal/src/Logging/Statement.php', + 'Doctrine\\DBAL\\ParameterType' => $vendorDir . '/doctrine/dbal/src/ParameterType.php', + 'Doctrine\\DBAL\\Platforms\\AbstractMySQLPlatform' => $vendorDir . '/doctrine/dbal/src/Platforms/AbstractMySQLPlatform.php', + 'Doctrine\\DBAL\\Platforms\\AbstractPlatform' => $vendorDir . '/doctrine/dbal/src/Platforms/AbstractPlatform.php', + 'Doctrine\\DBAL\\Platforms\\DB2Platform' => $vendorDir . '/doctrine/dbal/src/Platforms/DB2Platform.php', + 'Doctrine\\DBAL\\Platforms\\DateIntervalUnit' => $vendorDir . '/doctrine/dbal/src/Platforms/DateIntervalUnit.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\DB2Keywords' => $vendorDir . '/doctrine/dbal/src/Platforms/Keywords/DB2Keywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\KeywordList' => $vendorDir . '/doctrine/dbal/src/Platforms/Keywords/KeywordList.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\MariaDBKeywords' => $vendorDir . '/doctrine/dbal/src/Platforms/Keywords/MariaDBKeywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\MariaDb102Keywords' => $vendorDir . '/doctrine/dbal/src/Platforms/Keywords/MariaDb102Keywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\MySQL57Keywords' => $vendorDir . '/doctrine/dbal/src/Platforms/Keywords/MySQL57Keywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\MySQL80Keywords' => $vendorDir . '/doctrine/dbal/src/Platforms/Keywords/MySQL80Keywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\MySQLKeywords' => $vendorDir . '/doctrine/dbal/src/Platforms/Keywords/MySQLKeywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\OracleKeywords' => $vendorDir . '/doctrine/dbal/src/Platforms/Keywords/OracleKeywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\PostgreSQL100Keywords' => $vendorDir . '/doctrine/dbal/src/Platforms/Keywords/PostgreSQL100Keywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\PostgreSQL94Keywords' => $vendorDir . '/doctrine/dbal/src/Platforms/Keywords/PostgreSQL94Keywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\PostgreSQLKeywords' => $vendorDir . '/doctrine/dbal/src/Platforms/Keywords/PostgreSQLKeywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\ReservedKeywordsValidator' => $vendorDir . '/doctrine/dbal/src/Platforms/Keywords/ReservedKeywordsValidator.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\SQLServer2012Keywords' => $vendorDir . '/doctrine/dbal/src/Platforms/Keywords/SQLServer2012Keywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\SQLServerKeywords' => $vendorDir . '/doctrine/dbal/src/Platforms/Keywords/SQLServerKeywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\SQLiteKeywords' => $vendorDir . '/doctrine/dbal/src/Platforms/Keywords/SQLiteKeywords.php', + 'Doctrine\\DBAL\\Platforms\\MariaDBPlatform' => $vendorDir . '/doctrine/dbal/src/Platforms/MariaDBPlatform.php', + 'Doctrine\\DBAL\\Platforms\\MariaDb1027Platform' => $vendorDir . '/doctrine/dbal/src/Platforms/MariaDb1027Platform.php', + 'Doctrine\\DBAL\\Platforms\\MySQL57Platform' => $vendorDir . '/doctrine/dbal/src/Platforms/MySQL57Platform.php', + 'Doctrine\\DBAL\\Platforms\\MySQL80Platform' => $vendorDir . '/doctrine/dbal/src/Platforms/MySQL80Platform.php', + 'Doctrine\\DBAL\\Platforms\\MySQLPlatform' => $vendorDir . '/doctrine/dbal/src/Platforms/MySQLPlatform.php', + 'Doctrine\\DBAL\\Platforms\\MySQL\\CollationMetadataProvider' => $vendorDir . '/doctrine/dbal/src/Platforms/MySQL/CollationMetadataProvider.php', + 'Doctrine\\DBAL\\Platforms\\MySQL\\CollationMetadataProvider\\CachingCollationMetadataProvider' => $vendorDir . '/doctrine/dbal/src/Platforms/MySQL/CollationMetadataProvider/CachingCollationMetadataProvider.php', + 'Doctrine\\DBAL\\Platforms\\MySQL\\CollationMetadataProvider\\ConnectionCollationMetadataProvider' => $vendorDir . '/doctrine/dbal/src/Platforms/MySQL/CollationMetadataProvider/ConnectionCollationMetadataProvider.php', + 'Doctrine\\DBAL\\Platforms\\MySQL\\Comparator' => $vendorDir . '/doctrine/dbal/src/Platforms/MySQL/Comparator.php', + 'Doctrine\\DBAL\\Platforms\\OraclePlatform' => $vendorDir . '/doctrine/dbal/src/Platforms/OraclePlatform.php', + 'Doctrine\\DBAL\\Platforms\\PostgreSQL100Platform' => $vendorDir . '/doctrine/dbal/src/Platforms/PostgreSQL100Platform.php', + 'Doctrine\\DBAL\\Platforms\\PostgreSQL94Platform' => $vendorDir . '/doctrine/dbal/src/Platforms/PostgreSQL94Platform.php', + 'Doctrine\\DBAL\\Platforms\\PostgreSQLPlatform' => $vendorDir . '/doctrine/dbal/src/Platforms/PostgreSQLPlatform.php', + 'Doctrine\\DBAL\\Platforms\\SQLServer2012Platform' => $vendorDir . '/doctrine/dbal/src/Platforms/SQLServer2012Platform.php', + 'Doctrine\\DBAL\\Platforms\\SQLServerPlatform' => $vendorDir . '/doctrine/dbal/src/Platforms/SQLServerPlatform.php', + 'Doctrine\\DBAL\\Platforms\\SQLServer\\Comparator' => $vendorDir . '/doctrine/dbal/src/Platforms/SQLServer/Comparator.php', + 'Doctrine\\DBAL\\Platforms\\SQLite\\Comparator' => $vendorDir . '/doctrine/dbal/src/Platforms/SQLite/Comparator.php', + 'Doctrine\\DBAL\\Platforms\\SqlitePlatform' => $vendorDir . '/doctrine/dbal/src/Platforms/SqlitePlatform.php', + 'Doctrine\\DBAL\\Platforms\\TrimMode' => $vendorDir . '/doctrine/dbal/src/Platforms/TrimMode.php', + 'Doctrine\\DBAL\\Portability\\Connection' => $vendorDir . '/doctrine/dbal/src/Portability/Connection.php', + 'Doctrine\\DBAL\\Portability\\Converter' => $vendorDir . '/doctrine/dbal/src/Portability/Converter.php', + 'Doctrine\\DBAL\\Portability\\Driver' => $vendorDir . '/doctrine/dbal/src/Portability/Driver.php', + 'Doctrine\\DBAL\\Portability\\Middleware' => $vendorDir . '/doctrine/dbal/src/Portability/Middleware.php', + 'Doctrine\\DBAL\\Portability\\OptimizeFlags' => $vendorDir . '/doctrine/dbal/src/Portability/OptimizeFlags.php', + 'Doctrine\\DBAL\\Portability\\Result' => $vendorDir . '/doctrine/dbal/src/Portability/Result.php', + 'Doctrine\\DBAL\\Portability\\Statement' => $vendorDir . '/doctrine/dbal/src/Portability/Statement.php', + 'Doctrine\\DBAL\\Query' => $vendorDir . '/doctrine/dbal/src/Query.php', + 'Doctrine\\DBAL\\Query\\Expression\\CompositeExpression' => $vendorDir . '/doctrine/dbal/src/Query/Expression/CompositeExpression.php', + 'Doctrine\\DBAL\\Query\\Expression\\ExpressionBuilder' => $vendorDir . '/doctrine/dbal/src/Query/Expression/ExpressionBuilder.php', + 'Doctrine\\DBAL\\Query\\QueryBuilder' => $vendorDir . '/doctrine/dbal/src/Query/QueryBuilder.php', + 'Doctrine\\DBAL\\Query\\QueryException' => $vendorDir . '/doctrine/dbal/src/Query/QueryException.php', + 'Doctrine\\DBAL\\Result' => $vendorDir . '/doctrine/dbal/src/Result.php', + 'Doctrine\\DBAL\\SQL\\Builder\\CreateSchemaObjectsSQLBuilder' => $vendorDir . '/doctrine/dbal/src/SQL/Builder/CreateSchemaObjectsSQLBuilder.php', + 'Doctrine\\DBAL\\SQL\\Builder\\DropSchemaObjectsSQLBuilder' => $vendorDir . '/doctrine/dbal/src/SQL/Builder/DropSchemaObjectsSQLBuilder.php', + 'Doctrine\\DBAL\\SQL\\Parser' => $vendorDir . '/doctrine/dbal/src/SQL/Parser.php', + 'Doctrine\\DBAL\\SQL\\Parser\\Exception' => $vendorDir . '/doctrine/dbal/src/SQL/Parser/Exception.php', + 'Doctrine\\DBAL\\SQL\\Parser\\Exception\\RegularExpressionError' => $vendorDir . '/doctrine/dbal/src/SQL/Parser/Exception/RegularExpressionError.php', + 'Doctrine\\DBAL\\SQL\\Parser\\Visitor' => $vendorDir . '/doctrine/dbal/src/SQL/Parser/Visitor.php', + 'Doctrine\\DBAL\\Schema\\AbstractAsset' => $vendorDir . '/doctrine/dbal/src/Schema/AbstractAsset.php', + 'Doctrine\\DBAL\\Schema\\AbstractSchemaManager' => $vendorDir . '/doctrine/dbal/src/Schema/AbstractSchemaManager.php', + 'Doctrine\\DBAL\\Schema\\Column' => $vendorDir . '/doctrine/dbal/src/Schema/Column.php', + 'Doctrine\\DBAL\\Schema\\ColumnDiff' => $vendorDir . '/doctrine/dbal/src/Schema/ColumnDiff.php', + 'Doctrine\\DBAL\\Schema\\Comparator' => $vendorDir . '/doctrine/dbal/src/Schema/Comparator.php', + 'Doctrine\\DBAL\\Schema\\Constraint' => $vendorDir . '/doctrine/dbal/src/Schema/Constraint.php', + 'Doctrine\\DBAL\\Schema\\DB2SchemaManager' => $vendorDir . '/doctrine/dbal/src/Schema/DB2SchemaManager.php', + 'Doctrine\\DBAL\\Schema\\Exception\\ColumnAlreadyExists' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/ColumnAlreadyExists.php', + 'Doctrine\\DBAL\\Schema\\Exception\\ColumnDoesNotExist' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/ColumnDoesNotExist.php', + 'Doctrine\\DBAL\\Schema\\Exception\\ForeignKeyDoesNotExist' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/ForeignKeyDoesNotExist.php', + 'Doctrine\\DBAL\\Schema\\Exception\\IndexAlreadyExists' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/IndexAlreadyExists.php', + 'Doctrine\\DBAL\\Schema\\Exception\\IndexDoesNotExist' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/IndexDoesNotExist.php', + 'Doctrine\\DBAL\\Schema\\Exception\\IndexNameInvalid' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/IndexNameInvalid.php', + 'Doctrine\\DBAL\\Schema\\Exception\\InvalidTableName' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/InvalidTableName.php', + 'Doctrine\\DBAL\\Schema\\Exception\\NamedForeignKeyRequired' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/NamedForeignKeyRequired.php', + 'Doctrine\\DBAL\\Schema\\Exception\\NamespaceAlreadyExists' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/NamespaceAlreadyExists.php', + 'Doctrine\\DBAL\\Schema\\Exception\\SequenceAlreadyExists' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/SequenceAlreadyExists.php', + 'Doctrine\\DBAL\\Schema\\Exception\\SequenceDoesNotExist' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/SequenceDoesNotExist.php', + 'Doctrine\\DBAL\\Schema\\Exception\\TableAlreadyExists' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/TableAlreadyExists.php', + 'Doctrine\\DBAL\\Schema\\Exception\\TableDoesNotExist' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/TableDoesNotExist.php', + 'Doctrine\\DBAL\\Schema\\Exception\\UniqueConstraintDoesNotExist' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/UniqueConstraintDoesNotExist.php', + 'Doctrine\\DBAL\\Schema\\Exception\\UnknownColumnOption' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/UnknownColumnOption.php', + 'Doctrine\\DBAL\\Schema\\ForeignKeyConstraint' => $vendorDir . '/doctrine/dbal/src/Schema/ForeignKeyConstraint.php', + 'Doctrine\\DBAL\\Schema\\Identifier' => $vendorDir . '/doctrine/dbal/src/Schema/Identifier.php', + 'Doctrine\\DBAL\\Schema\\Index' => $vendorDir . '/doctrine/dbal/src/Schema/Index.php', + 'Doctrine\\DBAL\\Schema\\MySQLSchemaManager' => $vendorDir . '/doctrine/dbal/src/Schema/MySQLSchemaManager.php', + 'Doctrine\\DBAL\\Schema\\OracleSchemaManager' => $vendorDir . '/doctrine/dbal/src/Schema/OracleSchemaManager.php', + 'Doctrine\\DBAL\\Schema\\PostgreSQLSchemaManager' => $vendorDir . '/doctrine/dbal/src/Schema/PostgreSQLSchemaManager.php', + 'Doctrine\\DBAL\\Schema\\SQLServerSchemaManager' => $vendorDir . '/doctrine/dbal/src/Schema/SQLServerSchemaManager.php', + 'Doctrine\\DBAL\\Schema\\Schema' => $vendorDir . '/doctrine/dbal/src/Schema/Schema.php', + 'Doctrine\\DBAL\\Schema\\SchemaConfig' => $vendorDir . '/doctrine/dbal/src/Schema/SchemaConfig.php', + 'Doctrine\\DBAL\\Schema\\SchemaDiff' => $vendorDir . '/doctrine/dbal/src/Schema/SchemaDiff.php', + 'Doctrine\\DBAL\\Schema\\SchemaException' => $vendorDir . '/doctrine/dbal/src/Schema/SchemaException.php', + 'Doctrine\\DBAL\\Schema\\Sequence' => $vendorDir . '/doctrine/dbal/src/Schema/Sequence.php', + 'Doctrine\\DBAL\\Schema\\SqliteSchemaManager' => $vendorDir . '/doctrine/dbal/src/Schema/SqliteSchemaManager.php', + 'Doctrine\\DBAL\\Schema\\Table' => $vendorDir . '/doctrine/dbal/src/Schema/Table.php', + 'Doctrine\\DBAL\\Schema\\TableDiff' => $vendorDir . '/doctrine/dbal/src/Schema/TableDiff.php', + 'Doctrine\\DBAL\\Schema\\UniqueConstraint' => $vendorDir . '/doctrine/dbal/src/Schema/UniqueConstraint.php', + 'Doctrine\\DBAL\\Schema\\View' => $vendorDir . '/doctrine/dbal/src/Schema/View.php', + 'Doctrine\\DBAL\\Schema\\Visitor\\AbstractVisitor' => $vendorDir . '/doctrine/dbal/src/Schema/Visitor/AbstractVisitor.php', + 'Doctrine\\DBAL\\Schema\\Visitor\\CreateSchemaSqlCollector' => $vendorDir . '/doctrine/dbal/src/Schema/Visitor/CreateSchemaSqlCollector.php', + 'Doctrine\\DBAL\\Schema\\Visitor\\DropSchemaSqlCollector' => $vendorDir . '/doctrine/dbal/src/Schema/Visitor/DropSchemaSqlCollector.php', + 'Doctrine\\DBAL\\Schema\\Visitor\\Graphviz' => $vendorDir . '/doctrine/dbal/src/Schema/Visitor/Graphviz.php', + 'Doctrine\\DBAL\\Schema\\Visitor\\NamespaceVisitor' => $vendorDir . '/doctrine/dbal/src/Schema/Visitor/NamespaceVisitor.php', + 'Doctrine\\DBAL\\Schema\\Visitor\\RemoveNamespacedAssets' => $vendorDir . '/doctrine/dbal/src/Schema/Visitor/RemoveNamespacedAssets.php', + 'Doctrine\\DBAL\\Schema\\Visitor\\Visitor' => $vendorDir . '/doctrine/dbal/src/Schema/Visitor/Visitor.php', + 'Doctrine\\DBAL\\Statement' => $vendorDir . '/doctrine/dbal/src/Statement.php', + 'Doctrine\\DBAL\\Tools\\Console\\Command\\ReservedWordsCommand' => $vendorDir . '/doctrine/dbal/src/Tools/Console/Command/ReservedWordsCommand.php', + 'Doctrine\\DBAL\\Tools\\Console\\Command\\RunSqlCommand' => $vendorDir . '/doctrine/dbal/src/Tools/Console/Command/RunSqlCommand.php', + 'Doctrine\\DBAL\\Tools\\Console\\ConnectionNotFound' => $vendorDir . '/doctrine/dbal/src/Tools/Console/ConnectionNotFound.php', + 'Doctrine\\DBAL\\Tools\\Console\\ConnectionProvider' => $vendorDir . '/doctrine/dbal/src/Tools/Console/ConnectionProvider.php', + 'Doctrine\\DBAL\\Tools\\Console\\ConnectionProvider\\SingleConnectionProvider' => $vendorDir . '/doctrine/dbal/src/Tools/Console/ConnectionProvider/SingleConnectionProvider.php', + 'Doctrine\\DBAL\\Tools\\Console\\ConsoleRunner' => $vendorDir . '/doctrine/dbal/src/Tools/Console/ConsoleRunner.php', + 'Doctrine\\DBAL\\TransactionIsolationLevel' => $vendorDir . '/doctrine/dbal/src/TransactionIsolationLevel.php', + 'Doctrine\\DBAL\\Types\\ArrayType' => $vendorDir . '/doctrine/dbal/src/Types/ArrayType.php', + 'Doctrine\\DBAL\\Types\\AsciiStringType' => $vendorDir . '/doctrine/dbal/src/Types/AsciiStringType.php', + 'Doctrine\\DBAL\\Types\\BigIntType' => $vendorDir . '/doctrine/dbal/src/Types/BigIntType.php', + 'Doctrine\\DBAL\\Types\\BinaryType' => $vendorDir . '/doctrine/dbal/src/Types/BinaryType.php', + 'Doctrine\\DBAL\\Types\\BlobType' => $vendorDir . '/doctrine/dbal/src/Types/BlobType.php', + 'Doctrine\\DBAL\\Types\\BooleanType' => $vendorDir . '/doctrine/dbal/src/Types/BooleanType.php', + 'Doctrine\\DBAL\\Types\\ConversionException' => $vendorDir . '/doctrine/dbal/src/Types/ConversionException.php', + 'Doctrine\\DBAL\\Types\\DateImmutableType' => $vendorDir . '/doctrine/dbal/src/Types/DateImmutableType.php', + 'Doctrine\\DBAL\\Types\\DateIntervalType' => $vendorDir . '/doctrine/dbal/src/Types/DateIntervalType.php', + 'Doctrine\\DBAL\\Types\\DateTimeImmutableType' => $vendorDir . '/doctrine/dbal/src/Types/DateTimeImmutableType.php', + 'Doctrine\\DBAL\\Types\\DateTimeType' => $vendorDir . '/doctrine/dbal/src/Types/DateTimeType.php', + 'Doctrine\\DBAL\\Types\\DateTimeTzImmutableType' => $vendorDir . '/doctrine/dbal/src/Types/DateTimeTzImmutableType.php', + 'Doctrine\\DBAL\\Types\\DateTimeTzType' => $vendorDir . '/doctrine/dbal/src/Types/DateTimeTzType.php', + 'Doctrine\\DBAL\\Types\\DateType' => $vendorDir . '/doctrine/dbal/src/Types/DateType.php', + 'Doctrine\\DBAL\\Types\\DecimalType' => $vendorDir . '/doctrine/dbal/src/Types/DecimalType.php', + 'Doctrine\\DBAL\\Types\\FloatType' => $vendorDir . '/doctrine/dbal/src/Types/FloatType.php', + 'Doctrine\\DBAL\\Types\\GuidType' => $vendorDir . '/doctrine/dbal/src/Types/GuidType.php', + 'Doctrine\\DBAL\\Types\\IntegerType' => $vendorDir . '/doctrine/dbal/src/Types/IntegerType.php', + 'Doctrine\\DBAL\\Types\\JsonType' => $vendorDir . '/doctrine/dbal/src/Types/JsonType.php', + 'Doctrine\\DBAL\\Types\\ObjectType' => $vendorDir . '/doctrine/dbal/src/Types/ObjectType.php', + 'Doctrine\\DBAL\\Types\\PhpDateTimeMappingType' => $vendorDir . '/doctrine/dbal/src/Types/PhpDateTimeMappingType.php', + 'Doctrine\\DBAL\\Types\\PhpIntegerMappingType' => $vendorDir . '/doctrine/dbal/src/Types/PhpIntegerMappingType.php', + 'Doctrine\\DBAL\\Types\\SimpleArrayType' => $vendorDir . '/doctrine/dbal/src/Types/SimpleArrayType.php', + 'Doctrine\\DBAL\\Types\\SmallIntType' => $vendorDir . '/doctrine/dbal/src/Types/SmallIntType.php', + 'Doctrine\\DBAL\\Types\\StringType' => $vendorDir . '/doctrine/dbal/src/Types/StringType.php', + 'Doctrine\\DBAL\\Types\\TextType' => $vendorDir . '/doctrine/dbal/src/Types/TextType.php', + 'Doctrine\\DBAL\\Types\\TimeImmutableType' => $vendorDir . '/doctrine/dbal/src/Types/TimeImmutableType.php', + 'Doctrine\\DBAL\\Types\\TimeType' => $vendorDir . '/doctrine/dbal/src/Types/TimeType.php', + 'Doctrine\\DBAL\\Types\\Type' => $vendorDir . '/doctrine/dbal/src/Types/Type.php', + 'Doctrine\\DBAL\\Types\\TypeRegistry' => $vendorDir . '/doctrine/dbal/src/Types/TypeRegistry.php', + 'Doctrine\\DBAL\\Types\\Types' => $vendorDir . '/doctrine/dbal/src/Types/Types.php', + 'Doctrine\\DBAL\\Types\\VarDateTimeImmutableType' => $vendorDir . '/doctrine/dbal/src/Types/VarDateTimeImmutableType.php', + 'Doctrine\\DBAL\\Types\\VarDateTimeType' => $vendorDir . '/doctrine/dbal/src/Types/VarDateTimeType.php', + 'Doctrine\\DBAL\\VersionAwarePlatformDriver' => $vendorDir . '/doctrine/dbal/src/VersionAwarePlatformDriver.php', + 'Doctrine\\Deprecations\\Deprecation' => $vendorDir . '/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php', + 'Doctrine\\Deprecations\\PHPUnit\\VerifyDeprecations' => $vendorDir . '/doctrine/deprecations/lib/Doctrine/Deprecations/PHPUnit/VerifyDeprecations.php', 'Doctrine\\Inflector\\CachedWordInflector' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php', 'Doctrine\\Inflector\\GenericLanguageInflectorFactory' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php', 'Doctrine\\Inflector\\Inflector' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php', @@ -5281,6 +5661,7 @@ return array( 'Symfony\\Thanks\\Thanks' => $vendorDir . '/symfony/thanks/src/Thanks.php', 'Tests\\CreatesApplication' => $baseDir . '/tests/CreatesApplication.php', 'Tests\\Feature\\ExampleTest' => $baseDir . '/tests/Feature/ExampleTest.php', + 'Tests\\Feature\\ItemExportTest' => $baseDir . '/tests/Feature/ItemExportTest.php', 'Tests\\TestCase' => $baseDir . '/tests/TestCase.php', 'Tests\\Unit\\database\\seeders\\SettingsSeederTest' => $baseDir . '/tests/Unit/database/seeders/SettingsSeederTest.php', 'Tests\\Unit\\lang\\LangTest' => $baseDir . '/tests/Unit/lang/LangTest.php', @@ -5321,5 +5702,60 @@ return array( 'Whoops\\Util\\Misc' => $vendorDir . '/filp/whoops/src/Whoops/Util/Misc.php', 'Whoops\\Util\\SystemFacade' => $vendorDir . '/filp/whoops/src/Whoops/Util/SystemFacade.php', 'Whoops\\Util\\TemplateHelper' => $vendorDir . '/filp/whoops/src/Whoops/Util/TemplateHelper.php', + 'phpDocumentor\\Reflection\\Element' => $vendorDir . '/phpdocumentor/reflection-common/src/Element.php', + 'phpDocumentor\\Reflection\\File' => $vendorDir . '/phpdocumentor/reflection-common/src/File.php', + 'phpDocumentor\\Reflection\\Fqsen' => $vendorDir . '/phpdocumentor/reflection-common/src/Fqsen.php', + 'phpDocumentor\\Reflection\\FqsenResolver' => $vendorDir . '/phpdocumentor/type-resolver/src/FqsenResolver.php', + 'phpDocumentor\\Reflection\\Location' => $vendorDir . '/phpdocumentor/reflection-common/src/Location.php', + 'phpDocumentor\\Reflection\\Project' => $vendorDir . '/phpdocumentor/reflection-common/src/Project.php', + 'phpDocumentor\\Reflection\\ProjectFactory' => $vendorDir . '/phpdocumentor/reflection-common/src/ProjectFactory.php', + 'phpDocumentor\\Reflection\\PseudoType' => $vendorDir . '/phpdocumentor/type-resolver/src/PseudoType.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\CallableString' => $vendorDir . '/phpdocumentor/type-resolver/src/PseudoTypes/CallableString.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\False_' => $vendorDir . '/phpdocumentor/type-resolver/src/PseudoTypes/False_.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\HtmlEscapedString' => $vendorDir . '/phpdocumentor/type-resolver/src/PseudoTypes/HtmlEscapedString.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\IntegerRange' => $vendorDir . '/phpdocumentor/type-resolver/src/PseudoTypes/IntegerRange.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\List_' => $vendorDir . '/phpdocumentor/type-resolver/src/PseudoTypes/List_.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\LiteralString' => $vendorDir . '/phpdocumentor/type-resolver/src/PseudoTypes/LiteralString.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\LowercaseString' => $vendorDir . '/phpdocumentor/type-resolver/src/PseudoTypes/LowercaseString.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\NegativeInteger' => $vendorDir . '/phpdocumentor/type-resolver/src/PseudoTypes/NegativeInteger.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\NonEmptyLowercaseString' => $vendorDir . '/phpdocumentor/type-resolver/src/PseudoTypes/NonEmptyLowercaseString.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\NonEmptyString' => $vendorDir . '/phpdocumentor/type-resolver/src/PseudoTypes/NonEmptyString.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\NumericString' => $vendorDir . '/phpdocumentor/type-resolver/src/PseudoTypes/NumericString.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\Numeric_' => $vendorDir . '/phpdocumentor/type-resolver/src/PseudoTypes/Numeric_.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\PositiveInteger' => $vendorDir . '/phpdocumentor/type-resolver/src/PseudoTypes/PositiveInteger.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\TraitString' => $vendorDir . '/phpdocumentor/type-resolver/src/PseudoTypes/TraitString.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\True_' => $vendorDir . '/phpdocumentor/type-resolver/src/PseudoTypes/True_.php', + 'phpDocumentor\\Reflection\\Type' => $vendorDir . '/phpdocumentor/type-resolver/src/Type.php', + 'phpDocumentor\\Reflection\\TypeResolver' => $vendorDir . '/phpdocumentor/type-resolver/src/TypeResolver.php', + 'phpDocumentor\\Reflection\\Types\\AbstractList' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/AbstractList.php', + 'phpDocumentor\\Reflection\\Types\\AggregatedType' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/AggregatedType.php', + 'phpDocumentor\\Reflection\\Types\\ArrayKey' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/ArrayKey.php', + 'phpDocumentor\\Reflection\\Types\\Array_' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/Array_.php', + 'phpDocumentor\\Reflection\\Types\\Boolean' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/Boolean.php', + 'phpDocumentor\\Reflection\\Types\\Callable_' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/Callable_.php', + 'phpDocumentor\\Reflection\\Types\\ClassString' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/ClassString.php', + 'phpDocumentor\\Reflection\\Types\\Collection' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/Collection.php', + 'phpDocumentor\\Reflection\\Types\\Compound' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/Compound.php', + 'phpDocumentor\\Reflection\\Types\\Context' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/Context.php', + 'phpDocumentor\\Reflection\\Types\\ContextFactory' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/ContextFactory.php', + 'phpDocumentor\\Reflection\\Types\\Expression' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/Expression.php', + 'phpDocumentor\\Reflection\\Types\\Float_' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/Float_.php', + 'phpDocumentor\\Reflection\\Types\\Integer' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/Integer.php', + 'phpDocumentor\\Reflection\\Types\\InterfaceString' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/InterfaceString.php', + 'phpDocumentor\\Reflection\\Types\\Intersection' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/Intersection.php', + 'phpDocumentor\\Reflection\\Types\\Iterable_' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/Iterable_.php', + 'phpDocumentor\\Reflection\\Types\\Mixed_' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/Mixed_.php', + 'phpDocumentor\\Reflection\\Types\\Never_' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/Never_.php', + 'phpDocumentor\\Reflection\\Types\\Null_' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/Null_.php', + 'phpDocumentor\\Reflection\\Types\\Nullable' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/Nullable.php', + 'phpDocumentor\\Reflection\\Types\\Object_' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/Object_.php', + 'phpDocumentor\\Reflection\\Types\\Parent_' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/Parent_.php', + 'phpDocumentor\\Reflection\\Types\\Resource_' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/Resource_.php', + 'phpDocumentor\\Reflection\\Types\\Scalar' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/Scalar.php', + 'phpDocumentor\\Reflection\\Types\\Self_' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/Self_.php', + 'phpDocumentor\\Reflection\\Types\\Static_' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/Static_.php', + 'phpDocumentor\\Reflection\\Types\\String_' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/String_.php', + 'phpDocumentor\\Reflection\\Types\\This' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/This.php', + 'phpDocumentor\\Reflection\\Types\\Void_' => $vendorDir . '/phpdocumentor/type-resolver/src/Types/Void_.php', 'voku\\helper\\ASCII' => $vendorDir . '/voku/portable-ascii/src/voku/helper/ASCII.php', ); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index 89a7be07..5e5f538a 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -7,4 +7,5 @@ $baseDir = dirname($vendorDir); return array( 'Mockery' => array($vendorDir . '/mockery/mockery/library'), + 'Barryvdh' => array($vendorDir . '/barryvdh/reflection-docblock/src'), ); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 2716478d..64df7320 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -7,6 +7,7 @@ $baseDir = dirname($vendorDir); return array( 'voku\\' => array($vendorDir . '/voku/portable-ascii/src/voku'), + 'phpDocumentor\\Reflection\\' => array($vendorDir . '/phpdocumentor/reflection-common/src', $vendorDir . '/phpdocumentor/type-resolver/src'), 'Whoops\\' => array($vendorDir . '/filp/whoops/src/Whoops'), 'Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'), 'TijsVerkoyen\\CssToInlineStyles\\' => array($vendorDir . '/tijsverkoyen/css-to-inline-styles/src'), @@ -92,15 +93,21 @@ return array( 'Dotenv\\' => array($vendorDir . '/vlucas/phpdotenv/src'), 'Doctrine\\Instantiator\\' => array($vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator'), 'Doctrine\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector'), + 'Doctrine\\Deprecations\\' => array($vendorDir . '/doctrine/deprecations/lib/Doctrine/Deprecations'), + 'Doctrine\\DBAL\\' => array($vendorDir . '/doctrine/dbal/src'), 'Doctrine\\Common\\Lexer\\' => array($vendorDir . '/doctrine/lexer/lib/Doctrine/Common/Lexer'), + 'Doctrine\\Common\\Cache\\' => array($vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache'), + 'Doctrine\\Common\\' => array($vendorDir . '/doctrine/event-manager/src'), 'Dflydev\\DotAccessData\\' => array($vendorDir . '/dflydev/dot-access-data/src'), 'DeepCopy\\' => array($vendorDir . '/myclabs/deep-copy/src/DeepCopy'), 'Database\\Seeders\\' => array($baseDir . '/database/seeders'), 'Database\\Factories\\' => array($baseDir . '/database/factories'), 'Cron\\' => array($vendorDir . '/dragonmantank/cron-expression/src/Cron'), + 'Composer\\Pcre\\' => array($vendorDir . '/composer/pcre/src'), 'Collective\\Html\\' => array($vendorDir . '/laravelcollective/html/src'), 'Clue\\StreamFilter\\' => array($vendorDir . '/clue/stream-filter/src'), 'Carbon\\' => array($vendorDir . '/nesbot/carbon/src/Carbon'), 'Brick\\Math\\' => array($vendorDir . '/brick/math/src'), + 'Barryvdh\\LaravelIdeHelper\\' => array($vendorDir . '/barryvdh/laravel-ide-helper/src'), 'App\\' => array($baseDir . '/app'), ); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 34f2ea35..231d4f52 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -47,6 +47,10 @@ class ComposerStaticInitb2555e5ff7197b9e020da74bbd3b7cfa array ( 'voku\\' => 5, ), + 'p' => + array ( + 'phpDocumentor\\Reflection\\' => 25, + ), 'W' => array ( 'Whoops\\' => 7, @@ -176,7 +180,11 @@ class ComposerStaticInitb2555e5ff7197b9e020da74bbd3b7cfa 'Dotenv\\' => 7, 'Doctrine\\Instantiator\\' => 22, 'Doctrine\\Inflector\\' => 19, + 'Doctrine\\Deprecations\\' => 22, + 'Doctrine\\DBAL\\' => 14, 'Doctrine\\Common\\Lexer\\' => 22, + 'Doctrine\\Common\\Cache\\' => 22, + 'Doctrine\\Common\\' => 16, 'Dflydev\\DotAccessData\\' => 22, 'DeepCopy\\' => 9, 'Database\\Seeders\\' => 17, @@ -185,6 +193,7 @@ class ComposerStaticInitb2555e5ff7197b9e020da74bbd3b7cfa 'C' => array ( 'Cron\\' => 5, + 'Composer\\Pcre\\' => 14, 'Collective\\Html\\' => 16, 'Clue\\StreamFilter\\' => 18, 'Carbon\\' => 7, @@ -192,6 +201,7 @@ class ComposerStaticInitb2555e5ff7197b9e020da74bbd3b7cfa 'B' => array ( 'Brick\\Math\\' => 11, + 'Barryvdh\\LaravelIdeHelper\\' => 26, ), 'A' => array ( @@ -204,6 +214,11 @@ class ComposerStaticInitb2555e5ff7197b9e020da74bbd3b7cfa array ( 0 => __DIR__ . '/..' . '/voku/portable-ascii/src/voku', ), + 'phpDocumentor\\Reflection\\' => + array ( + 0 => __DIR__ . '/..' . '/phpdocumentor/reflection-common/src', + 1 => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src', + ), 'Whoops\\' => array ( 0 => __DIR__ . '/..' . '/filp/whoops/src/Whoops', @@ -547,10 +562,26 @@ class ComposerStaticInitb2555e5ff7197b9e020da74bbd3b7cfa array ( 0 => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector', ), + 'Doctrine\\Deprecations\\' => + array ( + 0 => __DIR__ . '/..' . '/doctrine/deprecations/lib/Doctrine/Deprecations', + ), + 'Doctrine\\DBAL\\' => + array ( + 0 => __DIR__ . '/..' . '/doctrine/dbal/src', + ), 'Doctrine\\Common\\Lexer\\' => array ( 0 => __DIR__ . '/..' . '/doctrine/lexer/lib/Doctrine/Common/Lexer', ), + 'Doctrine\\Common\\Cache\\' => + array ( + 0 => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache', + ), + 'Doctrine\\Common\\' => + array ( + 0 => __DIR__ . '/..' . '/doctrine/event-manager/src', + ), 'Dflydev\\DotAccessData\\' => array ( 0 => __DIR__ . '/..' . '/dflydev/dot-access-data/src', @@ -571,6 +602,10 @@ class ComposerStaticInitb2555e5ff7197b9e020da74bbd3b7cfa array ( 0 => __DIR__ . '/..' . '/dragonmantank/cron-expression/src/Cron', ), + 'Composer\\Pcre\\' => + array ( + 0 => __DIR__ . '/..' . '/composer/pcre/src', + ), 'Collective\\Html\\' => array ( 0 => __DIR__ . '/..' . '/laravelcollective/html/src', @@ -587,6 +622,10 @@ class ComposerStaticInitb2555e5ff7197b9e020da74bbd3b7cfa array ( 0 => __DIR__ . '/..' . '/brick/math/src', ), + 'Barryvdh\\LaravelIdeHelper\\' => + array ( + 0 => __DIR__ . '/..' . '/barryvdh/laravel-ide-helper/src', + ), 'App\\' => array ( 0 => __DIR__ . '/../..' . '/app', @@ -601,6 +640,13 @@ class ComposerStaticInitb2555e5ff7197b9e020da74bbd3b7cfa 0 => __DIR__ . '/..' . '/mockery/mockery/library', ), ), + 'B' => + array ( + 'Barryvdh' => + array ( + 0 => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src', + ), + ), ); public static $classMap = array ( @@ -615,6 +661,7 @@ class ComposerStaticInitb2555e5ff7197b9e020da74bbd3b7cfa 'App\\Http\\Controllers\\Auth\\ResetPasswordController' => __DIR__ . '/../..' . '/app/Http/Controllers/Auth/ResetPasswordController.php', 'App\\Http\\Controllers\\Controller' => __DIR__ . '/../..' . '/app/Http/Controllers/Controller.php', 'App\\Http\\Controllers\\HomeController' => __DIR__ . '/../..' . '/app/Http/Controllers/HomeController.php', + 'App\\Http\\Controllers\\ImportController' => __DIR__ . '/../..' . '/app/Http/Controllers/ImportController.php', 'App\\Http\\Controllers\\ItemController' => __DIR__ . '/../..' . '/app/Http/Controllers/ItemController.php', 'App\\Http\\Controllers\\ItemRestController' => __DIR__ . '/../..' . '/app/Http/Controllers/ItemRestController.php', 'App\\Http\\Controllers\\SearchController' => __DIR__ . '/../..' . '/app/Http/Controllers/SearchController.php', @@ -643,8 +690,76 @@ class ComposerStaticInitb2555e5ff7197b9e020da74bbd3b7cfa 'App\\SettingGroup' => __DIR__ . '/../..' . '/app/SettingGroup.php', 'App\\SettingUser' => __DIR__ . '/../..' . '/app/SettingUser.php', 'App\\SupportedApps' => __DIR__ . '/../..' . '/app/SupportedApps.php', + 'App\\SupportedApps\\AMP\\AMP' => __DIR__ . '/../..' . '/app/SupportedApps/AMP/AMP.php', + 'App\\SupportedApps\\AdGuardHome\\AdGuardHome' => __DIR__ . '/../..' . '/app/SupportedApps/AdGuardHome/AdGuardHome.php', + 'App\\SupportedApps\\Adminer\\Adminer' => __DIR__ . '/../..' . '/app/SupportedApps/Adminer/Adminer.php', + 'App\\SupportedApps\\Alertmanager\\Alertmanager' => __DIR__ . '/../..' . '/app/SupportedApps/Alertmanager/Alertmanager.php', + 'App\\SupportedApps\\ArchiSteamFarm\\ArchiSteamFarm' => __DIR__ . '/../..' . '/app/SupportedApps/ArchiSteamFarm/ArchiSteamFarm.php', + 'App\\SupportedApps\\ArgoCD\\ArgoCD' => __DIR__ . '/../..' . '/app/SupportedApps/ArgoCD/ArgoCD.php', + 'App\\SupportedApps\\AriaNg\\AriaNg' => __DIR__ . '/../..' . '/app/SupportedApps/AriaNg/AriaNg.php', + 'App\\SupportedApps\\Atlantis\\Atlantis' => __DIR__ . '/../..' . '/app/SupportedApps/Atlantis/Atlantis.php', + 'App\\SupportedApps\\Bastillion\\Bastillion' => __DIR__ . '/../..' . '/app/SupportedApps/Bastillion/Bastillion.php', + 'App\\SupportedApps\\Jellyfin\\Jellyfin' => __DIR__ . '/../..' . '/app/SupportedApps/Jellyfin/Jellyfin.php', + 'App\\SupportedApps\\Jira\\Jira' => __DIR__ . '/../..' . '/app/SupportedApps/Jira/Jira.php', + 'App\\SupportedApps\\Kibana\\Kibana' => __DIR__ . '/../..' . '/app/SupportedApps/Kibana/Kibana.php', + 'App\\SupportedApps\\MotionEye\\MotionEye' => __DIR__ . '/../..' . '/app/SupportedApps/MotionEye/MotionEye.php', + 'App\\SupportedApps\\Munin\\Munin' => __DIR__ . '/../..' . '/app/SupportedApps/Munin/Munin.php', + 'App\\SupportedApps\\MusicBrainz\\MusicBrainz' => __DIR__ . '/../..' . '/app/SupportedApps/MusicBrainz/MusicBrainz.php', + 'App\\SupportedApps\\Pihole\\Pihole' => __DIR__ . '/../..' . '/app/SupportedApps/Pihole/Pihole.php', + 'App\\SupportedApps\\Plex\\Plex' => __DIR__ . '/../..' . '/app/SupportedApps/Plex/Plex.php', + 'App\\SupportedApps\\Portainer\\Portainer' => __DIR__ . '/../..' . '/app/SupportedApps/Portainer/Portainer.php', + 'App\\SupportedApps\\Poste\\Poste' => __DIR__ . '/../..' . '/app/SupportedApps/Poste/Poste.php', + 'App\\SupportedApps\\Printer\\Printer' => __DIR__ . '/../..' . '/app/SupportedApps/Printer/Printer.php', + 'App\\SupportedApps\\Rancher\\Rancher' => __DIR__ . '/../..' . '/app/SupportedApps/Rancher/Rancher.php', + 'App\\SupportedApps\\TYPO3\\TYPO3' => __DIR__ . '/../..' . '/app/SupportedApps/TYPO3/TYPO3.php', + 'App\\SupportedApps\\Tar1090\\Tar1090' => __DIR__ . '/../..' . '/app/SupportedApps/Tar1090/Tar1090.php', + 'App\\SupportedApps\\Transmission\\Transmission' => __DIR__ . '/../..' . '/app/SupportedApps/Transmission/Transmission.php', + 'App\\SupportedApps\\Trilium\\Trilium' => __DIR__ . '/../..' . '/app/SupportedApps/Trilium/Trilium.php', + 'App\\SupportedApps\\TrueNAS\\TrueNAS' => __DIR__ . '/../..' . '/app/SupportedApps/TrueNAS/TrueNAS.php', + 'App\\SupportedApps\\Ubooquity\\Ubooquity' => __DIR__ . '/../..' . '/app/SupportedApps/Ubooquity/Ubooquity.php', + 'App\\SupportedApps\\UniFi\\UniFi' => __DIR__ . '/../..' . '/app/SupportedApps/UniFi/UniFi.php', 'App\\User' => __DIR__ . '/../..' . '/app/User.php', 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', + 'Barryvdh\\LaravelIdeHelper\\Alias' => __DIR__ . '/..' . '/barryvdh/laravel-ide-helper/src/Alias.php', + 'Barryvdh\\LaravelIdeHelper\\ClassMapGenerator' => __DIR__ . '/..' . '/barryvdh/laravel-ide-helper/src/ClassMapGenerator.php', + 'Barryvdh\\LaravelIdeHelper\\Console\\EloquentCommand' => __DIR__ . '/..' . '/barryvdh/laravel-ide-helper/src/Console/EloquentCommand.php', + 'Barryvdh\\LaravelIdeHelper\\Console\\GeneratorCommand' => __DIR__ . '/..' . '/barryvdh/laravel-ide-helper/src/Console/GeneratorCommand.php', + 'Barryvdh\\LaravelIdeHelper\\Console\\MetaCommand' => __DIR__ . '/..' . '/barryvdh/laravel-ide-helper/src/Console/MetaCommand.php', + 'Barryvdh\\LaravelIdeHelper\\Console\\ModelsCommand' => __DIR__ . '/..' . '/barryvdh/laravel-ide-helper/src/Console/ModelsCommand.php', + 'Barryvdh\\LaravelIdeHelper\\Contracts\\ModelHookInterface' => __DIR__ . '/..' . '/barryvdh/laravel-ide-helper/src/Contracts/ModelHookInterface.php', + 'Barryvdh\\LaravelIdeHelper\\Eloquent' => __DIR__ . '/..' . '/barryvdh/laravel-ide-helper/src/Eloquent.php', + 'Barryvdh\\LaravelIdeHelper\\Factories' => __DIR__ . '/..' . '/barryvdh/laravel-ide-helper/src/Factories.php', + 'Barryvdh\\LaravelIdeHelper\\Generator' => __DIR__ . '/..' . '/barryvdh/laravel-ide-helper/src/Generator.php', + 'Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider' => __DIR__ . '/..' . '/barryvdh/laravel-ide-helper/src/IdeHelperServiceProvider.php', + 'Barryvdh\\LaravelIdeHelper\\Listeners\\GenerateModelHelper' => __DIR__ . '/..' . '/barryvdh/laravel-ide-helper/src/Listeners/GenerateModelHelper.php', + 'Barryvdh\\LaravelIdeHelper\\Macro' => __DIR__ . '/..' . '/barryvdh/laravel-ide-helper/src/Macro.php', + 'Barryvdh\\LaravelIdeHelper\\Method' => __DIR__ . '/..' . '/barryvdh/laravel-ide-helper/src/Method.php', + 'Barryvdh\\LaravelIdeHelper\\UsesResolver' => __DIR__ . '/..' . '/barryvdh/laravel-ide-helper/src/UsesResolver.php', + 'Barryvdh\\Reflection\\DocBlock' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock.php', + 'Barryvdh\\Reflection\\DocBlock\\Context' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Context.php', + 'Barryvdh\\Reflection\\DocBlock\\Description' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Description.php', + 'Barryvdh\\Reflection\\DocBlock\\Location' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Location.php', + 'Barryvdh\\Reflection\\DocBlock\\Serializer' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Serializer.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\AuthorTag' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/AuthorTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\CoversTag' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/CoversTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\DeprecatedTag' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/DeprecatedTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\ExampleTag' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/ExampleTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\LinkTag' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/LinkTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\MethodTag' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/MethodTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\ParamTag' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/ParamTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\PropertyReadTag' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/PropertyReadTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\PropertyTag' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/PropertyTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\PropertyWriteTag' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/PropertyWriteTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\ReturnTag' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/ReturnTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\SeeTag' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/SeeTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\SinceTag' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/SinceTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\SourceTag' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/SourceTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\ThrowsTag' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/ThrowsTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\UsesTag' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/UsesTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\VarTag' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/VarTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Tag\\VersionTag' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Tag/VersionTag.php', + 'Barryvdh\\Reflection\\DocBlock\\Type\\Collection' => __DIR__ . '/..' . '/barryvdh/reflection-docblock/src/Barryvdh/Reflection/DocBlock/Type/Collection.php', 'Brick\\Math\\BigDecimal' => __DIR__ . '/..' . '/brick/math/src/BigDecimal.php', 'Brick\\Math\\BigInteger' => __DIR__ . '/..' . '/brick/math/src/BigInteger.php', 'Brick\\Math\\BigNumber' => __DIR__ . '/..' . '/brick/math/src/BigNumber.php', @@ -749,6 +864,17 @@ class ComposerStaticInitb2555e5ff7197b9e020da74bbd3b7cfa 'Collective\\Html\\HtmlFacade' => __DIR__ . '/..' . '/laravelcollective/html/src/HtmlFacade.php', 'Collective\\Html\\HtmlServiceProvider' => __DIR__ . '/..' . '/laravelcollective/html/src/HtmlServiceProvider.php', 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', + 'Composer\\Pcre\\MatchAllResult' => __DIR__ . '/..' . '/composer/pcre/src/MatchAllResult.php', + 'Composer\\Pcre\\MatchAllStrictGroupsResult' => __DIR__ . '/..' . '/composer/pcre/src/MatchAllStrictGroupsResult.php', + 'Composer\\Pcre\\MatchAllWithOffsetsResult' => __DIR__ . '/..' . '/composer/pcre/src/MatchAllWithOffsetsResult.php', + 'Composer\\Pcre\\MatchResult' => __DIR__ . '/..' . '/composer/pcre/src/MatchResult.php', + 'Composer\\Pcre\\MatchStrictGroupsResult' => __DIR__ . '/..' . '/composer/pcre/src/MatchStrictGroupsResult.php', + 'Composer\\Pcre\\MatchWithOffsetsResult' => __DIR__ . '/..' . '/composer/pcre/src/MatchWithOffsetsResult.php', + 'Composer\\Pcre\\PcreException' => __DIR__ . '/..' . '/composer/pcre/src/PcreException.php', + 'Composer\\Pcre\\Preg' => __DIR__ . '/..' . '/composer/pcre/src/Preg.php', + 'Composer\\Pcre\\Regex' => __DIR__ . '/..' . '/composer/pcre/src/Regex.php', + 'Composer\\Pcre\\ReplaceResult' => __DIR__ . '/..' . '/composer/pcre/src/ReplaceResult.php', + 'Composer\\Pcre\\UnexpectedNullMatchException' => __DIR__ . '/..' . '/composer/pcre/src/UnexpectedNullMatchException.php', 'Cron\\AbstractField' => __DIR__ . '/..' . '/dragonmantank/cron-expression/src/Cron/AbstractField.php', 'Cron\\CronExpression' => __DIR__ . '/..' . '/dragonmantank/cron-expression/src/Cron/CronExpression.php', 'Cron\\DayOfMonthField' => __DIR__ . '/..' . '/dragonmantank/cron-expression/src/Cron/DayOfMonthField.php', @@ -759,6 +885,7 @@ class ComposerStaticInitb2555e5ff7197b9e020da74bbd3b7cfa 'Cron\\HoursField' => __DIR__ . '/..' . '/dragonmantank/cron-expression/src/Cron/HoursField.php', 'Cron\\MinutesField' => __DIR__ . '/..' . '/dragonmantank/cron-expression/src/Cron/MinutesField.php', 'Cron\\MonthField' => __DIR__ . '/..' . '/dragonmantank/cron-expression/src/Cron/MonthField.php', + 'Database\\Factories\\ItemFactory' => __DIR__ . '/../..' . '/database/factories/ItemFactory.php', 'Database\\Factories\\UserFactory' => __DIR__ . '/../..' . '/database/factories/UserFactory.php', 'Database\\Seeders\\DatabaseSeeder' => __DIR__ . '/../..' . '/database/seeders/DatabaseSeeder.php', 'Database\\Seeders\\SettingsSeeder' => __DIR__ . '/../..' . '/database/seeders/SettingsSeeder.php', @@ -793,7 +920,333 @@ class ComposerStaticInitb2555e5ff7197b9e020da74bbd3b7cfa 'Dflydev\\DotAccessData\\Exception\\InvalidPathException' => __DIR__ . '/..' . '/dflydev/dot-access-data/src/Exception/InvalidPathException.php', 'Dflydev\\DotAccessData\\Exception\\MissingPathException' => __DIR__ . '/..' . '/dflydev/dot-access-data/src/Exception/MissingPathException.php', 'Dflydev\\DotAccessData\\Util' => __DIR__ . '/..' . '/dflydev/dot-access-data/src/Util.php', + 'Doctrine\\Common\\Cache\\Cache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php', + 'Doctrine\\Common\\Cache\\CacheProvider' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php', + 'Doctrine\\Common\\Cache\\ClearableCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/ClearableCache.php', + 'Doctrine\\Common\\Cache\\FlushableCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/FlushableCache.php', + 'Doctrine\\Common\\Cache\\MultiDeleteCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/MultiDeleteCache.php', + 'Doctrine\\Common\\Cache\\MultiGetCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/MultiGetCache.php', + 'Doctrine\\Common\\Cache\\MultiOperationCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/MultiOperationCache.php', + 'Doctrine\\Common\\Cache\\MultiPutCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/MultiPutCache.php', + 'Doctrine\\Common\\Cache\\Psr6\\CacheAdapter' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheAdapter.php', + 'Doctrine\\Common\\Cache\\Psr6\\CacheItem' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheItem.php', + 'Doctrine\\Common\\Cache\\Psr6\\DoctrineProvider' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/DoctrineProvider.php', + 'Doctrine\\Common\\Cache\\Psr6\\InvalidArgument' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/InvalidArgument.php', + 'Doctrine\\Common\\Cache\\Psr6\\TypedCacheItem' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/TypedCacheItem.php', + 'Doctrine\\Common\\EventArgs' => __DIR__ . '/..' . '/doctrine/event-manager/src/EventArgs.php', + 'Doctrine\\Common\\EventManager' => __DIR__ . '/..' . '/doctrine/event-manager/src/EventManager.php', + 'Doctrine\\Common\\EventSubscriber' => __DIR__ . '/..' . '/doctrine/event-manager/src/EventSubscriber.php', 'Doctrine\\Common\\Lexer\\AbstractLexer' => __DIR__ . '/..' . '/doctrine/lexer/lib/Doctrine/Common/Lexer/AbstractLexer.php', + 'Doctrine\\DBAL\\ArrayParameters\\Exception' => __DIR__ . '/..' . '/doctrine/dbal/src/ArrayParameters/Exception.php', + 'Doctrine\\DBAL\\ArrayParameters\\Exception\\MissingNamedParameter' => __DIR__ . '/..' . '/doctrine/dbal/src/ArrayParameters/Exception/MissingNamedParameter.php', + 'Doctrine\\DBAL\\ArrayParameters\\Exception\\MissingPositionalParameter' => __DIR__ . '/..' . '/doctrine/dbal/src/ArrayParameters/Exception/MissingPositionalParameter.php', + 'Doctrine\\DBAL\\Cache\\ArrayResult' => __DIR__ . '/..' . '/doctrine/dbal/src/Cache/ArrayResult.php', + 'Doctrine\\DBAL\\Cache\\CacheException' => __DIR__ . '/..' . '/doctrine/dbal/src/Cache/CacheException.php', + 'Doctrine\\DBAL\\Cache\\QueryCacheProfile' => __DIR__ . '/..' . '/doctrine/dbal/src/Cache/QueryCacheProfile.php', + 'Doctrine\\DBAL\\ColumnCase' => __DIR__ . '/..' . '/doctrine/dbal/src/ColumnCase.php', + 'Doctrine\\DBAL\\Configuration' => __DIR__ . '/..' . '/doctrine/dbal/src/Configuration.php', + 'Doctrine\\DBAL\\Connection' => __DIR__ . '/..' . '/doctrine/dbal/src/Connection.php', + 'Doctrine\\DBAL\\ConnectionException' => __DIR__ . '/..' . '/doctrine/dbal/src/ConnectionException.php', + 'Doctrine\\DBAL\\Connections\\PrimaryReadReplicaConnection' => __DIR__ . '/..' . '/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php', + 'Doctrine\\DBAL\\Driver' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver.php', + 'Doctrine\\DBAL\\DriverManager' => __DIR__ . '/..' . '/doctrine/dbal/src/DriverManager.php', + 'Doctrine\\DBAL\\Driver\\API\\ExceptionConverter' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/API/ExceptionConverter.php', + 'Doctrine\\DBAL\\Driver\\API\\IBMDB2\\ExceptionConverter' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/API/IBMDB2/ExceptionConverter.php', + 'Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php', + 'Doctrine\\DBAL\\Driver\\API\\OCI\\ExceptionConverter' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/API/OCI/ExceptionConverter.php', + 'Doctrine\\DBAL\\Driver\\API\\PostgreSQL\\ExceptionConverter' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php', + 'Doctrine\\DBAL\\Driver\\API\\SQLSrv\\ExceptionConverter' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/API/SQLSrv/ExceptionConverter.php', + 'Doctrine\\DBAL\\Driver\\API\\SQLite\\ExceptionConverter' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/API/SQLite/ExceptionConverter.php', + 'Doctrine\\DBAL\\Driver\\API\\SQLite\\UserDefinedFunctions' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/API/SQLite/UserDefinedFunctions.php', + 'Doctrine\\DBAL\\Driver\\AbstractDB2Driver' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/AbstractDB2Driver.php', + 'Doctrine\\DBAL\\Driver\\AbstractException' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/AbstractException.php', + 'Doctrine\\DBAL\\Driver\\AbstractMySQLDriver' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/AbstractMySQLDriver.php', + 'Doctrine\\DBAL\\Driver\\AbstractOracleDriver' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/AbstractOracleDriver.php', + 'Doctrine\\DBAL\\Driver\\AbstractOracleDriver\\EasyConnectString' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/AbstractOracleDriver/EasyConnectString.php', + 'Doctrine\\DBAL\\Driver\\AbstractPostgreSQLDriver' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/AbstractPostgreSQLDriver.php', + 'Doctrine\\DBAL\\Driver\\AbstractSQLServerDriver' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/AbstractSQLServerDriver.php', + 'Doctrine\\DBAL\\Driver\\AbstractSQLServerDriver\\Exception\\PortWithoutHost' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/AbstractSQLServerDriver/Exception/PortWithoutHost.php', + 'Doctrine\\DBAL\\Driver\\AbstractSQLiteDriver' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/AbstractSQLiteDriver.php', + 'Doctrine\\DBAL\\Driver\\AbstractSQLiteDriver\\Middleware\\EnableForeignKeys' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/AbstractSQLiteDriver/Middleware/EnableForeignKeys.php', + 'Doctrine\\DBAL\\Driver\\Connection' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Connection.php', + 'Doctrine\\DBAL\\Driver\\Exception' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Exception.php', + 'Doctrine\\DBAL\\Driver\\Exception\\UnknownParameterType' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Exception/UnknownParameterType.php', + 'Doctrine\\DBAL\\Driver\\FetchUtils' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/FetchUtils.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\Connection' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/IBMDB2/Connection.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\DataSourceName' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/IBMDB2/DataSourceName.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\Driver' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/IBMDB2/Driver.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\Exception\\CannotCopyStreamToStream' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/IBMDB2/Exception/CannotCopyStreamToStream.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\Exception\\CannotCreateTemporaryFile' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/IBMDB2/Exception/CannotCreateTemporaryFile.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\Exception\\ConnectionError' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/IBMDB2/Exception/ConnectionError.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\Exception\\ConnectionFailed' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/IBMDB2/Exception/ConnectionFailed.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\Exception\\Factory' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/IBMDB2/Exception/Factory.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\Exception\\PrepareFailed' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/IBMDB2/Exception/PrepareFailed.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\Exception\\StatementError' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/IBMDB2/Exception/StatementError.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\Result' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/IBMDB2/Result.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\Statement' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/IBMDB2/Statement.php', + 'Doctrine\\DBAL\\Driver\\Middleware' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Middleware.php', + 'Doctrine\\DBAL\\Driver\\Middleware\\AbstractConnectionMiddleware' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Middleware/AbstractConnectionMiddleware.php', + 'Doctrine\\DBAL\\Driver\\Middleware\\AbstractDriverMiddleware' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Middleware/AbstractDriverMiddleware.php', + 'Doctrine\\DBAL\\Driver\\Middleware\\AbstractResultMiddleware' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Middleware/AbstractResultMiddleware.php', + 'Doctrine\\DBAL\\Driver\\Middleware\\AbstractStatementMiddleware' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Middleware/AbstractStatementMiddleware.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Connection' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Mysqli/Connection.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Driver' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Mysqli/Driver.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Exception\\ConnectionError' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionError.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Exception\\ConnectionFailed' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionFailed.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Exception\\FailedReadingStreamOffset' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Mysqli/Exception/FailedReadingStreamOffset.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Exception\\HostRequired' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Mysqli/Exception/HostRequired.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Exception\\InvalidCharset' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Mysqli/Exception/InvalidCharset.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Exception\\InvalidOption' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Mysqli/Exception/InvalidOption.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Exception\\NonStreamResourceUsedAsLargeObject' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Mysqli/Exception/NonStreamResourceUsedAsLargeObject.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Exception\\StatementError' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Mysqli/Exception/StatementError.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Initializer' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Mysqli/Initializer.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Initializer\\Charset' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Mysqli/Initializer/Charset.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Initializer\\Options' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Mysqli/Initializer/Options.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Initializer\\Secure' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Mysqli/Initializer/Secure.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Result' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Mysqli/Result.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Statement' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Mysqli/Statement.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\Connection' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/OCI8/Connection.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\ConvertPositionalToNamedPlaceholders' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/OCI8/ConvertPositionalToNamedPlaceholders.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\Driver' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/OCI8/Driver.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\Exception\\ConnectionFailed' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/OCI8/Exception/ConnectionFailed.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\Exception\\Error' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/OCI8/Exception/Error.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\Exception\\NonTerminatedStringLiteral' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/OCI8/Exception/NonTerminatedStringLiteral.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\Exception\\SequenceDoesNotExist' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/OCI8/Exception/SequenceDoesNotExist.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\Exception\\UnknownParameterIndex' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/OCI8/Exception/UnknownParameterIndex.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\ExecutionMode' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/OCI8/ExecutionMode.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\Middleware\\InitializeSession' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/OCI8/Middleware/InitializeSession.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\Result' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/OCI8/Result.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\Statement' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/OCI8/Statement.php', + 'Doctrine\\DBAL\\Driver\\PDO\\Connection' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/PDO/Connection.php', + 'Doctrine\\DBAL\\Driver\\PDO\\Exception' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/PDO/Exception.php', + 'Doctrine\\DBAL\\Driver\\PDO\\MySQL\\Driver' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php', + 'Doctrine\\DBAL\\Driver\\PDO\\OCI\\Driver' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/PDO/OCI/Driver.php', + 'Doctrine\\DBAL\\Driver\\PDO\\PgSQL\\Driver' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/PDO/PgSQL/Driver.php', + 'Doctrine\\DBAL\\Driver\\PDO\\Result' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/PDO/Result.php', + 'Doctrine\\DBAL\\Driver\\PDO\\SQLSrv\\Connection' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/PDO/SQLSrv/Connection.php', + 'Doctrine\\DBAL\\Driver\\PDO\\SQLSrv\\Driver' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/PDO/SQLSrv/Driver.php', + 'Doctrine\\DBAL\\Driver\\PDO\\SQLSrv\\Statement' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/PDO/SQLSrv/Statement.php', + 'Doctrine\\DBAL\\Driver\\PDO\\SQLite\\Driver' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/PDO/SQLite/Driver.php', + 'Doctrine\\DBAL\\Driver\\PDO\\Statement' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/PDO/Statement.php', + 'Doctrine\\DBAL\\Driver\\Result' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Result.php', + 'Doctrine\\DBAL\\Driver\\SQLSrv\\Connection' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/SQLSrv/Connection.php', + 'Doctrine\\DBAL\\Driver\\SQLSrv\\Driver' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/SQLSrv/Driver.php', + 'Doctrine\\DBAL\\Driver\\SQLSrv\\Exception\\Error' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/SQLSrv/Exception/Error.php', + 'Doctrine\\DBAL\\Driver\\SQLSrv\\Result' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/SQLSrv/Result.php', + 'Doctrine\\DBAL\\Driver\\SQLSrv\\Statement' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/SQLSrv/Statement.php', + 'Doctrine\\DBAL\\Driver\\SQLite3\\Connection' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/SQLite3/Connection.php', + 'Doctrine\\DBAL\\Driver\\SQLite3\\Driver' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/SQLite3/Driver.php', + 'Doctrine\\DBAL\\Driver\\SQLite3\\Exception' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/SQLite3/Exception.php', + 'Doctrine\\DBAL\\Driver\\SQLite3\\Result' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/SQLite3/Result.php', + 'Doctrine\\DBAL\\Driver\\SQLite3\\Statement' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/SQLite3/Statement.php', + 'Doctrine\\DBAL\\Driver\\ServerInfoAwareConnection' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/ServerInfoAwareConnection.php', + 'Doctrine\\DBAL\\Driver\\Statement' => __DIR__ . '/..' . '/doctrine/dbal/src/Driver/Statement.php', + 'Doctrine\\DBAL\\Event\\ConnectionEventArgs' => __DIR__ . '/..' . '/doctrine/dbal/src/Event/ConnectionEventArgs.php', + 'Doctrine\\DBAL\\Event\\Listeners\\OracleSessionInit' => __DIR__ . '/..' . '/doctrine/dbal/src/Event/Listeners/OracleSessionInit.php', + 'Doctrine\\DBAL\\Event\\Listeners\\SQLSessionInit' => __DIR__ . '/..' . '/doctrine/dbal/src/Event/Listeners/SQLSessionInit.php', + 'Doctrine\\DBAL\\Event\\Listeners\\SQLiteSessionInit' => __DIR__ . '/..' . '/doctrine/dbal/src/Event/Listeners/SQLiteSessionInit.php', + 'Doctrine\\DBAL\\Event\\SchemaAlterTableAddColumnEventArgs' => __DIR__ . '/..' . '/doctrine/dbal/src/Event/SchemaAlterTableAddColumnEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaAlterTableChangeColumnEventArgs' => __DIR__ . '/..' . '/doctrine/dbal/src/Event/SchemaAlterTableChangeColumnEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaAlterTableEventArgs' => __DIR__ . '/..' . '/doctrine/dbal/src/Event/SchemaAlterTableEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaAlterTableRemoveColumnEventArgs' => __DIR__ . '/..' . '/doctrine/dbal/src/Event/SchemaAlterTableRemoveColumnEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaAlterTableRenameColumnEventArgs' => __DIR__ . '/..' . '/doctrine/dbal/src/Event/SchemaAlterTableRenameColumnEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaColumnDefinitionEventArgs' => __DIR__ . '/..' . '/doctrine/dbal/src/Event/SchemaColumnDefinitionEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaCreateTableColumnEventArgs' => __DIR__ . '/..' . '/doctrine/dbal/src/Event/SchemaCreateTableColumnEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaCreateTableEventArgs' => __DIR__ . '/..' . '/doctrine/dbal/src/Event/SchemaCreateTableEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaDropTableEventArgs' => __DIR__ . '/..' . '/doctrine/dbal/src/Event/SchemaDropTableEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaEventArgs' => __DIR__ . '/..' . '/doctrine/dbal/src/Event/SchemaEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaIndexDefinitionEventArgs' => __DIR__ . '/..' . '/doctrine/dbal/src/Event/SchemaIndexDefinitionEventArgs.php', + 'Doctrine\\DBAL\\Event\\TransactionBeginEventArgs' => __DIR__ . '/..' . '/doctrine/dbal/src/Event/TransactionBeginEventArgs.php', + 'Doctrine\\DBAL\\Event\\TransactionCommitEventArgs' => __DIR__ . '/..' . '/doctrine/dbal/src/Event/TransactionCommitEventArgs.php', + 'Doctrine\\DBAL\\Event\\TransactionEventArgs' => __DIR__ . '/..' . '/doctrine/dbal/src/Event/TransactionEventArgs.php', + 'Doctrine\\DBAL\\Event\\TransactionRollBackEventArgs' => __DIR__ . '/..' . '/doctrine/dbal/src/Event/TransactionRollBackEventArgs.php', + 'Doctrine\\DBAL\\Events' => __DIR__ . '/..' . '/doctrine/dbal/src/Events.php', + 'Doctrine\\DBAL\\Exception' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception.php', + 'Doctrine\\DBAL\\Exception\\ConnectionException' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/ConnectionException.php', + 'Doctrine\\DBAL\\Exception\\ConnectionLost' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/ConnectionLost.php', + 'Doctrine\\DBAL\\Exception\\ConstraintViolationException' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/ConstraintViolationException.php', + 'Doctrine\\DBAL\\Exception\\DatabaseDoesNotExist' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/DatabaseDoesNotExist.php', + 'Doctrine\\DBAL\\Exception\\DatabaseObjectExistsException' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/DatabaseObjectExistsException.php', + 'Doctrine\\DBAL\\Exception\\DatabaseObjectNotFoundException' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/DatabaseObjectNotFoundException.php', + 'Doctrine\\DBAL\\Exception\\DatabaseRequired' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/DatabaseRequired.php', + 'Doctrine\\DBAL\\Exception\\DeadlockException' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/DeadlockException.php', + 'Doctrine\\DBAL\\Exception\\DriverException' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/DriverException.php', + 'Doctrine\\DBAL\\Exception\\ForeignKeyConstraintViolationException' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/ForeignKeyConstraintViolationException.php', + 'Doctrine\\DBAL\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/InvalidArgumentException.php', + 'Doctrine\\DBAL\\Exception\\InvalidFieldNameException' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/InvalidFieldNameException.php', + 'Doctrine\\DBAL\\Exception\\InvalidLockMode' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/InvalidLockMode.php', + 'Doctrine\\DBAL\\Exception\\LockWaitTimeoutException' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/LockWaitTimeoutException.php', + 'Doctrine\\DBAL\\Exception\\NoKeyValue' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/NoKeyValue.php', + 'Doctrine\\DBAL\\Exception\\NonUniqueFieldNameException' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/NonUniqueFieldNameException.php', + 'Doctrine\\DBAL\\Exception\\NotNullConstraintViolationException' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/NotNullConstraintViolationException.php', + 'Doctrine\\DBAL\\Exception\\ReadOnlyException' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/ReadOnlyException.php', + 'Doctrine\\DBAL\\Exception\\RetryableException' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/RetryableException.php', + 'Doctrine\\DBAL\\Exception\\SchemaDoesNotExist' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/SchemaDoesNotExist.php', + 'Doctrine\\DBAL\\Exception\\ServerException' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/ServerException.php', + 'Doctrine\\DBAL\\Exception\\SyntaxErrorException' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/SyntaxErrorException.php', + 'Doctrine\\DBAL\\Exception\\TableExistsException' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/TableExistsException.php', + 'Doctrine\\DBAL\\Exception\\TableNotFoundException' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/TableNotFoundException.php', + 'Doctrine\\DBAL\\Exception\\UniqueConstraintViolationException' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/UniqueConstraintViolationException.php', + 'Doctrine\\DBAL\\ExpandArrayParameters' => __DIR__ . '/..' . '/doctrine/dbal/src/ExpandArrayParameters.php', + 'Doctrine\\DBAL\\FetchMode' => __DIR__ . '/..' . '/doctrine/dbal/src/FetchMode.php', + 'Doctrine\\DBAL\\Id\\TableGenerator' => __DIR__ . '/..' . '/doctrine/dbal/src/Id/TableGenerator.php', + 'Doctrine\\DBAL\\Id\\TableGeneratorSchemaVisitor' => __DIR__ . '/..' . '/doctrine/dbal/src/Id/TableGeneratorSchemaVisitor.php', + 'Doctrine\\DBAL\\LockMode' => __DIR__ . '/..' . '/doctrine/dbal/src/LockMode.php', + 'Doctrine\\DBAL\\Logging\\Connection' => __DIR__ . '/..' . '/doctrine/dbal/src/Logging/Connection.php', + 'Doctrine\\DBAL\\Logging\\DebugStack' => __DIR__ . '/..' . '/doctrine/dbal/src/Logging/DebugStack.php', + 'Doctrine\\DBAL\\Logging\\Driver' => __DIR__ . '/..' . '/doctrine/dbal/src/Logging/Driver.php', + 'Doctrine\\DBAL\\Logging\\LoggerChain' => __DIR__ . '/..' . '/doctrine/dbal/src/Logging/LoggerChain.php', + 'Doctrine\\DBAL\\Logging\\Middleware' => __DIR__ . '/..' . '/doctrine/dbal/src/Logging/Middleware.php', + 'Doctrine\\DBAL\\Logging\\SQLLogger' => __DIR__ . '/..' . '/doctrine/dbal/src/Logging/SQLLogger.php', + 'Doctrine\\DBAL\\Logging\\Statement' => __DIR__ . '/..' . '/doctrine/dbal/src/Logging/Statement.php', + 'Doctrine\\DBAL\\ParameterType' => __DIR__ . '/..' . '/doctrine/dbal/src/ParameterType.php', + 'Doctrine\\DBAL\\Platforms\\AbstractMySQLPlatform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/AbstractMySQLPlatform.php', + 'Doctrine\\DBAL\\Platforms\\AbstractPlatform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/AbstractPlatform.php', + 'Doctrine\\DBAL\\Platforms\\DB2Platform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/DB2Platform.php', + 'Doctrine\\DBAL\\Platforms\\DateIntervalUnit' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/DateIntervalUnit.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\DB2Keywords' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Keywords/DB2Keywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\KeywordList' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Keywords/KeywordList.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\MariaDBKeywords' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Keywords/MariaDBKeywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\MariaDb102Keywords' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Keywords/MariaDb102Keywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\MySQL57Keywords' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Keywords/MySQL57Keywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\MySQL80Keywords' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Keywords/MySQL80Keywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\MySQLKeywords' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Keywords/MySQLKeywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\OracleKeywords' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Keywords/OracleKeywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\PostgreSQL100Keywords' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Keywords/PostgreSQL100Keywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\PostgreSQL94Keywords' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Keywords/PostgreSQL94Keywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\PostgreSQLKeywords' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Keywords/PostgreSQLKeywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\ReservedKeywordsValidator' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Keywords/ReservedKeywordsValidator.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\SQLServer2012Keywords' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Keywords/SQLServer2012Keywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\SQLServerKeywords' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Keywords/SQLServerKeywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\SQLiteKeywords' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Keywords/SQLiteKeywords.php', + 'Doctrine\\DBAL\\Platforms\\MariaDBPlatform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/MariaDBPlatform.php', + 'Doctrine\\DBAL\\Platforms\\MariaDb1027Platform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/MariaDb1027Platform.php', + 'Doctrine\\DBAL\\Platforms\\MySQL57Platform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/MySQL57Platform.php', + 'Doctrine\\DBAL\\Platforms\\MySQL80Platform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/MySQL80Platform.php', + 'Doctrine\\DBAL\\Platforms\\MySQLPlatform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/MySQLPlatform.php', + 'Doctrine\\DBAL\\Platforms\\MySQL\\CollationMetadataProvider' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/MySQL/CollationMetadataProvider.php', + 'Doctrine\\DBAL\\Platforms\\MySQL\\CollationMetadataProvider\\CachingCollationMetadataProvider' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/MySQL/CollationMetadataProvider/CachingCollationMetadataProvider.php', + 'Doctrine\\DBAL\\Platforms\\MySQL\\CollationMetadataProvider\\ConnectionCollationMetadataProvider' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/MySQL/CollationMetadataProvider/ConnectionCollationMetadataProvider.php', + 'Doctrine\\DBAL\\Platforms\\MySQL\\Comparator' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/MySQL/Comparator.php', + 'Doctrine\\DBAL\\Platforms\\OraclePlatform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/OraclePlatform.php', + 'Doctrine\\DBAL\\Platforms\\PostgreSQL100Platform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/PostgreSQL100Platform.php', + 'Doctrine\\DBAL\\Platforms\\PostgreSQL94Platform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/PostgreSQL94Platform.php', + 'Doctrine\\DBAL\\Platforms\\PostgreSQLPlatform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/PostgreSQLPlatform.php', + 'Doctrine\\DBAL\\Platforms\\SQLServer2012Platform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/SQLServer2012Platform.php', + 'Doctrine\\DBAL\\Platforms\\SQLServerPlatform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/SQLServerPlatform.php', + 'Doctrine\\DBAL\\Platforms\\SQLServer\\Comparator' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/SQLServer/Comparator.php', + 'Doctrine\\DBAL\\Platforms\\SQLite\\Comparator' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/SQLite/Comparator.php', + 'Doctrine\\DBAL\\Platforms\\SqlitePlatform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/SqlitePlatform.php', + 'Doctrine\\DBAL\\Platforms\\TrimMode' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/TrimMode.php', + 'Doctrine\\DBAL\\Portability\\Connection' => __DIR__ . '/..' . '/doctrine/dbal/src/Portability/Connection.php', + 'Doctrine\\DBAL\\Portability\\Converter' => __DIR__ . '/..' . '/doctrine/dbal/src/Portability/Converter.php', + 'Doctrine\\DBAL\\Portability\\Driver' => __DIR__ . '/..' . '/doctrine/dbal/src/Portability/Driver.php', + 'Doctrine\\DBAL\\Portability\\Middleware' => __DIR__ . '/..' . '/doctrine/dbal/src/Portability/Middleware.php', + 'Doctrine\\DBAL\\Portability\\OptimizeFlags' => __DIR__ . '/..' . '/doctrine/dbal/src/Portability/OptimizeFlags.php', + 'Doctrine\\DBAL\\Portability\\Result' => __DIR__ . '/..' . '/doctrine/dbal/src/Portability/Result.php', + 'Doctrine\\DBAL\\Portability\\Statement' => __DIR__ . '/..' . '/doctrine/dbal/src/Portability/Statement.php', + 'Doctrine\\DBAL\\Query' => __DIR__ . '/..' . '/doctrine/dbal/src/Query.php', + 'Doctrine\\DBAL\\Query\\Expression\\CompositeExpression' => __DIR__ . '/..' . '/doctrine/dbal/src/Query/Expression/CompositeExpression.php', + 'Doctrine\\DBAL\\Query\\Expression\\ExpressionBuilder' => __DIR__ . '/..' . '/doctrine/dbal/src/Query/Expression/ExpressionBuilder.php', + 'Doctrine\\DBAL\\Query\\QueryBuilder' => __DIR__ . '/..' . '/doctrine/dbal/src/Query/QueryBuilder.php', + 'Doctrine\\DBAL\\Query\\QueryException' => __DIR__ . '/..' . '/doctrine/dbal/src/Query/QueryException.php', + 'Doctrine\\DBAL\\Result' => __DIR__ . '/..' . '/doctrine/dbal/src/Result.php', + 'Doctrine\\DBAL\\SQL\\Builder\\CreateSchemaObjectsSQLBuilder' => __DIR__ . '/..' . '/doctrine/dbal/src/SQL/Builder/CreateSchemaObjectsSQLBuilder.php', + 'Doctrine\\DBAL\\SQL\\Builder\\DropSchemaObjectsSQLBuilder' => __DIR__ . '/..' . '/doctrine/dbal/src/SQL/Builder/DropSchemaObjectsSQLBuilder.php', + 'Doctrine\\DBAL\\SQL\\Parser' => __DIR__ . '/..' . '/doctrine/dbal/src/SQL/Parser.php', + 'Doctrine\\DBAL\\SQL\\Parser\\Exception' => __DIR__ . '/..' . '/doctrine/dbal/src/SQL/Parser/Exception.php', + 'Doctrine\\DBAL\\SQL\\Parser\\Exception\\RegularExpressionError' => __DIR__ . '/..' . '/doctrine/dbal/src/SQL/Parser/Exception/RegularExpressionError.php', + 'Doctrine\\DBAL\\SQL\\Parser\\Visitor' => __DIR__ . '/..' . '/doctrine/dbal/src/SQL/Parser/Visitor.php', + 'Doctrine\\DBAL\\Schema\\AbstractAsset' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/AbstractAsset.php', + 'Doctrine\\DBAL\\Schema\\AbstractSchemaManager' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/AbstractSchemaManager.php', + 'Doctrine\\DBAL\\Schema\\Column' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Column.php', + 'Doctrine\\DBAL\\Schema\\ColumnDiff' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/ColumnDiff.php', + 'Doctrine\\DBAL\\Schema\\Comparator' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Comparator.php', + 'Doctrine\\DBAL\\Schema\\Constraint' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Constraint.php', + 'Doctrine\\DBAL\\Schema\\DB2SchemaManager' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/DB2SchemaManager.php', + 'Doctrine\\DBAL\\Schema\\Exception\\ColumnAlreadyExists' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/ColumnAlreadyExists.php', + 'Doctrine\\DBAL\\Schema\\Exception\\ColumnDoesNotExist' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/ColumnDoesNotExist.php', + 'Doctrine\\DBAL\\Schema\\Exception\\ForeignKeyDoesNotExist' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/ForeignKeyDoesNotExist.php', + 'Doctrine\\DBAL\\Schema\\Exception\\IndexAlreadyExists' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/IndexAlreadyExists.php', + 'Doctrine\\DBAL\\Schema\\Exception\\IndexDoesNotExist' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/IndexDoesNotExist.php', + 'Doctrine\\DBAL\\Schema\\Exception\\IndexNameInvalid' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/IndexNameInvalid.php', + 'Doctrine\\DBAL\\Schema\\Exception\\InvalidTableName' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/InvalidTableName.php', + 'Doctrine\\DBAL\\Schema\\Exception\\NamedForeignKeyRequired' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/NamedForeignKeyRequired.php', + 'Doctrine\\DBAL\\Schema\\Exception\\NamespaceAlreadyExists' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/NamespaceAlreadyExists.php', + 'Doctrine\\DBAL\\Schema\\Exception\\SequenceAlreadyExists' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/SequenceAlreadyExists.php', + 'Doctrine\\DBAL\\Schema\\Exception\\SequenceDoesNotExist' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/SequenceDoesNotExist.php', + 'Doctrine\\DBAL\\Schema\\Exception\\TableAlreadyExists' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/TableAlreadyExists.php', + 'Doctrine\\DBAL\\Schema\\Exception\\TableDoesNotExist' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/TableDoesNotExist.php', + 'Doctrine\\DBAL\\Schema\\Exception\\UniqueConstraintDoesNotExist' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/UniqueConstraintDoesNotExist.php', + 'Doctrine\\DBAL\\Schema\\Exception\\UnknownColumnOption' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/UnknownColumnOption.php', + 'Doctrine\\DBAL\\Schema\\ForeignKeyConstraint' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/ForeignKeyConstraint.php', + 'Doctrine\\DBAL\\Schema\\Identifier' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Identifier.php', + 'Doctrine\\DBAL\\Schema\\Index' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Index.php', + 'Doctrine\\DBAL\\Schema\\MySQLSchemaManager' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/MySQLSchemaManager.php', + 'Doctrine\\DBAL\\Schema\\OracleSchemaManager' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/OracleSchemaManager.php', + 'Doctrine\\DBAL\\Schema\\PostgreSQLSchemaManager' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/PostgreSQLSchemaManager.php', + 'Doctrine\\DBAL\\Schema\\SQLServerSchemaManager' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/SQLServerSchemaManager.php', + 'Doctrine\\DBAL\\Schema\\Schema' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Schema.php', + 'Doctrine\\DBAL\\Schema\\SchemaConfig' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/SchemaConfig.php', + 'Doctrine\\DBAL\\Schema\\SchemaDiff' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/SchemaDiff.php', + 'Doctrine\\DBAL\\Schema\\SchemaException' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/SchemaException.php', + 'Doctrine\\DBAL\\Schema\\Sequence' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Sequence.php', + 'Doctrine\\DBAL\\Schema\\SqliteSchemaManager' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/SqliteSchemaManager.php', + 'Doctrine\\DBAL\\Schema\\Table' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Table.php', + 'Doctrine\\DBAL\\Schema\\TableDiff' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/TableDiff.php', + 'Doctrine\\DBAL\\Schema\\UniqueConstraint' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/UniqueConstraint.php', + 'Doctrine\\DBAL\\Schema\\View' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/View.php', + 'Doctrine\\DBAL\\Schema\\Visitor\\AbstractVisitor' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Visitor/AbstractVisitor.php', + 'Doctrine\\DBAL\\Schema\\Visitor\\CreateSchemaSqlCollector' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Visitor/CreateSchemaSqlCollector.php', + 'Doctrine\\DBAL\\Schema\\Visitor\\DropSchemaSqlCollector' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Visitor/DropSchemaSqlCollector.php', + 'Doctrine\\DBAL\\Schema\\Visitor\\Graphviz' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Visitor/Graphviz.php', + 'Doctrine\\DBAL\\Schema\\Visitor\\NamespaceVisitor' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Visitor/NamespaceVisitor.php', + 'Doctrine\\DBAL\\Schema\\Visitor\\RemoveNamespacedAssets' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Visitor/RemoveNamespacedAssets.php', + 'Doctrine\\DBAL\\Schema\\Visitor\\Visitor' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Visitor/Visitor.php', + 'Doctrine\\DBAL\\Statement' => __DIR__ . '/..' . '/doctrine/dbal/src/Statement.php', + 'Doctrine\\DBAL\\Tools\\Console\\Command\\ReservedWordsCommand' => __DIR__ . '/..' . '/doctrine/dbal/src/Tools/Console/Command/ReservedWordsCommand.php', + 'Doctrine\\DBAL\\Tools\\Console\\Command\\RunSqlCommand' => __DIR__ . '/..' . '/doctrine/dbal/src/Tools/Console/Command/RunSqlCommand.php', + 'Doctrine\\DBAL\\Tools\\Console\\ConnectionNotFound' => __DIR__ . '/..' . '/doctrine/dbal/src/Tools/Console/ConnectionNotFound.php', + 'Doctrine\\DBAL\\Tools\\Console\\ConnectionProvider' => __DIR__ . '/..' . '/doctrine/dbal/src/Tools/Console/ConnectionProvider.php', + 'Doctrine\\DBAL\\Tools\\Console\\ConnectionProvider\\SingleConnectionProvider' => __DIR__ . '/..' . '/doctrine/dbal/src/Tools/Console/ConnectionProvider/SingleConnectionProvider.php', + 'Doctrine\\DBAL\\Tools\\Console\\ConsoleRunner' => __DIR__ . '/..' . '/doctrine/dbal/src/Tools/Console/ConsoleRunner.php', + 'Doctrine\\DBAL\\TransactionIsolationLevel' => __DIR__ . '/..' . '/doctrine/dbal/src/TransactionIsolationLevel.php', + 'Doctrine\\DBAL\\Types\\ArrayType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/ArrayType.php', + 'Doctrine\\DBAL\\Types\\AsciiStringType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/AsciiStringType.php', + 'Doctrine\\DBAL\\Types\\BigIntType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/BigIntType.php', + 'Doctrine\\DBAL\\Types\\BinaryType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/BinaryType.php', + 'Doctrine\\DBAL\\Types\\BlobType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/BlobType.php', + 'Doctrine\\DBAL\\Types\\BooleanType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/BooleanType.php', + 'Doctrine\\DBAL\\Types\\ConversionException' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/ConversionException.php', + 'Doctrine\\DBAL\\Types\\DateImmutableType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/DateImmutableType.php', + 'Doctrine\\DBAL\\Types\\DateIntervalType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/DateIntervalType.php', + 'Doctrine\\DBAL\\Types\\DateTimeImmutableType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/DateTimeImmutableType.php', + 'Doctrine\\DBAL\\Types\\DateTimeType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/DateTimeType.php', + 'Doctrine\\DBAL\\Types\\DateTimeTzImmutableType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/DateTimeTzImmutableType.php', + 'Doctrine\\DBAL\\Types\\DateTimeTzType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/DateTimeTzType.php', + 'Doctrine\\DBAL\\Types\\DateType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/DateType.php', + 'Doctrine\\DBAL\\Types\\DecimalType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/DecimalType.php', + 'Doctrine\\DBAL\\Types\\FloatType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/FloatType.php', + 'Doctrine\\DBAL\\Types\\GuidType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/GuidType.php', + 'Doctrine\\DBAL\\Types\\IntegerType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/IntegerType.php', + 'Doctrine\\DBAL\\Types\\JsonType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/JsonType.php', + 'Doctrine\\DBAL\\Types\\ObjectType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/ObjectType.php', + 'Doctrine\\DBAL\\Types\\PhpDateTimeMappingType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/PhpDateTimeMappingType.php', + 'Doctrine\\DBAL\\Types\\PhpIntegerMappingType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/PhpIntegerMappingType.php', + 'Doctrine\\DBAL\\Types\\SimpleArrayType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/SimpleArrayType.php', + 'Doctrine\\DBAL\\Types\\SmallIntType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/SmallIntType.php', + 'Doctrine\\DBAL\\Types\\StringType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/StringType.php', + 'Doctrine\\DBAL\\Types\\TextType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/TextType.php', + 'Doctrine\\DBAL\\Types\\TimeImmutableType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/TimeImmutableType.php', + 'Doctrine\\DBAL\\Types\\TimeType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/TimeType.php', + 'Doctrine\\DBAL\\Types\\Type' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/Type.php', + 'Doctrine\\DBAL\\Types\\TypeRegistry' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/TypeRegistry.php', + 'Doctrine\\DBAL\\Types\\Types' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/Types.php', + 'Doctrine\\DBAL\\Types\\VarDateTimeImmutableType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/VarDateTimeImmutableType.php', + 'Doctrine\\DBAL\\Types\\VarDateTimeType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/VarDateTimeType.php', + 'Doctrine\\DBAL\\VersionAwarePlatformDriver' => __DIR__ . '/..' . '/doctrine/dbal/src/VersionAwarePlatformDriver.php', + 'Doctrine\\Deprecations\\Deprecation' => __DIR__ . '/..' . '/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php', + 'Doctrine\\Deprecations\\PHPUnit\\VerifyDeprecations' => __DIR__ . '/..' . '/doctrine/deprecations/lib/Doctrine/Deprecations/PHPUnit/VerifyDeprecations.php', 'Doctrine\\Inflector\\CachedWordInflector' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php', 'Doctrine\\Inflector\\GenericLanguageInflectorFactory' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php', 'Doctrine\\Inflector\\Inflector' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php', @@ -5852,6 +6305,7 @@ class ComposerStaticInitb2555e5ff7197b9e020da74bbd3b7cfa 'Symfony\\Thanks\\Thanks' => __DIR__ . '/..' . '/symfony/thanks/src/Thanks.php', 'Tests\\CreatesApplication' => __DIR__ . '/../..' . '/tests/CreatesApplication.php', 'Tests\\Feature\\ExampleTest' => __DIR__ . '/../..' . '/tests/Feature/ExampleTest.php', + 'Tests\\Feature\\ItemExportTest' => __DIR__ . '/../..' . '/tests/Feature/ItemExportTest.php', 'Tests\\TestCase' => __DIR__ . '/../..' . '/tests/TestCase.php', 'Tests\\Unit\\database\\seeders\\SettingsSeederTest' => __DIR__ . '/../..' . '/tests/Unit/database/seeders/SettingsSeederTest.php', 'Tests\\Unit\\lang\\LangTest' => __DIR__ . '/../..' . '/tests/Unit/lang/LangTest.php', @@ -5892,6 +6346,61 @@ class ComposerStaticInitb2555e5ff7197b9e020da74bbd3b7cfa 'Whoops\\Util\\Misc' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Util/Misc.php', 'Whoops\\Util\\SystemFacade' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Util/SystemFacade.php', 'Whoops\\Util\\TemplateHelper' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Util/TemplateHelper.php', + 'phpDocumentor\\Reflection\\Element' => __DIR__ . '/..' . '/phpdocumentor/reflection-common/src/Element.php', + 'phpDocumentor\\Reflection\\File' => __DIR__ . '/..' . '/phpdocumentor/reflection-common/src/File.php', + 'phpDocumentor\\Reflection\\Fqsen' => __DIR__ . '/..' . '/phpdocumentor/reflection-common/src/Fqsen.php', + 'phpDocumentor\\Reflection\\FqsenResolver' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/FqsenResolver.php', + 'phpDocumentor\\Reflection\\Location' => __DIR__ . '/..' . '/phpdocumentor/reflection-common/src/Location.php', + 'phpDocumentor\\Reflection\\Project' => __DIR__ . '/..' . '/phpdocumentor/reflection-common/src/Project.php', + 'phpDocumentor\\Reflection\\ProjectFactory' => __DIR__ . '/..' . '/phpdocumentor/reflection-common/src/ProjectFactory.php', + 'phpDocumentor\\Reflection\\PseudoType' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/PseudoType.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\CallableString' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/PseudoTypes/CallableString.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\False_' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/PseudoTypes/False_.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\HtmlEscapedString' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/PseudoTypes/HtmlEscapedString.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\IntegerRange' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/PseudoTypes/IntegerRange.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\List_' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/PseudoTypes/List_.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\LiteralString' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/PseudoTypes/LiteralString.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\LowercaseString' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/PseudoTypes/LowercaseString.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\NegativeInteger' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/PseudoTypes/NegativeInteger.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\NonEmptyLowercaseString' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/PseudoTypes/NonEmptyLowercaseString.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\NonEmptyString' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/PseudoTypes/NonEmptyString.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\NumericString' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/PseudoTypes/NumericString.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\Numeric_' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/PseudoTypes/Numeric_.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\PositiveInteger' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/PseudoTypes/PositiveInteger.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\TraitString' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/PseudoTypes/TraitString.php', + 'phpDocumentor\\Reflection\\PseudoTypes\\True_' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/PseudoTypes/True_.php', + 'phpDocumentor\\Reflection\\Type' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Type.php', + 'phpDocumentor\\Reflection\\TypeResolver' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/TypeResolver.php', + 'phpDocumentor\\Reflection\\Types\\AbstractList' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/AbstractList.php', + 'phpDocumentor\\Reflection\\Types\\AggregatedType' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/AggregatedType.php', + 'phpDocumentor\\Reflection\\Types\\ArrayKey' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/ArrayKey.php', + 'phpDocumentor\\Reflection\\Types\\Array_' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/Array_.php', + 'phpDocumentor\\Reflection\\Types\\Boolean' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/Boolean.php', + 'phpDocumentor\\Reflection\\Types\\Callable_' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/Callable_.php', + 'phpDocumentor\\Reflection\\Types\\ClassString' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/ClassString.php', + 'phpDocumentor\\Reflection\\Types\\Collection' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/Collection.php', + 'phpDocumentor\\Reflection\\Types\\Compound' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/Compound.php', + 'phpDocumentor\\Reflection\\Types\\Context' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/Context.php', + 'phpDocumentor\\Reflection\\Types\\ContextFactory' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/ContextFactory.php', + 'phpDocumentor\\Reflection\\Types\\Expression' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/Expression.php', + 'phpDocumentor\\Reflection\\Types\\Float_' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/Float_.php', + 'phpDocumentor\\Reflection\\Types\\Integer' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/Integer.php', + 'phpDocumentor\\Reflection\\Types\\InterfaceString' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/InterfaceString.php', + 'phpDocumentor\\Reflection\\Types\\Intersection' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/Intersection.php', + 'phpDocumentor\\Reflection\\Types\\Iterable_' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/Iterable_.php', + 'phpDocumentor\\Reflection\\Types\\Mixed_' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/Mixed_.php', + 'phpDocumentor\\Reflection\\Types\\Never_' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/Never_.php', + 'phpDocumentor\\Reflection\\Types\\Null_' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/Null_.php', + 'phpDocumentor\\Reflection\\Types\\Nullable' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/Nullable.php', + 'phpDocumentor\\Reflection\\Types\\Object_' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/Object_.php', + 'phpDocumentor\\Reflection\\Types\\Parent_' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/Parent_.php', + 'phpDocumentor\\Reflection\\Types\\Resource_' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/Resource_.php', + 'phpDocumentor\\Reflection\\Types\\Scalar' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/Scalar.php', + 'phpDocumentor\\Reflection\\Types\\Self_' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/Self_.php', + 'phpDocumentor\\Reflection\\Types\\Static_' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/Static_.php', + 'phpDocumentor\\Reflection\\Types\\String_' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/String_.php', + 'phpDocumentor\\Reflection\\Types\\This' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/This.php', + 'phpDocumentor\\Reflection\\Types\\Void_' => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src/Types/Void_.php', 'voku\\helper\\ASCII' => __DIR__ . '/..' . '/voku/portable-ascii/src/voku/helper/ASCII.php', ); diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 863b461f..fd2f134e 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1,5 +1,157 @@ { "packages": [ + { + "name": "barryvdh/laravel-ide-helper", + "version": "v2.12.3", + "version_normalized": "2.12.3.0", + "source": { + "type": "git", + "url": "https://github.com/barryvdh/laravel-ide-helper.git", + "reference": "3ba1e2573b38f72107b8aacc4ee177fcab30a550" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/3ba1e2573b38f72107b8aacc4ee177fcab30a550", + "reference": "3ba1e2573b38f72107b8aacc4ee177fcab30a550", + "shasum": "" + }, + "require": { + "barryvdh/reflection-docblock": "^2.0.6", + "composer/pcre": "^1 || ^2 || ^3", + "doctrine/dbal": "^2.6 || ^3", + "ext-json": "*", + "illuminate/console": "^8 || ^9", + "illuminate/filesystem": "^8 || ^9", + "illuminate/support": "^8 || ^9", + "nikic/php-parser": "^4.7", + "php": "^7.3 || ^8.0", + "phpdocumentor/type-resolver": "^1.1.0" + }, + "require-dev": { + "ext-pdo_sqlite": "*", + "friendsofphp/php-cs-fixer": "^2", + "illuminate/config": "^8 || ^9", + "illuminate/view": "^8 || ^9", + "mockery/mockery": "^1.4", + "orchestra/testbench": "^6 || ^7", + "phpunit/phpunit": "^8.5 || ^9", + "spatie/phpunit-snapshot-assertions": "^3 || ^4", + "vimeo/psalm": "^3.12" + }, + "suggest": { + "illuminate/events": "Required for automatic helper generation (^6|^7|^8|^9)." + }, + "time": "2022-03-06T14:33:42+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.12-dev" + }, + "laravel": { + "providers": [ + "Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider" + ] + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Barryvdh\\LaravelIdeHelper\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Barry vd. Heuvel", + "email": "barryvdh@gmail.com" + } + ], + "description": "Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.", + "keywords": [ + "autocomplete", + "codeintel", + "helper", + "ide", + "laravel", + "netbeans", + "phpdoc", + "phpstorm", + "sublime" + ], + "support": { + "issues": "https://github.com/barryvdh/laravel-ide-helper/issues", + "source": "https://github.com/barryvdh/laravel-ide-helper/tree/v2.12.3" + }, + "funding": [ + { + "url": "https://fruitcake.nl", + "type": "custom" + }, + { + "url": "https://github.com/barryvdh", + "type": "github" + } + ], + "install-path": "../barryvdh/laravel-ide-helper" + }, + { + "name": "barryvdh/reflection-docblock", + "version": "v2.1.0", + "version_normalized": "2.1.0.0", + "source": { + "type": "git", + "url": "https://github.com/barryvdh/ReflectionDocBlock.git", + "reference": "bf44b757feb8ba1734659029357646466ded673e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/barryvdh/ReflectionDocBlock/zipball/bf44b757feb8ba1734659029357646466ded673e", + "reference": "bf44b757feb8ba1734659029357646466ded673e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.14|^9" + }, + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" + }, + "time": "2022-10-31T15:35:43+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Barryvdh": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "support": { + "source": "https://github.com/barryvdh/ReflectionDocBlock/tree/v2.1.0" + }, + "install-path": "../barryvdh/reflection-docblock" + }, { "name": "brick/math", "version": "0.9.3", @@ -132,6 +284,80 @@ ], "install-path": "../clue/stream-filter" }, + { + "name": "composer/pcre", + "version": "3.1.0", + "version_normalized": "3.1.0.0", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" + }, + "time": "2022-11-17T09:50:14+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.1.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "install-path": "./pcre" + }, { "name": "dflydev/dot-access-data", "version": "v3.0.2", @@ -210,6 +436,357 @@ }, "install-path": "../dflydev/dot-access-data" }, + { + "name": "doctrine/cache", + "version": "2.2.0", + "version_normalized": "2.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/cache.git", + "reference": "1ca8f21980e770095a31456042471a57bc4c68fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/cache/zipball/1ca8f21980e770095a31456042471a57bc4c68fb", + "reference": "1ca8f21980e770095a31456042471a57bc4c68fb", + "shasum": "" + }, + "require": { + "php": "~7.1 || ^8.0" + }, + "conflict": { + "doctrine/common": ">2.2,<2.4" + }, + "require-dev": { + "cache/integration-tests": "dev-master", + "doctrine/coding-standard": "^9", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "symfony/cache": "^4.4 || ^5.4 || ^6", + "symfony/var-exporter": "^4.4 || ^5.4 || ^6" + }, + "time": "2022-05-20T20:07:39+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", + "homepage": "https://www.doctrine-project.org/projects/cache.html", + "keywords": [ + "abstraction", + "apcu", + "cache", + "caching", + "couchdb", + "memcached", + "php", + "redis", + "xcache" + ], + "support": { + "issues": "https://github.com/doctrine/cache/issues", + "source": "https://github.com/doctrine/cache/tree/2.2.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache", + "type": "tidelift" + } + ], + "install-path": "../doctrine/cache" + }, + { + "name": "doctrine/dbal", + "version": "3.5.1", + "version_normalized": "3.5.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/dbal.git", + "reference": "f38ee8aaca2d58ee88653cb34a6a3880c23f38a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/f38ee8aaca2d58ee88653cb34a6a3880c23f38a5", + "reference": "f38ee8aaca2d58ee88653cb34a6a3880c23f38a5", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2", + "doctrine/cache": "^1.11|^2.0", + "doctrine/deprecations": "^0.5.3|^1", + "doctrine/event-manager": "^1|^2", + "php": "^7.4 || ^8.0", + "psr/cache": "^1|^2|^3", + "psr/log": "^1|^2|^3" + }, + "require-dev": { + "doctrine/coding-standard": "10.0.0", + "jetbrains/phpstorm-stubs": "2022.2", + "phpstan/phpstan": "1.8.10", + "phpstan/phpstan-strict-rules": "^1.4", + "phpunit/phpunit": "9.5.25", + "psalm/plugin-phpunit": "0.17.0", + "squizlabs/php_codesniffer": "3.7.1", + "symfony/cache": "^5.4|^6.0", + "symfony/console": "^4.4|^5.4|^6.0", + "vimeo/psalm": "4.29.0" + }, + "suggest": { + "symfony/console": "For helpful console commands such as SQL execution and import of files." + }, + "time": "2022-10-24T07:26:18+00:00", + "bin": [ + "bin/doctrine-dbal" + ], + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Doctrine\\DBAL\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + } + ], + "description": "Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.", + "homepage": "https://www.doctrine-project.org/projects/dbal.html", + "keywords": [ + "abstraction", + "database", + "db2", + "dbal", + "mariadb", + "mssql", + "mysql", + "oci8", + "oracle", + "pdo", + "pgsql", + "postgresql", + "queryobject", + "sasql", + "sql", + "sqlite", + "sqlserver", + "sqlsrv" + ], + "support": { + "issues": "https://github.com/doctrine/dbal/issues", + "source": "https://github.com/doctrine/dbal/tree/3.5.1" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdbal", + "type": "tidelift" + } + ], + "install-path": "../doctrine/dbal" + }, + { + "name": "doctrine/deprecations", + "version": "v1.0.0", + "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "shasum": "" + }, + "require": { + "php": "^7.1|^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "phpunit/phpunit": "^7.5|^8.5|^9.5", + "psr/log": "^1|^2|^3" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "time": "2022-05-02T15:47:09+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/v1.0.0" + }, + "install-path": "../doctrine/deprecations" + }, + { + "name": "doctrine/event-manager", + "version": "1.2.0", + "version_normalized": "1.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/event-manager.git", + "reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/95aa4cb529f1e96576f3fda9f5705ada4056a520", + "reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520", + "shasum": "" + }, + "require": { + "doctrine/deprecations": "^0.5.3 || ^1", + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/common": "<2.9" + }, + "require-dev": { + "doctrine/coding-standard": "^9 || ^10", + "phpstan/phpstan": "~1.4.10 || ^1.8.8", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.24" + }, + "time": "2022-10-12T20:51:15+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.", + "homepage": "https://www.doctrine-project.org/projects/event-manager.html", + "keywords": [ + "event", + "event dispatcher", + "event manager", + "event system", + "events" + ], + "support": { + "issues": "https://github.com/doctrine/event-manager/issues", + "source": "https://github.com/doctrine/event-manager/tree/1.2.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fevent-manager", + "type": "tidelift" + } + ], + "install-path": "../doctrine/event-manager" + }, { "name": "doctrine/inflector", "version": "2.0.6", @@ -3941,6 +4518,120 @@ }, "install-path": "../php-http/promise" }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "version_normalized": "2.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "time": "2020-06-27T09:03:43+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "install-path": "../phpdocumentor/reflection-common" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.6.2", + "version_normalized": "1.6.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/48f445a408c131e38cab1c235aa6d2bb7a0bb20d", + "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "*", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^9.5", + "rector/rector": "^0.13.9", + "vimeo/psalm": "^4.25" + }, + "time": "2022-10-14T12:47:21+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.2" + }, + "install-path": "../phpdocumentor/type-resolver" + }, { "name": "phpoption/phpoption", "version": "1.9.0", @@ -9442,6 +10133,13 @@ ], "dev": true, "dev-package-names": [ + "barryvdh/laravel-ide-helper", + "barryvdh/reflection-docblock", + "composer/pcre", + "doctrine/cache", + "doctrine/dbal", + "doctrine/deprecations", + "doctrine/event-manager", "doctrine/instantiator", "fzaninotto/faker", "hamcrest/hamcrest-php", @@ -9449,6 +10147,8 @@ "myclabs/deep-copy", "phar-io/manifest", "phar-io/version", + "phpdocumentor/reflection-common", + "phpdocumentor/type-resolver", "phpunit/php-code-coverage", "phpunit/php-file-iterator", "phpunit/php-invoker", diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index e7e6dbbd..a1a12f34 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,13 +3,31 @@ 'name' => 'laravel/laravel', 'pretty_version' => '2.x-dev', 'version' => '2.9999999.9999999.9999999-dev', - 'reference' => 'bb07ba5964270b9b986bcd4508fd4a4f5a6c2323', + 'reference' => 'bd76efc613870dd5d72f3b339550889d09aad8d7', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => true, ), 'versions' => array( + 'barryvdh/laravel-ide-helper' => array( + 'pretty_version' => 'v2.12.3', + 'version' => '2.12.3.0', + 'reference' => '3ba1e2573b38f72107b8aacc4ee177fcab30a550', + 'type' => 'library', + 'install_path' => __DIR__ . '/../barryvdh/laravel-ide-helper', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'barryvdh/reflection-docblock' => array( + 'pretty_version' => 'v2.1.0', + 'version' => '2.1.0.0', + 'reference' => 'bf44b757feb8ba1734659029357646466ded673e', + 'type' => 'library', + 'install_path' => __DIR__ . '/../barryvdh/reflection-docblock', + 'aliases' => array(), + 'dev_requirement' => true, + ), 'brick/math' => array( 'pretty_version' => '0.9.3', 'version' => '0.9.3.0', @@ -28,6 +46,15 @@ 'aliases' => array(), 'dev_requirement' => false, ), + 'composer/pcre' => array( + 'pretty_version' => '3.1.0', + 'version' => '3.1.0.0', + 'reference' => '4bff79ddd77851fe3cdd11616ed3f92841ba5bd2', + 'type' => 'library', + 'install_path' => __DIR__ . '/./pcre', + 'aliases' => array(), + 'dev_requirement' => true, + ), 'cordoval/hamcrest-php' => array( 'dev_requirement' => true, 'replaced' => array( @@ -49,6 +76,42 @@ 'aliases' => array(), 'dev_requirement' => false, ), + 'doctrine/cache' => array( + 'pretty_version' => '2.2.0', + 'version' => '2.2.0.0', + 'reference' => '1ca8f21980e770095a31456042471a57bc4c68fb', + 'type' => 'library', + 'install_path' => __DIR__ . '/../doctrine/cache', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'doctrine/dbal' => array( + 'pretty_version' => '3.5.1', + 'version' => '3.5.1.0', + 'reference' => 'f38ee8aaca2d58ee88653cb34a6a3880c23f38a5', + 'type' => 'library', + 'install_path' => __DIR__ . '/../doctrine/dbal', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'doctrine/deprecations' => array( + 'pretty_version' => 'v1.0.0', + 'version' => '1.0.0.0', + 'reference' => '0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de', + 'type' => 'library', + 'install_path' => __DIR__ . '/../doctrine/deprecations', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'doctrine/event-manager' => array( + 'pretty_version' => '1.2.0', + 'version' => '1.2.0.0', + 'reference' => '95aa4cb529f1e96576f3fda9f5705ada4056a520', + 'type' => 'library', + 'install_path' => __DIR__ . '/../doctrine/event-manager', + 'aliases' => array(), + 'dev_requirement' => true, + ), 'doctrine/inflector' => array( 'pretty_version' => '2.0.6', 'version' => '2.0.6.0', @@ -433,7 +496,7 @@ 'laravel/laravel' => array( 'pretty_version' => '2.x-dev', 'version' => '2.9999999.9999999.9999999-dev', - 'reference' => 'bb07ba5964270b9b986bcd4508fd4a4f5a6c2323', + 'reference' => 'bd76efc613870dd5d72f3b339550889d09aad8d7', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -694,6 +757,24 @@ 'aliases' => array(), 'dev_requirement' => false, ), + 'phpdocumentor/reflection-common' => array( + 'pretty_version' => '2.2.0', + 'version' => '2.2.0.0', + 'reference' => '1d01c49d4ed62f25aa84a747ad35d5a16924662b', + 'type' => 'library', + 'install_path' => __DIR__ . '/../phpdocumentor/reflection-common', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'phpdocumentor/type-resolver' => array( + 'pretty_version' => '1.6.2', + 'version' => '1.6.2.0', + 'reference' => '48f445a408c131e38cab1c235aa6d2bb7a0bb20d', + 'type' => 'library', + 'install_path' => __DIR__ . '/../phpdocumentor/type-resolver', + 'aliases' => array(), + 'dev_requirement' => true, + ), 'phpoption/phpoption' => array( 'pretty_version' => '1.9.0', 'version' => '1.9.0.0', diff --git a/vendor/composer/pcre/LICENSE b/vendor/composer/pcre/LICENSE new file mode 100644 index 00000000..c5a282ff --- /dev/null +++ b/vendor/composer/pcre/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2021 Composer + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/composer/pcre/README.md b/vendor/composer/pcre/README.md new file mode 100644 index 00000000..973b17d8 --- /dev/null +++ b/vendor/composer/pcre/README.md @@ -0,0 +1,181 @@ +composer/pcre +============= + +PCRE wrapping library that offers type-safe `preg_*` replacements. + +This library gives you a way to ensure `preg_*` functions do not fail silently, returning +unexpected `null`s that may not be handled. + +As of 3.0 this library enforces [`PREG_UNMATCHED_AS_NULL`](#preg_unmatched_as_null) usage +for all matching and replaceCallback functions, [read more below](#preg_unmatched_as_null) +to understand the implications. + +It thus makes it easier to work with static analysis tools like PHPStan or Psalm as it +simplifies and reduces the possible return values from all the `preg_*` functions which +are quite packed with edge cases. + +This library is a thin wrapper around `preg_*` functions with [some limitations](#restrictions--limitations). +If you are looking for a richer API to handle regular expressions have a look at +[rawr/t-regx](https://packagist.org/packages/rawr/t-regx) instead. + +[![Continuous Integration](https://github.com/composer/pcre/workflows/Continuous%20Integration/badge.svg?branch=main)](https://github.com/composer/pcre/actions) + + +Installation +------------ + +Install the latest version with: + +```bash +$ composer require composer/pcre +``` + + +Requirements +------------ + +* PHP 7.4.0 is required for 3.x versions +* PHP 7.2.0 is required for 2.x versions +* PHP 5.3.2 is required for 1.x versions + + +Basic usage +----------- + +Instead of: + +```php +if (preg_match('{fo+}', $string, $matches)) { ... } +if (preg_match('{fo+}', $string, $matches, PREG_OFFSET_CAPTURE)) { ... } +if (preg_match_all('{fo+}', $string, $matches)) { ... } +$newString = preg_replace('{fo+}', 'bar', $string); +$newString = preg_replace_callback('{fo+}', function ($match) { return strtoupper($match[0]); }, $string); +$newString = preg_replace_callback_array(['{fo+}' => fn ($match) => strtoupper($match[0])], $string); +$filtered = preg_grep('{[a-z]}', $elements); +$array = preg_split('{[a-z]+}', $string); +``` + +You can now call these on the `Preg` class: + +```php +use Composer\Pcre\Preg; + +if (Preg::match('{fo+}', $string, $matches)) { ... } +if (Preg::matchWithOffsets('{fo+}', $string, $matches)) { ... } +if (Preg::matchAll('{fo+}', $string, $matches)) { ... } +$newString = Preg::replace('{fo+}', 'bar', $string); +$newString = Preg::replaceCallback('{fo+}', function ($match) { return strtoupper($match[0]); }, $string); +$newString = Preg::replaceCallbackArray(['{fo+}' => fn ($match) => strtoupper($match[0])], $string); +$filtered = Preg::grep('{[a-z]}', $elements); +$array = Preg::split('{[a-z]+}', $string); +``` + +The main difference is if anything fails to match/replace/.., it will throw a `Composer\Pcre\PcreException` +instead of returning `null` (or false in some cases), so you can now use the return values safely relying on +the fact that they can only be strings (for replace), ints (for match) or arrays (for grep/split). + +Additionally the `Preg` class provides match methods that return `bool` rather than `int`, for stricter type safety +when the number of pattern matches is not useful: + +```php +use Composer\Pcre\Preg; + +if (Preg::isMatch('{fo+}', $string, $matches)) // bool +if (Preg::isMatchAll('{fo+}', $string, $matches)) // bool +``` + +Finally the `Preg` class provides a few `*StrictGroups` method variants that ensure match groups +are always present and thus non-nullable, making it easier to write type-safe code: + +```php +use Composer\Pcre\Preg; + +// $matches is guaranteed to be an array of strings, if a subpattern does not match and produces a null it will throw +if (Preg::matchStrictGroups('{fo+}', $string, $matches)) +if (Preg::matchAllStrictGroups('{fo+}', $string, $matches)) +``` + +**Note:** This is generally safe to use as long as you do not have optional subpatterns (i.e. `(something)?` +or `(something)*` or branches with a `|` that result in some groups not being matched at all). +A subpattern that can match an empty string like `(.*)` is **not** optional, it will be present as an +empty string in the matches. A non-matching subpattern, even if optional like `(?:foo)?` will anyway not be present in +matches so it is also not a problem to use these with `*StrictGroups` methods. + +If you would prefer a slightly more verbose usage, replacing by-ref arguments by result objects, you can use the `Regex` class: + +```php +use Composer\Pcre\Regex; + +// this is useful when you are just interested in knowing if something matched +// as it returns a bool instead of int(1/0) for match +$bool = Regex::isMatch('{fo+}', $string); + +$result = Regex::match('{fo+}', $string); +if ($result->matched) { something($result->matches); } + +$result = Regex::matchWithOffsets('{fo+}', $string); +if ($result->matched) { something($result->matches); } + +$result = Regex::matchAll('{fo+}', $string); +if ($result->matched && $result->count > 3) { something($result->matches); } + +$newString = Regex::replace('{fo+}', 'bar', $string)->result; +$newString = Regex::replaceCallback('{fo+}', function ($match) { return strtoupper($match[0]); }, $string)->result; +$newString = Regex::replaceCallbackArray(['{fo+}' => fn ($match) => strtoupper($match[0])], $string)->result; +``` + +Note that `preg_grep` and `preg_split` are only callable via the `Preg` class as they do not have +complex return types warranting a specific result object. + +See the [MatchResult](src/MatchResult.php), [MatchWithOffsetsResult](src/MatchWithOffsetsResult.php), [MatchAllResult](src/MatchAllResult.php), +[MatchAllWithOffsetsResult](src/MatchAllWithOffsetsResult.php), and [ReplaceResult](src/ReplaceResult.php) class sources for more details. + +Restrictions / Limitations +-------------------------- + +Due to type safety requirements a few restrictions are in place. + +- matching using `PREG_OFFSET_CAPTURE` is made available via `matchWithOffsets` and `matchAllWithOffsets`. + You cannot pass the flag to `match`/`matchAll`. +- `Preg::split` will also reject `PREG_SPLIT_OFFSET_CAPTURE` and you should use `splitWithOffsets` + instead. +- `matchAll` rejects `PREG_SET_ORDER` as it also changes the shape of the returned matches. There + is no alternative provided as you can fairly easily code around it. +- `preg_filter` is not supported as it has a rather crazy API, most likely you should rather + use `Preg::grep` in combination with some loop and `Preg::replace`. +- `replace`, `replaceCallback` and `replaceCallbackArray` do not support an array `$subject`, + only simple strings. +- As of 2.0, the library always uses `PREG_UNMATCHED_AS_NULL` for matching, which offers [much + saner/more predictable results](#preg_unmatched_as_null). As of 3.0 the flag is also set for + `replaceCallback` and `replaceCallbackArray`. + +#### PREG_UNMATCHED_AS_NULL + +As of 2.0, this library always uses PREG_UNMATCHED_AS_NULL for all `match*` and `isMatch*` +functions. As of 3.0 it is also done for `replaceCallback` and `replaceCallbackArray`. + +This means your matches will always contain all matching groups, either as null if unmatched +or as string if it matched. + +The advantages in clarity and predictability are clearer if you compare the two outputs of +running this with and without PREG_UNMATCHED_AS_NULL in $flags: + +```php +preg_match('/(a)(b)*(c)(d)*/', 'ac', $matches, $flags); +``` + +| no flag | PREG_UNMATCHED_AS_NULL | +| --- | --- | +| array (size=4) | array (size=5) | +| 0 => string 'ac' (length=2) | 0 => string 'ac' (length=2) | +| 1 => string 'a' (length=1) | 1 => string 'a' (length=1) | +| 2 => string '' (length=0) | 2 => null | +| 3 => string 'c' (length=1) | 3 => string 'c' (length=1) | +| | 4 => null | +| group 2 (any unmatched group preceding one that matched) is set to `''`. You cannot tell if it matched an empty string or did not match at all | group 2 is `null` when unmatched and a string if it matched, easy to check for | +| group 4 (any optional group without a matching one following) is missing altogether. So you have to check with `isset()`, but really you want `isset($m[4]) && $m[4] !== ''` for safety unless you are very careful to check that a non-optional group follows it | group 4 is always set, and null in this case as there was no match, easy to check for with `$m[4] !== null` | + +License +------- + +composer/pcre is licensed under the MIT License, see the LICENSE file for details. diff --git a/vendor/composer/pcre/composer.json b/vendor/composer/pcre/composer.json new file mode 100644 index 00000000..40477ff4 --- /dev/null +++ b/vendor/composer/pcre/composer.json @@ -0,0 +1,46 @@ +{ + "name": "composer/pcre", + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "type": "library", + "license": "MIT", + "keywords": [ + "pcre", + "regex", + "preg", + "regular expression" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^5", + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1" + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Composer\\Pcre\\": "tests" + } + }, + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "scripts": { + "test": "vendor/bin/simple-phpunit", + "phpstan": "phpstan analyse" + } +} diff --git a/vendor/composer/pcre/src/MatchAllResult.php b/vendor/composer/pcre/src/MatchAllResult.php new file mode 100644 index 00000000..4310c536 --- /dev/null +++ b/vendor/composer/pcre/src/MatchAllResult.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\Pcre; + +final class MatchAllResult +{ + /** + * An array of match group => list of matched strings + * + * @readonly + * @var array> + */ + public $matches; + + /** + * @readonly + * @var 0|positive-int + */ + public $count; + + /** + * @readonly + * @var bool + */ + public $matched; + + /** + * @param 0|positive-int $count + * @param array> $matches + */ + public function __construct(int $count, array $matches) + { + $this->matches = $matches; + $this->matched = (bool) $count; + $this->count = $count; + } +} diff --git a/vendor/composer/pcre/src/MatchAllStrictGroupsResult.php b/vendor/composer/pcre/src/MatchAllStrictGroupsResult.php new file mode 100644 index 00000000..69dcd062 --- /dev/null +++ b/vendor/composer/pcre/src/MatchAllStrictGroupsResult.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\Pcre; + +final class MatchAllStrictGroupsResult +{ + /** + * An array of match group => list of matched strings + * + * @readonly + * @var array> + */ + public $matches; + + /** + * @readonly + * @var 0|positive-int + */ + public $count; + + /** + * @readonly + * @var bool + */ + public $matched; + + /** + * @param 0|positive-int $count + * @param array> $matches + */ + public function __construct(int $count, array $matches) + { + $this->matches = $matches; + $this->matched = (bool) $count; + $this->count = $count; + } +} diff --git a/vendor/composer/pcre/src/MatchAllWithOffsetsResult.php b/vendor/composer/pcre/src/MatchAllWithOffsetsResult.php new file mode 100644 index 00000000..032a02cd --- /dev/null +++ b/vendor/composer/pcre/src/MatchAllWithOffsetsResult.php @@ -0,0 +1,48 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\Pcre; + +final class MatchAllWithOffsetsResult +{ + /** + * An array of match group => list of matches, every match being a pair of string matched + offset in bytes (or -1 if no match) + * + * @readonly + * @var array> + * @phpstan-var array}>> + */ + public $matches; + + /** + * @readonly + * @var 0|positive-int + */ + public $count; + + /** + * @readonly + * @var bool + */ + public $matched; + + /** + * @param 0|positive-int $count + * @param array> $matches + * @phpstan-param array}>> $matches + */ + public function __construct(int $count, array $matches) + { + $this->matches = $matches; + $this->matched = (bool) $count; + $this->count = $count; + } +} diff --git a/vendor/composer/pcre/src/MatchResult.php b/vendor/composer/pcre/src/MatchResult.php new file mode 100644 index 00000000..e951a5ee --- /dev/null +++ b/vendor/composer/pcre/src/MatchResult.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\Pcre; + +final class MatchResult +{ + /** + * An array of match group => string matched + * + * @readonly + * @var array + */ + public $matches; + + /** + * @readonly + * @var bool + */ + public $matched; + + /** + * @param 0|positive-int $count + * @param array $matches + */ + public function __construct(int $count, array $matches) + { + $this->matches = $matches; + $this->matched = (bool) $count; + } +} diff --git a/vendor/composer/pcre/src/MatchStrictGroupsResult.php b/vendor/composer/pcre/src/MatchStrictGroupsResult.php new file mode 100644 index 00000000..126ee629 --- /dev/null +++ b/vendor/composer/pcre/src/MatchStrictGroupsResult.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\Pcre; + +final class MatchStrictGroupsResult +{ + /** + * An array of match group => string matched + * + * @readonly + * @var array + */ + public $matches; + + /** + * @readonly + * @var bool + */ + public $matched; + + /** + * @param 0|positive-int $count + * @param array $matches + */ + public function __construct(int $count, array $matches) + { + $this->matches = $matches; + $this->matched = (bool) $count; + } +} diff --git a/vendor/composer/pcre/src/MatchWithOffsetsResult.php b/vendor/composer/pcre/src/MatchWithOffsetsResult.php new file mode 100644 index 00000000..ba4d4bc4 --- /dev/null +++ b/vendor/composer/pcre/src/MatchWithOffsetsResult.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\Pcre; + +final class MatchWithOffsetsResult +{ + /** + * An array of match group => pair of string matched + offset in bytes (or -1 if no match) + * + * @readonly + * @var array + * @phpstan-var array}> + */ + public $matches; + + /** + * @readonly + * @var bool + */ + public $matched; + + /** + * @param 0|positive-int $count + * @param array $matches + * @phpstan-param array}> $matches + */ + public function __construct(int $count, array $matches) + { + $this->matches = $matches; + $this->matched = (bool) $count; + } +} diff --git a/vendor/composer/pcre/src/PcreException.php b/vendor/composer/pcre/src/PcreException.php new file mode 100644 index 00000000..218b2f2d --- /dev/null +++ b/vendor/composer/pcre/src/PcreException.php @@ -0,0 +1,60 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\Pcre; + +class PcreException extends \RuntimeException +{ + /** + * @param string $function + * @param string|string[] $pattern + * @return self + */ + public static function fromFunction($function, $pattern) + { + $code = preg_last_error(); + + if (is_array($pattern)) { + $pattern = implode(', ', $pattern); + } + + return new PcreException($function.'(): failed executing "'.$pattern.'": '.self::pcreLastErrorMessage($code), $code); + } + + /** + * @param int $code + * @return string + */ + private static function pcreLastErrorMessage($code) + { + if (function_exists('preg_last_error_msg')) { + return preg_last_error_msg(); + } + + // older php versions did not set the code properly in all cases + if (PHP_VERSION_ID < 70201 && $code === 0) { + return 'UNDEFINED_ERROR'; + } + + $constants = get_defined_constants(true); + if (!isset($constants['pcre'])) { + return 'UNDEFINED_ERROR'; + } + + foreach ($constants['pcre'] as $const => $val) { + if ($val === $code && substr($const, -6) === '_ERROR') { + return $const; + } + } + + return 'UNDEFINED_ERROR'; + } +} diff --git a/vendor/composer/pcre/src/Preg.php b/vendor/composer/pcre/src/Preg.php new file mode 100644 index 00000000..0e35f7d6 --- /dev/null +++ b/vendor/composer/pcre/src/Preg.php @@ -0,0 +1,428 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\Pcre; + +class Preg +{ + /** @internal */ + public const ARRAY_MSG = '$subject as an array is not supported. You can use \'foreach\' instead.'; + /** @internal */ + public const INVALID_TYPE_MSG = '$subject must be a string, %s given.'; + + /** + * @param non-empty-string $pattern + * @param array $matches Set by method + * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported + * @return 0|1 + * + * @param-out array $matches + */ + public static function match(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): int + { + self::checkOffsetCapture($flags, 'matchWithOffsets'); + + $result = preg_match($pattern, $subject, $matches, $flags | PREG_UNMATCHED_AS_NULL, $offset); + if ($result === false) { + throw PcreException::fromFunction('preg_match', $pattern); + } + + return $result; + } + + /** + * Variant of `match()` which outputs non-null matches (or throws) + * + * @param non-empty-string $pattern + * @param array $matches Set by method + * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported + * @return 0|1 + * @throws UnexpectedNullMatchException + * + * @param-out array $matches + */ + public static function matchStrictGroups(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): int + { + $result = self::match($pattern, $subject, $matchesInternal, $flags, $offset); + $matches = self::enforceNonNullMatches($pattern, $matchesInternal, 'match'); + + return $result; + } + + /** + * Runs preg_match with PREG_OFFSET_CAPTURE + * + * @param non-empty-string $pattern + * @param array $matches Set by method + * @param int-mask $flags PREG_UNMATCHED_AS_NULL and PREG_OFFSET_CAPTURE are always set, no other flags are supported + * @return 0|1 + * + * @param-out array}> $matches + */ + public static function matchWithOffsets(string $pattern, string $subject, ?array &$matches, int $flags = 0, int $offset = 0): int + { + $result = preg_match($pattern, $subject, $matches, $flags | PREG_UNMATCHED_AS_NULL | PREG_OFFSET_CAPTURE, $offset); + if ($result === false) { + throw PcreException::fromFunction('preg_match', $pattern); + } + + return $result; + } + + /** + * @param non-empty-string $pattern + * @param array> $matches Set by method + * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported + * @return 0|positive-int + * + * @param-out array> $matches + */ + public static function matchAll(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): int + { + self::checkOffsetCapture($flags, 'matchAllWithOffsets'); + self::checkSetOrder($flags); + + $result = preg_match_all($pattern, $subject, $matches, $flags | PREG_UNMATCHED_AS_NULL, $offset); + if (!is_int($result)) { // PHP < 8 may return null, 8+ returns int|false + throw PcreException::fromFunction('preg_match_all', $pattern); + } + + return $result; + } + + /** + * Variant of `match()` which outputs non-null matches (or throws) + * + * @param non-empty-string $pattern + * @param array> $matches Set by method + * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported + * @return 0|positive-int + * @throws UnexpectedNullMatchException + * + * @param-out array> $matches + */ + public static function matchAllStrictGroups(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): int + { + $result = self::matchAll($pattern, $subject, $matchesInternal, $flags, $offset); + $matches = self::enforceNonNullMatchAll($pattern, $matchesInternal, 'matchAll'); + + return $result; + } + + /** + * Runs preg_match_all with PREG_OFFSET_CAPTURE + * + * @param non-empty-string $pattern + * @param array> $matches Set by method + * @param int-mask $flags PREG_UNMATCHED_AS_NULL and PREG_MATCH_OFFSET are always set, no other flags are supported + * @return 0|positive-int + * + * @phpstan-param array}>> $matches + */ + public static function matchAllWithOffsets(string $pattern, string $subject, ?array &$matches, int $flags = 0, int $offset = 0): int + { + self::checkSetOrder($flags); + + $result = preg_match_all($pattern, $subject, $matches, $flags | PREG_UNMATCHED_AS_NULL | PREG_OFFSET_CAPTURE, $offset); + if (!is_int($result)) { // PHP < 8 may return null, 8+ returns int|false + throw PcreException::fromFunction('preg_match_all', $pattern); + } + + return $result; + } + + /** + * @param string|string[] $pattern + * @param string|string[] $replacement + * @param string $subject + * @param int $count Set by method + * + * @param-out int<0, max> $count + */ + public static function replace($pattern, $replacement, $subject, int $limit = -1, int &$count = null): string + { + if (!is_scalar($subject)) { + if (is_array($subject)) { + throw new \InvalidArgumentException(static::ARRAY_MSG); + } + + throw new \TypeError(sprintf(static::INVALID_TYPE_MSG, gettype($subject))); + } + + $result = preg_replace($pattern, $replacement, $subject, $limit, $count); + if ($result === null) { + throw PcreException::fromFunction('preg_replace', $pattern); + } + + return $result; + } + + /** + * @param string|string[] $pattern + * @param callable(array): string $replacement + * @param string $subject + * @param int $count Set by method + * @param int-mask $flags PREG_OFFSET_CAPTURE is supported, PREG_UNMATCHED_AS_NULL is always set + * + * @param-out int<0, max> $count + */ + public static function replaceCallback($pattern, callable $replacement, $subject, int $limit = -1, int &$count = null, int $flags = 0): string + { + if (!is_scalar($subject)) { + if (is_array($subject)) { + throw new \InvalidArgumentException(static::ARRAY_MSG); + } + + throw new \TypeError(sprintf(static::INVALID_TYPE_MSG, gettype($subject))); + } + + $result = preg_replace_callback($pattern, $replacement, $subject, $limit, $count, $flags | PREG_UNMATCHED_AS_NULL); + if ($result === null) { + throw PcreException::fromFunction('preg_replace_callback', $pattern); + } + + return $result; + } + + /** + * Variant of `replaceCallback()` which outputs non-null matches (or throws) + * + * @param string $pattern + * @param callable(array): string $replacement + * @param string $subject + * @param int $count Set by method + * @param int-mask $flags PREG_OFFSET_CAPTURE or PREG_UNMATCHED_AS_NULL, only available on PHP 7.4+ + * + * @param-out int<0, max> $count + */ + public static function replaceCallbackStrictGroups(string $pattern, callable $replacement, $subject, int $limit = -1, int &$count = null, int $flags = 0): string + { + return self::replaceCallback($pattern, function (array $matches) use ($pattern, $replacement) { + return $replacement(self::enforceNonNullMatches($pattern, $matches, 'replaceCallback')); + }, $subject, $limit, $count, $flags); + } + + /** + * @param array): string> $pattern + * @param string $subject + * @param int $count Set by method + * @param int-mask $flags PREG_OFFSET_CAPTURE is supported, PREG_UNMATCHED_AS_NULL is always set + * + * @param-out int<0, max> $count + */ + public static function replaceCallbackArray(array $pattern, $subject, int $limit = -1, int &$count = null, int $flags = 0): string + { + if (!is_scalar($subject)) { + if (is_array($subject)) { + throw new \InvalidArgumentException(static::ARRAY_MSG); + } + + throw new \TypeError(sprintf(static::INVALID_TYPE_MSG, gettype($subject))); + } + + $result = preg_replace_callback_array($pattern, $subject, $limit, $count, $flags | PREG_UNMATCHED_AS_NULL); + if ($result === null) { + $pattern = array_keys($pattern); + throw PcreException::fromFunction('preg_replace_callback_array', $pattern); + } + + return $result; + } + + /** + * @param int-mask $flags PREG_SPLIT_NO_EMPTY or PREG_SPLIT_DELIM_CAPTURE + * @return list + */ + public static function split(string $pattern, string $subject, int $limit = -1, int $flags = 0): array + { + if (($flags & PREG_SPLIT_OFFSET_CAPTURE) !== 0) { + throw new \InvalidArgumentException('PREG_SPLIT_OFFSET_CAPTURE is not supported as it changes the type of $matches, use splitWithOffsets() instead'); + } + + $result = preg_split($pattern, $subject, $limit, $flags); + if ($result === false) { + throw PcreException::fromFunction('preg_split', $pattern); + } + + return $result; + } + + /** + * @param int-mask $flags PREG_SPLIT_NO_EMPTY or PREG_SPLIT_DELIM_CAPTURE, PREG_SPLIT_OFFSET_CAPTURE is always set + * @return list + * @phpstan-return list}> + */ + public static function splitWithOffsets(string $pattern, string $subject, int $limit = -1, int $flags = 0): array + { + $result = preg_split($pattern, $subject, $limit, $flags | PREG_SPLIT_OFFSET_CAPTURE); + if ($result === false) { + throw PcreException::fromFunction('preg_split', $pattern); + } + + return $result; + } + + /** + * @template T of string|\Stringable + * @param string $pattern + * @param array $array + * @param int-mask $flags PREG_GREP_INVERT + * @return array + */ + public static function grep(string $pattern, array $array, int $flags = 0): array + { + $result = preg_grep($pattern, $array, $flags); + if ($result === false) { + throw PcreException::fromFunction('preg_grep', $pattern); + } + + return $result; + } + + /** + * Variant of match() which returns a bool instead of int + * + * @param non-empty-string $pattern + * @param array $matches Set by method + * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported + * + * @param-out array $matches + */ + public static function isMatch(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): bool + { + return (bool) static::match($pattern, $subject, $matches, $flags, $offset); + } + + /** + * Variant of `isMatch()` which outputs non-null matches (or throws) + * + * @param non-empty-string $pattern + * @param array $matches Set by method + * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported + * @throws UnexpectedNullMatchException + * + * @param-out array $matches + */ + public static function isMatchStrictGroups(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): bool + { + return (bool) self::matchStrictGroups($pattern, $subject, $matches, $flags, $offset); + } + + /** + * Variant of matchAll() which returns a bool instead of int + * + * @param non-empty-string $pattern + * @param array> $matches Set by method + * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported + * + * @param-out array> $matches + */ + public static function isMatchAll(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): bool + { + return (bool) static::matchAll($pattern, $subject, $matches, $flags, $offset); + } + + /** + * Variant of `isMatchAll()` which outputs non-null matches (or throws) + * + * @param non-empty-string $pattern + * @param array> $matches Set by method + * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported + * + * @param-out array> $matches + */ + public static function isMatchAllStrictGroups(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): bool + { + return (bool) self::matchAllStrictGroups($pattern, $subject, $matches, $flags, $offset); + } + + /** + * Variant of matchWithOffsets() which returns a bool instead of int + * + * Runs preg_match with PREG_OFFSET_CAPTURE + * + * @param non-empty-string $pattern + * @param array $matches Set by method + * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported + * + * @param-out array}> $matches + */ + public static function isMatchWithOffsets(string $pattern, string $subject, ?array &$matches, int $flags = 0, int $offset = 0): bool + { + return (bool) static::matchWithOffsets($pattern, $subject, $matches, $flags, $offset); + } + + /** + * Variant of matchAllWithOffsets() which returns a bool instead of int + * + * Runs preg_match_all with PREG_OFFSET_CAPTURE + * + * @param non-empty-string $pattern + * @param array> $matches Set by method + * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported + * + * @param-out array}>> $matches + */ + public static function isMatchAllWithOffsets(string $pattern, string $subject, ?array &$matches, int $flags = 0, int $offset = 0): bool + { + return (bool) static::matchAllWithOffsets($pattern, $subject, $matches, $flags, $offset); + } + + private static function checkOffsetCapture(int $flags, string $useFunctionName): void + { + if (($flags & PREG_OFFSET_CAPTURE) !== 0) { + throw new \InvalidArgumentException('PREG_OFFSET_CAPTURE is not supported as it changes the type of $matches, use ' . $useFunctionName . '() instead'); + } + } + + private static function checkSetOrder(int $flags): void + { + if (($flags & PREG_SET_ORDER) !== 0) { + throw new \InvalidArgumentException('PREG_SET_ORDER is not supported as it changes the type of $matches'); + } + } + + /** + * @param array $matches + * @return array + * @throws UnexpectedNullMatchException + */ + private static function enforceNonNullMatches(string $pattern, array $matches, string $variantMethod) + { + foreach ($matches as $group => $match) { + if (null === $match) { + throw new UnexpectedNullMatchException('Pattern "'.$pattern.'" had an unexpected unmatched group "'.$group.'", make sure the pattern always matches or use '.$variantMethod.'() instead.'); + } + } + + /** @var array */ + return $matches; + } + + /** + * @param array> $matches + * @return array> + * @throws UnexpectedNullMatchException + */ + private static function enforceNonNullMatchAll(string $pattern, array $matches, string $variantMethod) + { + foreach ($matches as $group => $groupMatches) { + foreach ($groupMatches as $match) { + if (null === $match) { + throw new UnexpectedNullMatchException('Pattern "'.$pattern.'" had an unexpected unmatched group "'.$group.'", make sure the pattern always matches or use '.$variantMethod.'() instead.'); + } + } + } + + /** @var array> */ + return $matches; + } +} diff --git a/vendor/composer/pcre/src/Regex.php b/vendor/composer/pcre/src/Regex.php new file mode 100644 index 00000000..112fa325 --- /dev/null +++ b/vendor/composer/pcre/src/Regex.php @@ -0,0 +1,174 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\Pcre; + +class Regex +{ + /** + * @param non-empty-string $pattern + */ + public static function isMatch(string $pattern, string $subject, int $offset = 0): bool + { + return (bool) Preg::match($pattern, $subject, $matches, 0, $offset); + } + + /** + * @param non-empty-string $pattern + * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported + */ + public static function match(string $pattern, string $subject, int $flags = 0, int $offset = 0): MatchResult + { + self::checkOffsetCapture($flags, 'matchWithOffsets'); + + $count = Preg::match($pattern, $subject, $matches, $flags, $offset); + + return new MatchResult($count, $matches); + } + + /** + * Variant of `match()` which returns non-null matches (or throws) + * + * @param non-empty-string $pattern + * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported + * @throws UnexpectedNullMatchException + */ + public static function matchStrictGroups(string $pattern, string $subject, int $flags = 0, int $offset = 0): MatchStrictGroupsResult + { + $count = Preg::matchStrictGroups($pattern, $subject, $matches, $flags, $offset); + + return new MatchStrictGroupsResult($count, $matches); + } + + /** + * Runs preg_match with PREG_OFFSET_CAPTURE + * + * @param non-empty-string $pattern + * @param int-mask $flags PREG_UNMATCHED_AS_NULL and PREG_MATCH_OFFSET are always set, no other flags are supported + */ + public static function matchWithOffsets(string $pattern, string $subject, int $flags = 0, int $offset = 0): MatchWithOffsetsResult + { + $count = Preg::matchWithOffsets($pattern, $subject, $matches, $flags, $offset); + + return new MatchWithOffsetsResult($count, $matches); + } + + /** + * @param non-empty-string $pattern + * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported + */ + public static function matchAll(string $pattern, string $subject, int $flags = 0, int $offset = 0): MatchAllResult + { + self::checkOffsetCapture($flags, 'matchAllWithOffsets'); + self::checkSetOrder($flags); + + $count = Preg::matchAll($pattern, $subject, $matches, $flags, $offset); + + return new MatchAllResult($count, $matches); + } + + /** + * Variant of `matchAll()` which returns non-null matches (or throws) + * + * @param non-empty-string $pattern + * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported + * @throws UnexpectedNullMatchException + */ + public static function matchAllStrictGroups(string $pattern, string $subject, int $flags = 0, int $offset = 0): MatchAllStrictGroupsResult + { + self::checkOffsetCapture($flags, 'matchAllWithOffsets'); + self::checkSetOrder($flags); + + $count = Preg::matchAllStrictGroups($pattern, $subject, $matches, $flags, $offset); + + return new MatchAllStrictGroupsResult($count, $matches); + } + + /** + * Runs preg_match_all with PREG_OFFSET_CAPTURE + * + * @param non-empty-string $pattern + * @param int-mask $flags PREG_UNMATCHED_AS_NULL and PREG_MATCH_OFFSET are always set, no other flags are supported + */ + public static function matchAllWithOffsets(string $pattern, string $subject, int $flags = 0, int $offset = 0): MatchAllWithOffsetsResult + { + self::checkSetOrder($flags); + + $count = Preg::matchAllWithOffsets($pattern, $subject, $matches, $flags, $offset); + + return new MatchAllWithOffsetsResult($count, $matches); + } + /** + * @param string|string[] $pattern + * @param string|string[] $replacement + * @param string $subject + */ + public static function replace($pattern, $replacement, $subject, int $limit = -1): ReplaceResult + { + $result = Preg::replace($pattern, $replacement, $subject, $limit, $count); + + return new ReplaceResult($count, $result); + } + + /** + * @param string|string[] $pattern + * @param callable(array): string $replacement + * @param string $subject + * @param int-mask $flags PREG_OFFSET_CAPTURE is supported, PREG_UNMATCHED_AS_NULL is always set + */ + public static function replaceCallback($pattern, callable $replacement, $subject, int $limit = -1, int $flags = 0): ReplaceResult + { + $result = Preg::replaceCallback($pattern, $replacement, $subject, $limit, $count, $flags); + + return new ReplaceResult($count, $result); + } + + /** + * Variant of `replaceCallback()` which outputs non-null matches (or throws) + * + * @param string $pattern + * @param callable(array): string $replacement + * @param string $subject + * @param int-mask $flags PREG_OFFSET_CAPTURE or PREG_UNMATCHED_AS_NULL, only available on PHP 7.4+ + */ + public static function replaceCallbackStrictGroups($pattern, callable $replacement, $subject, int $limit = -1, int $flags = 0): ReplaceResult + { + $result = Preg::replaceCallbackStrictGroups($pattern, $replacement, $subject, $limit, $count, $flags); + + return new ReplaceResult($count, $result); + } + + /** + * @param array): string> $pattern + * @param string $subject + * @param int-mask $flags PREG_OFFSET_CAPTURE is supported, PREG_UNMATCHED_AS_NULL is always set + */ + public static function replaceCallbackArray(array $pattern, $subject, int $limit = -1, int $flags = 0): ReplaceResult + { + $result = Preg::replaceCallbackArray($pattern, $subject, $limit, $count, $flags); + + return new ReplaceResult($count, $result); + } + + private static function checkOffsetCapture(int $flags, string $useFunctionName): void + { + if (($flags & PREG_OFFSET_CAPTURE) !== 0) { + throw new \InvalidArgumentException('PREG_OFFSET_CAPTURE is not supported as it changes the return type, use '.$useFunctionName.'() instead'); + } + } + + private static function checkSetOrder(int $flags): void + { + if (($flags & PREG_SET_ORDER) !== 0) { + throw new \InvalidArgumentException('PREG_SET_ORDER is not supported as it changes the return type'); + } + } +} diff --git a/vendor/composer/pcre/src/ReplaceResult.php b/vendor/composer/pcre/src/ReplaceResult.php new file mode 100644 index 00000000..33847712 --- /dev/null +++ b/vendor/composer/pcre/src/ReplaceResult.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\Pcre; + +final class ReplaceResult +{ + /** + * @readonly + * @var string + */ + public $result; + + /** + * @readonly + * @var 0|positive-int + */ + public $count; + + /** + * @readonly + * @var bool + */ + public $matched; + + /** + * @param 0|positive-int $count + */ + public function __construct(int $count, string $result) + { + $this->count = $count; + $this->matched = (bool) $count; + $this->result = $result; + } +} diff --git a/vendor/composer/pcre/src/UnexpectedNullMatchException.php b/vendor/composer/pcre/src/UnexpectedNullMatchException.php new file mode 100644 index 00000000..f123828b --- /dev/null +++ b/vendor/composer/pcre/src/UnexpectedNullMatchException.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\Pcre; + +class UnexpectedNullMatchException extends PcreException +{ + public static function fromFunction($function, $pattern) + { + throw new \LogicException('fromFunction should not be called on '.self::class.', use '.PcreException::class); + } +} diff --git a/vendor/doctrine/cache/LICENSE b/vendor/doctrine/cache/LICENSE new file mode 100644 index 00000000..8c38cc1b --- /dev/null +++ b/vendor/doctrine/cache/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2006-2015 Doctrine Project + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/doctrine/cache/README.md b/vendor/doctrine/cache/README.md new file mode 100644 index 00000000..a13196d1 --- /dev/null +++ b/vendor/doctrine/cache/README.md @@ -0,0 +1,13 @@ +# Doctrine Cache + +[![Build Status](https://github.com/doctrine/cache/workflows/Continuous%20Integration/badge.svg)](https://github.com/doctrine/cache/actions) +[![Code Coverage](https://codecov.io/gh/doctrine/cache/branch/1.10.x/graph/badge.svg)](https://codecov.io/gh/doctrine/cache/branch/1.10.x) + +[![Latest Stable Version](https://img.shields.io/packagist/v/doctrine/cache.svg?style=flat-square)](https://packagist.org/packages/doctrine/cache) +[![Total Downloads](https://img.shields.io/packagist/dt/doctrine/cache.svg?style=flat-square)](https://packagist.org/packages/doctrine/cache) + +Cache component extracted from the Doctrine Common project. [Documentation](https://www.doctrine-project.org/projects/doctrine-cache/en/current/index.html) + +This library is deprecated and will no longer receive bug fixes from the +Doctrine Project. Please use a different cache library, preferably PSR-6 or +PSR-16 instead. diff --git a/vendor/doctrine/cache/UPGRADE-1.11.md b/vendor/doctrine/cache/UPGRADE-1.11.md new file mode 100644 index 00000000..6c5ddb55 --- /dev/null +++ b/vendor/doctrine/cache/UPGRADE-1.11.md @@ -0,0 +1,27 @@ +# Upgrade to 1.11 + +doctrine/cache will no longer be maintained and all cache implementations have +been marked as deprecated. These implementations will be removed in 2.0, which +will only contain interfaces to provide a lightweight package for backward +compatibility. + +There are two new classes to use in the `Doctrine\Common\Cache\Psr6` namespace: +* The `CacheAdapter` class allows using any Doctrine Cache as PSR-6 cache. This + is useful to provide a forward compatibility layer in libraries that accept + Doctrine cache implementations and switch to PSR-6. +* The `DoctrineProvider` class allows using any PSR-6 cache as Doctrine cache. + This implementation is designed for libraries that leak the cache and want to + switch to allowing PSR-6 implementations. This class is design to be used + during the transition phase of sunsetting doctrine/cache support. + +A full example to setup a filesystem based PSR-6 cache with symfony/cache +using the `DoctrineProvider` to convert back to Doctrine's `Cache` interface: + +```php +use Doctrine\Common\Cache\Psr6\DoctrineProvider; +use Symfony\Component\Cache\Adapter\FilesystemAdapter; + +$cachePool = new FilesystemAdapter(); +$cache = DoctrineProvider::wrap($cachePool); +// $cache instanceof \Doctrine\Common\Cache\Cache +``` diff --git a/vendor/doctrine/cache/UPGRADE-1.4.md b/vendor/doctrine/cache/UPGRADE-1.4.md new file mode 100644 index 00000000..e1f8a503 --- /dev/null +++ b/vendor/doctrine/cache/UPGRADE-1.4.md @@ -0,0 +1,16 @@ +# Upgrade to 1.4 + +## Minor BC Break: `Doctrine\Common\Cache\FileCache#$extension` is now `private`. + +If you need to override the value of `Doctrine\Common\Cache\FileCache#$extension`, then use the +second parameter of `Doctrine\Common\Cache\FileCache#__construct()` instead of overriding +the property in your own implementation. + +## Minor BC Break: file based caches paths changed + +`Doctrine\Common\Cache\FileCache`, `Doctrine\Common\Cache\PhpFileCache` and +`Doctrine\Common\Cache\FilesystemCache` are using a different cache paths structure. + +If you rely on warmed up caches for deployments, consider that caches generated +with `doctrine/cache` `<1.4` are not compatible with the new directory structure, +and will be ignored. diff --git a/vendor/doctrine/cache/composer.json b/vendor/doctrine/cache/composer.json new file mode 100644 index 00000000..3c8ca971 --- /dev/null +++ b/vendor/doctrine/cache/composer.json @@ -0,0 +1,50 @@ +{ + "name": "doctrine/cache", + "type": "library", + "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", + "keywords": [ + "php", + "cache", + "caching", + "abstraction", + "redis", + "memcached", + "couchdb", + "xcache", + "apcu" + ], + "homepage": "https://www.doctrine-project.org/projects/cache.html", + "license": "MIT", + "authors": [ + {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, + {"name": "Roman Borschel", "email": "roman@code-factory.org"}, + {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"}, + {"name": "Jonathan Wage", "email": "jonwage@gmail.com"}, + {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} + ], + "require": { + "php": "~7.1 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "doctrine/coding-standard": "^9", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "cache/integration-tests": "dev-master", + "symfony/cache": "^4.4 || ^5.4 || ^6", + "symfony/var-exporter": "^4.4 || ^5.4 || ^6" + }, + "conflict": { + "doctrine/common": ">2.2,<2.4" + }, + "autoload": { + "psr-4": { "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" } + }, + "autoload-dev": { + "psr-4": { "Doctrine\\Tests\\": "tests/Doctrine/Tests" } + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } + } +} diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php new file mode 100644 index 00000000..4cfab6c0 --- /dev/null +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php @@ -0,0 +1,90 @@ +hits + * Number of keys that have been requested and found present. + * + * - misses + * Number of items that have been requested and not found. + * + * - uptime + * Time that the server is running. + * + * - memory_usage + * Memory used by this server to store items. + * + * - memory_available + * Memory allowed to use for storage. + * + * @return mixed[]|null An associative array with server's statistics if available, NULL otherwise. + */ + public function getStats(); +} diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php new file mode 100644 index 00000000..180482a7 --- /dev/null +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php @@ -0,0 +1,325 @@ +namespace = (string) $namespace; + $this->namespaceVersion = null; + } + + /** + * Retrieves the namespace that prefixes all cache ids. + * + * @return string + */ + public function getNamespace() + { + return $this->namespace; + } + + /** + * {@inheritdoc} + */ + public function fetch($id) + { + return $this->doFetch($this->getNamespacedId($id)); + } + + /** + * {@inheritdoc} + */ + public function fetchMultiple(array $keys) + { + if (empty($keys)) { + return []; + } + + // note: the array_combine() is in place to keep an association between our $keys and the $namespacedKeys + $namespacedKeys = array_combine($keys, array_map([$this, 'getNamespacedId'], $keys)); + $items = $this->doFetchMultiple($namespacedKeys); + $foundItems = []; + + // no internal array function supports this sort of mapping: needs to be iterative + // this filters and combines keys in one pass + foreach ($namespacedKeys as $requestedKey => $namespacedKey) { + if (! isset($items[$namespacedKey]) && ! array_key_exists($namespacedKey, $items)) { + continue; + } + + $foundItems[$requestedKey] = $items[$namespacedKey]; + } + + return $foundItems; + } + + /** + * {@inheritdoc} + */ + public function saveMultiple(array $keysAndValues, $lifetime = 0) + { + $namespacedKeysAndValues = []; + foreach ($keysAndValues as $key => $value) { + $namespacedKeysAndValues[$this->getNamespacedId($key)] = $value; + } + + return $this->doSaveMultiple($namespacedKeysAndValues, $lifetime); + } + + /** + * {@inheritdoc} + */ + public function contains($id) + { + return $this->doContains($this->getNamespacedId($id)); + } + + /** + * {@inheritdoc} + */ + public function save($id, $data, $lifeTime = 0) + { + return $this->doSave($this->getNamespacedId($id), $data, $lifeTime); + } + + /** + * {@inheritdoc} + */ + public function deleteMultiple(array $keys) + { + return $this->doDeleteMultiple(array_map([$this, 'getNamespacedId'], $keys)); + } + + /** + * {@inheritdoc} + */ + public function delete($id) + { + return $this->doDelete($this->getNamespacedId($id)); + } + + /** + * {@inheritdoc} + */ + public function getStats() + { + return $this->doGetStats(); + } + + /** + * {@inheritDoc} + */ + public function flushAll() + { + return $this->doFlush(); + } + + /** + * {@inheritDoc} + */ + public function deleteAll() + { + $namespaceCacheKey = $this->getNamespaceCacheKey(); + $namespaceVersion = $this->getNamespaceVersion() + 1; + + if ($this->doSave($namespaceCacheKey, $namespaceVersion)) { + $this->namespaceVersion = $namespaceVersion; + + return true; + } + + return false; + } + + /** + * Prefixes the passed id with the configured namespace value. + * + * @param string $id The id to namespace. + * + * @return string The namespaced id. + */ + private function getNamespacedId(string $id): string + { + $namespaceVersion = $this->getNamespaceVersion(); + + return sprintf('%s[%s][%s]', $this->namespace, $id, $namespaceVersion); + } + + /** + * Returns the namespace cache key. + */ + private function getNamespaceCacheKey(): string + { + return sprintf(self::DOCTRINE_NAMESPACE_CACHEKEY, $this->namespace); + } + + /** + * Returns the namespace version. + */ + private function getNamespaceVersion(): int + { + if ($this->namespaceVersion !== null) { + return $this->namespaceVersion; + } + + $namespaceCacheKey = $this->getNamespaceCacheKey(); + $this->namespaceVersion = (int) $this->doFetch($namespaceCacheKey) ?: 1; + + return $this->namespaceVersion; + } + + /** + * Default implementation of doFetchMultiple. Each driver that supports multi-get should owerwrite it. + * + * @param string[] $keys Array of keys to retrieve from cache + * + * @return mixed[] Array of values retrieved for the given keys. + */ + protected function doFetchMultiple(array $keys) + { + $returnValues = []; + + foreach ($keys as $key) { + $item = $this->doFetch($key); + if ($item === false && ! $this->doContains($key)) { + continue; + } + + $returnValues[$key] = $item; + } + + return $returnValues; + } + + /** + * Fetches an entry from the cache. + * + * @param string $id The id of the cache entry to fetch. + * + * @return mixed|false The cached data or FALSE, if no cache entry exists for the given id. + */ + abstract protected function doFetch($id); + + /** + * Tests if an entry exists in the cache. + * + * @param string $id The cache id of the entry to check for. + * + * @return bool TRUE if a cache entry exists for the given cache id, FALSE otherwise. + */ + abstract protected function doContains($id); + + /** + * Default implementation of doSaveMultiple. Each driver that supports multi-put should override it. + * + * @param mixed[] $keysAndValues Array of keys and values to save in cache + * @param int $lifetime The lifetime. If != 0, sets a specific lifetime for these + * cache entries (0 => infinite lifeTime). + * + * @return bool TRUE if the operation was successful, FALSE if it wasn't. + */ + protected function doSaveMultiple(array $keysAndValues, $lifetime = 0) + { + $success = true; + + foreach ($keysAndValues as $key => $value) { + if ($this->doSave($key, $value, $lifetime)) { + continue; + } + + $success = false; + } + + return $success; + } + + /** + * Puts data into the cache. + * + * @param string $id The cache id. + * @param string $data The cache entry/data. + * @param int $lifeTime The lifetime. If != 0, sets a specific lifetime for this + * cache entry (0 => infinite lifeTime). + * + * @return bool TRUE if the entry was successfully stored in the cache, FALSE otherwise. + */ + abstract protected function doSave($id, $data, $lifeTime = 0); + + /** + * Default implementation of doDeleteMultiple. Each driver that supports multi-delete should override it. + * + * @param string[] $keys Array of keys to delete from cache + * + * @return bool TRUE if the operation was successful, FALSE if it wasn't + */ + protected function doDeleteMultiple(array $keys) + { + $success = true; + + foreach ($keys as $key) { + if ($this->doDelete($key)) { + continue; + } + + $success = false; + } + + return $success; + } + + /** + * Deletes a cache entry. + * + * @param string $id The cache id. + * + * @return bool TRUE if the cache entry was successfully deleted, FALSE otherwise. + */ + abstract protected function doDelete($id); + + /** + * Flushes all cache entries. + * + * @return bool TRUE if the cache entries were successfully flushed, FALSE otherwise. + */ + abstract protected function doFlush(); + + /** + * Retrieves cached information from the data store. + * + * @return mixed[]|null An associative array with server's statistics if available, NULL otherwise. + */ + abstract protected function doGetStats(); +} diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ClearableCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ClearableCache.php new file mode 100644 index 00000000..b94618e4 --- /dev/null +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ClearableCache.php @@ -0,0 +1,21 @@ + infinite lifeTime). + * + * @return bool TRUE if the operation was successful, FALSE if it wasn't. + */ + public function saveMultiple(array $keysAndValues, $lifetime = 0); +} diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheAdapter.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheAdapter.php new file mode 100644 index 00000000..d3693b7c --- /dev/null +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheAdapter.php @@ -0,0 +1,340 @@ + */ + private $deferredItems = []; + + public static function wrap(Cache $cache): CacheItemPoolInterface + { + if ($cache instanceof DoctrineProvider && ! $cache->getNamespace()) { + return $cache->getPool(); + } + + if ($cache instanceof SymfonyDoctrineProvider && ! $cache->getNamespace()) { + $getPool = function () { + // phpcs:ignore Squiz.Scope.StaticThisUsage.Found + return $this->pool; + }; + + return $getPool->bindTo($cache, SymfonyDoctrineProvider::class)(); + } + + return new self($cache); + } + + private function __construct(Cache $cache) + { + $this->cache = $cache; + } + + /** @internal */ + public function getCache(): Cache + { + return $this->cache; + } + + /** + * {@inheritDoc} + */ + public function getItem($key): CacheItemInterface + { + assert(self::validKey($key)); + + if (isset($this->deferredItems[$key])) { + $this->commit(); + } + + $value = $this->cache->fetch($key); + + if (PHP_VERSION_ID >= 80000) { + if ($value !== false) { + return new TypedCacheItem($key, $value, true); + } + + return new TypedCacheItem($key, null, false); + } + + if ($value !== false) { + return new CacheItem($key, $value, true); + } + + return new CacheItem($key, null, false); + } + + /** + * {@inheritDoc} + */ + public function getItems(array $keys = []): array + { + if ($this->deferredItems) { + $this->commit(); + } + + assert(self::validKeys($keys)); + + $values = $this->doFetchMultiple($keys); + $items = []; + + if (PHP_VERSION_ID >= 80000) { + foreach ($keys as $key) { + if (array_key_exists($key, $values)) { + $items[$key] = new TypedCacheItem($key, $values[$key], true); + } else { + $items[$key] = new TypedCacheItem($key, null, false); + } + } + + return $items; + } + + foreach ($keys as $key) { + if (array_key_exists($key, $values)) { + $items[$key] = new CacheItem($key, $values[$key], true); + } else { + $items[$key] = new CacheItem($key, null, false); + } + } + + return $items; + } + + /** + * {@inheritDoc} + */ + public function hasItem($key): bool + { + assert(self::validKey($key)); + + if (isset($this->deferredItems[$key])) { + $this->commit(); + } + + return $this->cache->contains($key); + } + + public function clear(): bool + { + $this->deferredItems = []; + + if (! $this->cache instanceof ClearableCache) { + return false; + } + + return $this->cache->deleteAll(); + } + + /** + * {@inheritDoc} + */ + public function deleteItem($key): bool + { + assert(self::validKey($key)); + unset($this->deferredItems[$key]); + + return $this->cache->delete($key); + } + + /** + * {@inheritDoc} + */ + public function deleteItems(array $keys): bool + { + foreach ($keys as $key) { + assert(self::validKey($key)); + unset($this->deferredItems[$key]); + } + + return $this->doDeleteMultiple($keys); + } + + public function save(CacheItemInterface $item): bool + { + return $this->saveDeferred($item) && $this->commit(); + } + + public function saveDeferred(CacheItemInterface $item): bool + { + if (! $item instanceof CacheItem && ! $item instanceof TypedCacheItem) { + return false; + } + + $this->deferredItems[$item->getKey()] = $item; + + return true; + } + + public function commit(): bool + { + if (! $this->deferredItems) { + return true; + } + + $now = microtime(true); + $itemsCount = 0; + $byLifetime = []; + $expiredKeys = []; + + foreach ($this->deferredItems as $key => $item) { + $lifetime = ($item->getExpiry() ?? $now) - $now; + + if ($lifetime < 0) { + $expiredKeys[] = $key; + + continue; + } + + ++$itemsCount; + $byLifetime[(int) $lifetime][$key] = $item->get(); + } + + $this->deferredItems = []; + + switch (count($expiredKeys)) { + case 0: + break; + case 1: + $this->cache->delete(current($expiredKeys)); + break; + default: + $this->doDeleteMultiple($expiredKeys); + break; + } + + if ($itemsCount === 1) { + return $this->cache->save($key, $item->get(), (int) $lifetime); + } + + $success = true; + foreach ($byLifetime as $lifetime => $values) { + $success = $this->doSaveMultiple($values, $lifetime) && $success; + } + + return $success; + } + + public function __destruct() + { + $this->commit(); + } + + /** + * @param mixed $key + */ + private static function validKey($key): bool + { + if (! is_string($key)) { + throw new InvalidArgument(sprintf('Cache key must be string, "%s" given.', is_object($key) ? get_class($key) : gettype($key))); + } + + if ($key === '') { + throw new InvalidArgument('Cache key length must be greater than zero.'); + } + + if (strpbrk($key, self::RESERVED_CHARACTERS) !== false) { + throw new InvalidArgument(sprintf('Cache key "%s" contains reserved characters "%s".', $key, self::RESERVED_CHARACTERS)); + } + + return true; + } + + /** + * @param mixed[] $keys + */ + private static function validKeys(array $keys): bool + { + foreach ($keys as $key) { + self::validKey($key); + } + + return true; + } + + /** + * @param mixed[] $keys + */ + private function doDeleteMultiple(array $keys): bool + { + if ($this->cache instanceof MultiDeleteCache) { + return $this->cache->deleteMultiple($keys); + } + + $success = true; + foreach ($keys as $key) { + $success = $this->cache->delete($key) && $success; + } + + return $success; + } + + /** + * @param mixed[] $keys + * + * @return mixed[] + */ + private function doFetchMultiple(array $keys): array + { + if ($this->cache instanceof MultiGetCache) { + return $this->cache->fetchMultiple($keys); + } + + $values = []; + foreach ($keys as $key) { + $value = $this->cache->fetch($key); + if (! $value) { + continue; + } + + $values[$key] = $value; + } + + return $values; + } + + /** + * @param mixed[] $keysAndValues + */ + private function doSaveMultiple(array $keysAndValues, int $lifetime = 0): bool + { + if ($this->cache instanceof MultiPutCache) { + return $this->cache->saveMultiple($keysAndValues, $lifetime); + } + + $success = true; + foreach ($keysAndValues as $key => $value) { + $success = $this->cache->save($key, $value, $lifetime) && $success; + } + + return $success; + } +} diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheItem.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheItem.php new file mode 100644 index 00000000..0b6f0a28 --- /dev/null +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheItem.php @@ -0,0 +1,118 @@ +key = $key; + $this->value = $data; + $this->isHit = $isHit; + } + + public function getKey(): string + { + return $this->key; + } + + /** + * {@inheritDoc} + * + * @return mixed + */ + public function get() + { + return $this->value; + } + + public function isHit(): bool + { + return $this->isHit; + } + + /** + * {@inheritDoc} + */ + public function set($value): self + { + $this->value = $value; + + return $this; + } + + /** + * {@inheritDoc} + */ + public function expiresAt($expiration): self + { + if ($expiration === null) { + $this->expiry = null; + } elseif ($expiration instanceof DateTimeInterface) { + $this->expiry = (float) $expiration->format('U.u'); + } else { + throw new TypeError(sprintf( + 'Expected $expiration to be an instance of DateTimeInterface or null, got %s', + is_object($expiration) ? get_class($expiration) : gettype($expiration) + )); + } + + return $this; + } + + /** + * {@inheritDoc} + */ + public function expiresAfter($time): self + { + if ($time === null) { + $this->expiry = null; + } elseif ($time instanceof DateInterval) { + $this->expiry = microtime(true) + DateTime::createFromFormat('U', 0)->add($time)->format('U.u'); + } elseif (is_int($time)) { + $this->expiry = $time + microtime(true); + } else { + throw new TypeError(sprintf( + 'Expected $time to be either an integer, an instance of DateInterval or null, got %s', + is_object($time) ? get_class($time) : gettype($time) + )); + } + + return $this; + } + + /** + * @internal + */ + public function getExpiry(): ?float + { + return $this->expiry; + } +} diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/DoctrineProvider.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/DoctrineProvider.php new file mode 100644 index 00000000..3b0f416c --- /dev/null +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/DoctrineProvider.php @@ -0,0 +1,135 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Doctrine\Common\Cache\Psr6; + +use Doctrine\Common\Cache\Cache; +use Doctrine\Common\Cache\CacheProvider; +use Psr\Cache\CacheItemPoolInterface; +use Symfony\Component\Cache\Adapter\DoctrineAdapter as SymfonyDoctrineAdapter; +use Symfony\Contracts\Service\ResetInterface; + +use function rawurlencode; + +/** + * This class was copied from the Symfony Framework, see the original copyright + * notice above. The code is distributed subject to the license terms in + * https://github.com/symfony/symfony/blob/ff0cf61278982539c49e467db9ab13cbd342f76d/LICENSE + */ +final class DoctrineProvider extends CacheProvider +{ + /** @var CacheItemPoolInterface */ + private $pool; + + public static function wrap(CacheItemPoolInterface $pool): Cache + { + if ($pool instanceof CacheAdapter) { + return $pool->getCache(); + } + + if ($pool instanceof SymfonyDoctrineAdapter) { + $getCache = function () { + // phpcs:ignore Squiz.Scope.StaticThisUsage.Found + return $this->provider; + }; + + return $getCache->bindTo($pool, SymfonyDoctrineAdapter::class)(); + } + + return new self($pool); + } + + private function __construct(CacheItemPoolInterface $pool) + { + $this->pool = $pool; + } + + /** @internal */ + public function getPool(): CacheItemPoolInterface + { + return $this->pool; + } + + public function reset(): void + { + if ($this->pool instanceof ResetInterface) { + $this->pool->reset(); + } + + $this->setNamespace($this->getNamespace()); + } + + /** + * {@inheritdoc} + */ + protected function doFetch($id) + { + $item = $this->pool->getItem(rawurlencode($id)); + + return $item->isHit() ? $item->get() : false; + } + + /** + * {@inheritdoc} + * + * @return bool + */ + protected function doContains($id) + { + return $this->pool->hasItem(rawurlencode($id)); + } + + /** + * {@inheritdoc} + * + * @return bool + */ + protected function doSave($id, $data, $lifeTime = 0) + { + $item = $this->pool->getItem(rawurlencode($id)); + + if (0 < $lifeTime) { + $item->expiresAfter($lifeTime); + } + + return $this->pool->save($item->set($data)); + } + + /** + * {@inheritdoc} + * + * @return bool + */ + protected function doDelete($id) + { + return $this->pool->deleteItem(rawurlencode($id)); + } + + /** + * {@inheritdoc} + * + * @return bool + */ + protected function doFlush() + { + return $this->pool->clear(); + } + + /** + * {@inheritdoc} + * + * @return array|null + */ + protected function doGetStats() + { + return null; + } +} diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/InvalidArgument.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/InvalidArgument.php new file mode 100644 index 00000000..196f1bca --- /dev/null +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/InvalidArgument.php @@ -0,0 +1,13 @@ +key; + } + + public function get(): mixed + { + return $this->value; + } + + public function isHit(): bool + { + return $this->isHit; + } + + public function set(mixed $value): static + { + $this->value = $value; + + return $this; + } + + /** + * {@inheritDoc} + */ + public function expiresAt($expiration): static + { + if ($expiration === null) { + $this->expiry = null; + } elseif ($expiration instanceof DateTimeInterface) { + $this->expiry = (float) $expiration->format('U.u'); + } else { + throw new TypeError(sprintf( + 'Expected $expiration to be an instance of DateTimeInterface or null, got %s', + get_debug_type($expiration) + )); + } + + return $this; + } + + /** + * {@inheritDoc} + */ + public function expiresAfter($time): static + { + if ($time === null) { + $this->expiry = null; + } elseif ($time instanceof DateInterval) { + $this->expiry = microtime(true) + DateTime::createFromFormat('U', 0)->add($time)->format('U.u'); + } elseif (is_int($time)) { + $this->expiry = $time + microtime(true); + } else { + throw new TypeError(sprintf( + 'Expected $time to be either an integer, an instance of DateInterval or null, got %s', + get_debug_type($time) + )); + } + + return $this; + } + + /** + * @internal + */ + public function getExpiry(): ?float + { + return $this->expiry; + } +} diff --git a/vendor/doctrine/dbal/CONTRIBUTING.md b/vendor/doctrine/dbal/CONTRIBUTING.md new file mode 100644 index 00000000..c2555ebb --- /dev/null +++ b/vendor/doctrine/dbal/CONTRIBUTING.md @@ -0,0 +1,4 @@ +Doctrine has [general contributing guidelines][contributor workflow], make +sure you follow them. + +[contributor workflow]: https://www.doctrine-project.org/contribute/index.html diff --git a/vendor/doctrine/dbal/LICENSE b/vendor/doctrine/dbal/LICENSE new file mode 100644 index 00000000..e8fdec4a --- /dev/null +++ b/vendor/doctrine/dbal/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2006-2018 Doctrine Project + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/doctrine/dbal/README.md b/vendor/doctrine/dbal/README.md new file mode 100644 index 00000000..76810775 --- /dev/null +++ b/vendor/doctrine/dbal/README.md @@ -0,0 +1,34 @@ +# Doctrine DBAL + +| [4.0-dev][4.0] | [3.5][3.5] | +|:-----------------------------------------------:|:---------------------------------------------------:| +| [![GitHub Actions][GA 4.0 image]][GA 4.0] | [![GitHub Actions][GA 3.5 image]][GA 3.5] | +| [![AppVeyor][AppVeyor 4.0 image]][AppVeyor 4.0] | [![AppVeyor][AppVeyor 3.5 image]][AppVeyor 3.5] | +| [![Code Coverage][Coverage image]][CodeCov 4.0] | [![Code Coverage][Coverage 3.5 image]][CodeCov 3.5] | +| N/A | [![Code Coverage][TypeCov 3.5 image]][TypeCov 3.5] | + +Powerful ***D***ata***B***ase ***A***bstraction ***L***ayer with many features for database schema introspection and schema management. + +## More resources: + +* [Website](http://www.doctrine-project.org/projects/dbal.html) +* [Documentation](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/) +* [Issue Tracker](https://github.com/doctrine/dbal/issues) + + [Coverage image]: https://codecov.io/gh/doctrine/dbal/branch/4.0.x/graph/badge.svg + [4.0]: https://github.com/doctrine/dbal/tree/4.0.x + [CodeCov 4.0]: https://codecov.io/gh/doctrine/dbal/branch/4.0.x + [AppVeyor 4.0]: https://ci.appveyor.com/project/doctrine/dbal/branch/4.0.x + [AppVeyor 4.0 image]: https://ci.appveyor.com/api/projects/status/i88kitq8qpbm0vie/branch/4.0.x?svg=true + [GA 4.0]: https://github.com/doctrine/dbal/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A4.0.x + [GA 4.0 image]: https://github.com/doctrine/dbal/workflows/Continuous%20Integration/badge.svg + + [Coverage 3.5 image]: https://codecov.io/gh/doctrine/dbal/branch/3.5.x/graph/badge.svg + [3.5]: https://github.com/doctrine/dbal/tree/3.5.x + [CodeCov 3.5]: https://codecov.io/gh/doctrine/dbal/branch/3.5.x + [AppVeyor 3.5]: https://ci.appveyor.com/project/doctrine/dbal/branch/3.5.x + [AppVeyor 3.5 image]: https://ci.appveyor.com/api/projects/status/i88kitq8qpbm0vie/branch/3.5.x?svg=true + [GA 3.5]: https://github.com/doctrine/dbal/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A3.5.x + [GA 3.5 image]: https://github.com/doctrine/dbal/workflows/Continuous%20Integration/badge.svg?branch=3.5.x + [TypeCov 3.5]: https://shepherd.dev/github/doctrine/dbal + [TypeCov 3.5 image]: https://shepherd.dev/github/doctrine/dbal/coverage.svg diff --git a/vendor/doctrine/dbal/bin/doctrine-dbal b/vendor/doctrine/dbal/bin/doctrine-dbal new file mode 100755 index 00000000..0531527d --- /dev/null +++ b/vendor/doctrine/dbal/bin/doctrine-dbal @@ -0,0 +1,4 @@ +#!/usr/bin/env php +> */ + private array $data; + + private int $columnCount = 0; + private int $num = 0; + + /** @param list> $data */ + public function __construct(array $data) + { + $this->data = $data; + if (count($data) === 0) { + return; + } + + $this->columnCount = count($data[0]); + } + + /** + * {@inheritdoc} + */ + public function fetchNumeric() + { + $row = $this->fetch(); + + if ($row === false) { + return false; + } + + return array_values($row); + } + + /** + * {@inheritdoc} + */ + public function fetchAssociative() + { + return $this->fetch(); + } + + /** + * {@inheritdoc} + */ + public function fetchOne() + { + $row = $this->fetch(); + + if ($row === false) { + return false; + } + + return reset($row); + } + + /** + * {@inheritdoc} + */ + public function fetchAllNumeric(): array + { + return FetchUtils::fetchAllNumeric($this); + } + + /** + * {@inheritdoc} + */ + public function fetchAllAssociative(): array + { + return FetchUtils::fetchAllAssociative($this); + } + + /** + * {@inheritdoc} + */ + public function fetchFirstColumn(): array + { + return FetchUtils::fetchFirstColumn($this); + } + + public function rowCount(): int + { + return count($this->data); + } + + public function columnCount(): int + { + return $this->columnCount; + } + + public function free(): void + { + $this->data = []; + } + + /** @return array|false */ + private function fetch() + { + if (! isset($this->data[$this->num])) { + return false; + } + + return $this->data[$this->num++]; + } +} diff --git a/vendor/doctrine/dbal/src/Cache/CacheException.php b/vendor/doctrine/dbal/src/Cache/CacheException.php new file mode 100644 index 00000000..18e95d6b --- /dev/null +++ b/vendor/doctrine/dbal/src/Cache/CacheException.php @@ -0,0 +1,21 @@ +lifetime = $lifetime; + $this->cacheKey = $cacheKey; + if ($resultCache instanceof CacheItemPoolInterface) { + $this->resultCache = $resultCache; + } elseif ($resultCache instanceof Cache) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4620', + 'Passing an instance of %s to %s as $resultCache is deprecated. Pass an instance of %s instead.', + Cache::class, + __METHOD__, + CacheItemPoolInterface::class, + ); + + $this->resultCache = CacheAdapter::wrap($resultCache); + } elseif ($resultCache !== null) { + throw new TypeError(sprintf( + '$resultCache: Expected either null or an instance of %s or %s, got %s.', + CacheItemPoolInterface::class, + Cache::class, + get_class($resultCache), + )); + } + } + + public function getResultCache(): ?CacheItemPoolInterface + { + return $this->resultCache; + } + + /** + * @deprecated Use {@see getResultCache()} instead. + * + * @return Cache|null + */ + public function getResultCacheDriver() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4620', + '%s is deprecated, call getResultCache() instead.', + __METHOD__, + ); + + return $this->resultCache !== null ? DoctrineProvider::wrap($this->resultCache) : null; + } + + /** @return int */ + public function getLifetime() + { + return $this->lifetime; + } + + /** + * @return string + * + * @throws CacheException + */ + public function getCacheKey() + { + if ($this->cacheKey === null) { + throw CacheException::noCacheKey(); + } + + return $this->cacheKey; + } + + /** + * Generates the real cache key from query, params, types and connection parameters. + * + * @param string $sql + * @param list|array $params + * @param array|array $types + * @param array $connectionParams + * + * @return string[] + */ + public function generateCacheKeys($sql, $params, $types, array $connectionParams = []) + { + if (isset($connectionParams['password'])) { + unset($connectionParams['password']); + } + + $realCacheKey = 'query=' . $sql . + '¶ms=' . serialize($params) . + '&types=' . serialize($types) . + '&connectionParams=' . hash('sha256', serialize($connectionParams)); + + // should the key be automatically generated using the inputs or is the cache key set? + if ($this->cacheKey === null) { + $cacheKey = sha1($realCacheKey); + } else { + $cacheKey = $this->cacheKey; + } + + return [$cacheKey, $realCacheKey]; + } + + public function setResultCache(CacheItemPoolInterface $cache): QueryCacheProfile + { + return new QueryCacheProfile($this->lifetime, $this->cacheKey, $cache); + } + + /** + * @deprecated Use {@see setResultCache()} instead. + * + * @return QueryCacheProfile + */ + public function setResultCacheDriver(Cache $cache) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4620', + '%s is deprecated, call setResultCache() instead.', + __METHOD__, + ); + + return new QueryCacheProfile($this->lifetime, $this->cacheKey, CacheAdapter::wrap($cache)); + } + + /** + * @param string|null $cacheKey + * + * @return QueryCacheProfile + */ + public function setCacheKey($cacheKey) + { + return new QueryCacheProfile($this->lifetime, $cacheKey, $this->resultCache); + } + + /** + * @param int $lifetime + * + * @return QueryCacheProfile + */ + public function setLifetime($lifetime) + { + return new QueryCacheProfile($lifetime, $this->cacheKey, $this->resultCache); + } +} diff --git a/vendor/doctrine/dbal/src/ColumnCase.php b/vendor/doctrine/dbal/src/ColumnCase.php new file mode 100644 index 00000000..cb0dd409 --- /dev/null +++ b/vendor/doctrine/dbal/src/ColumnCase.php @@ -0,0 +1,28 @@ +schemaAssetsFilter = static function (): bool { + return true; + }; + } + + /** + * Sets the SQL logger to use. Defaults to NULL which means SQL logging is disabled. + * + * @deprecated Use {@see setMiddlewares()} and {@see \Doctrine\DBAL\Logging\Middleware} instead. + */ + public function setSQLLogger(?SQLLogger $logger = null): void + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4967', + '%s is deprecated, use setMiddlewares() and Logging\\Middleware instead.', + __METHOD__, + ); + + $this->sqlLogger = $logger; + } + + /** + * Gets the SQL logger that is used. + * + * @deprecated + */ + public function getSQLLogger(): ?SQLLogger + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4967', + '%s is deprecated.', + __METHOD__, + ); + + return $this->sqlLogger; + } + + /** + * Gets the cache driver implementation that is used for query result caching. + */ + public function getResultCache(): ?CacheItemPoolInterface + { + return $this->resultCache; + } + + /** + * Gets the cache driver implementation that is used for query result caching. + * + * @deprecated Use {@see getResultCache()} instead. + */ + public function getResultCacheImpl(): ?Cache + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4620', + '%s is deprecated, call getResultCache() instead.', + __METHOD__, + ); + + return $this->resultCacheImpl; + } + + /** + * Sets the cache driver implementation that is used for query result caching. + */ + public function setResultCache(CacheItemPoolInterface $cache): void + { + $this->resultCacheImpl = DoctrineProvider::wrap($cache); + $this->resultCache = $cache; + } + + /** + * Sets the cache driver implementation that is used for query result caching. + * + * @deprecated Use {@see setResultCache()} instead. + */ + public function setResultCacheImpl(Cache $cacheImpl): void + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4620', + '%s is deprecated, call setResultCache() instead.', + __METHOD__, + ); + + $this->resultCacheImpl = $cacheImpl; + $this->resultCache = CacheAdapter::wrap($cacheImpl); + } + + /** + * Sets the callable to use to filter schema assets. + */ + public function setSchemaAssetsFilter(?callable $callable = null): void + { + if (func_num_args() < 1) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5483', + 'Not passing an argument to %s is deprecated.', + __METHOD__, + ); + } elseif ($callable === null) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5483', + 'Using NULL as a schema asset filter is deprecated.' + . ' Use a callable that always returns true instead.', + ); + } + + $this->schemaAssetsFilter = $callable; + } + + /** + * Returns the callable to use to filter schema assets. + */ + public function getSchemaAssetsFilter(): ?callable + { + return $this->schemaAssetsFilter; + } + + /** + * Sets the default auto-commit mode for connections. + * + * If a connection is in auto-commit mode, then all its SQL statements will be executed and committed as individual + * transactions. Otherwise, its SQL statements are grouped into transactions that are terminated by a call to either + * the method commit or the method rollback. By default, new connections are in auto-commit mode. + * + * @see getAutoCommit + * + * @param bool $autoCommit True to enable auto-commit mode; false to disable it + */ + public function setAutoCommit(bool $autoCommit): void + { + $this->autoCommit = $autoCommit; + } + + /** + * Returns the default auto-commit mode for connections. + * + * @see setAutoCommit + * + * @return bool True if auto-commit mode is enabled by default for connections, false otherwise. + */ + public function getAutoCommit(): bool + { + return $this->autoCommit; + } + + /** + * @param Middleware[] $middlewares + * + * @return $this + */ + public function setMiddlewares(array $middlewares): self + { + $this->middlewares = $middlewares; + + return $this; + } + + /** @return Middleware[] */ + public function getMiddlewares(): array + { + return $this->middlewares; + } +} diff --git a/vendor/doctrine/dbal/src/Connection.php b/vendor/doctrine/dbal/src/Connection.php new file mode 100644 index 00000000..364df9a9 --- /dev/null +++ b/vendor/doctrine/dbal/src/Connection.php @@ -0,0 +1,1949 @@ + + * @psalm-var Params + */ + private array $params; + + /** + * The database platform object used by the connection or NULL before it's initialized. + */ + private ?AbstractPlatform $platform = null; + + private ?ExceptionConverter $exceptionConverter = null; + private ?Parser $parser = null; + + /** + * The schema manager. + * + * @deprecated Use {@see createSchemaManager()} instead. + * + * @var AbstractSchemaManager|null + */ + protected $_schemaManager; + + /** + * The used DBAL driver. + * + * @var Driver + */ + protected $_driver; + + /** + * Flag that indicates whether the current transaction is marked for rollback only. + */ + private bool $isRollbackOnly = false; + + /** + * Initializes a new instance of the Connection class. + * + * @internal The connection can be only instantiated by the driver manager. + * + * @param array $params The connection parameters. + * @param Driver $driver The driver to use. + * @param Configuration|null $config The configuration, optional. + * @param EventManager|null $eventManager The event manager, optional. + * @psalm-param Params $params + * @phpstan-param array $params + * + * @throws Exception + */ + public function __construct( + array $params, + Driver $driver, + ?Configuration $config = null, + ?EventManager $eventManager = null + ) { + $this->_driver = $driver; + $this->params = $params; + + // Create default config and event manager if none given + $config ??= new Configuration(); + $eventManager ??= new EventManager(); + + $this->_config = $config; + $this->_eventManager = $eventManager; + + if (isset($params['platform'])) { + if (! $params['platform'] instanceof Platforms\AbstractPlatform) { + throw Exception::invalidPlatformType($params['platform']); + } + + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5699', + 'The "platform" connection parameter is deprecated.' + . ' Use a driver middleware that would instantiate the platform instead.', + ); + + $this->platform = $params['platform']; + $this->platform->setEventManager($this->_eventManager); + } + + $this->_expr = $this->createExpressionBuilder(); + + $this->autoCommit = $config->getAutoCommit(); + } + + /** + * Gets the parameters used during instantiation. + * + * @internal + * + * @return array + * @psalm-return Params + */ + public function getParams() + { + return $this->params; + } + + /** + * Gets the name of the currently selected database. + * + * @return string|null The name of the database or NULL if a database is not selected. + * The platforms which don't support the concept of a database (e.g. embedded databases) + * must always return a string as an indicator of an implicitly selected database. + * + * @throws Exception + */ + public function getDatabase() + { + $platform = $this->getDatabasePlatform(); + $query = $platform->getDummySelectSQL($platform->getCurrentDatabaseExpression()); + $database = $this->fetchOne($query); + + assert(is_string($database) || $database === null); + + return $database; + } + + /** + * Gets the DBAL driver instance. + * + * @return Driver + */ + public function getDriver() + { + return $this->_driver; + } + + /** + * Gets the Configuration used by the Connection. + * + * @return Configuration + */ + public function getConfiguration() + { + return $this->_config; + } + + /** + * Gets the EventManager used by the Connection. + * + * @deprecated + * + * @return EventManager + */ + public function getEventManager() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/5784', + '%s is deprecated.', + __METHOD__, + ); + + return $this->_eventManager; + } + + /** + * Gets the DatabasePlatform for the connection. + * + * @return AbstractPlatform + * + * @throws Exception + */ + public function getDatabasePlatform() + { + if ($this->platform === null) { + $this->platform = $this->detectDatabasePlatform(); + $this->platform->setEventManager($this->_eventManager); + } + + return $this->platform; + } + + /** + * Creates an expression builder for the connection. + */ + public function createExpressionBuilder(): ExpressionBuilder + { + return new ExpressionBuilder($this); + } + + /** + * Gets the ExpressionBuilder for the connection. + * + * @deprecated Use {@see createExpressionBuilder()} instead. + * + * @return ExpressionBuilder + */ + public function getExpressionBuilder() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4515', + 'Connection::getExpressionBuilder() is deprecated,' + . ' use Connection::createExpressionBuilder() instead.', + ); + + return $this->_expr; + } + + /** + * Establishes the connection with the database. + * + * @internal This method will be made protected in DBAL 4.0. + * + * @return bool TRUE if the connection was successfully established, FALSE if + * the connection is already open. + * + * @throws Exception + */ + public function connect() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4966', + 'Public access to Connection::connect() is deprecated.', + ); + + if ($this->_conn !== null) { + return false; + } + + try { + $this->_conn = $this->_driver->connect($this->params); + } catch (Driver\Exception $e) { + throw $this->convertException($e); + } + + if ($this->autoCommit === false) { + $this->beginTransaction(); + } + + if ($this->_eventManager->hasListeners(Events::postConnect)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/5784', + 'Subscribing to %s events is deprecated. Implement a middleware instead.', + Events::postConnect, + ); + + $eventArgs = new Event\ConnectionEventArgs($this); + $this->_eventManager->dispatchEvent(Events::postConnect, $eventArgs); + } + + return true; + } + + /** + * Detects and sets the database platform. + * + * Evaluates custom platform class and version in order to set the correct platform. + * + * @throws Exception If an invalid platform was specified for this connection. + */ + private function detectDatabasePlatform(): AbstractPlatform + { + $version = $this->getDatabasePlatformVersion(); + + if ($version !== null) { + assert($this->_driver instanceof VersionAwarePlatformDriver); + + return $this->_driver->createDatabasePlatformForVersion($version); + } + + return $this->_driver->getDatabasePlatform(); + } + + /** + * Returns the version of the related platform if applicable. + * + * Returns null if either the driver is not capable to create version + * specific platform instances, no explicit server version was specified + * or the underlying driver connection cannot determine the platform + * version without having to query it (performance reasons). + * + * @return string|null + * + * @throws Throwable + */ + private function getDatabasePlatformVersion() + { + // Driver does not support version specific platforms. + if (! $this->_driver instanceof VersionAwarePlatformDriver) { + return null; + } + + // Explicit platform version requested (supersedes auto-detection). + if (isset($this->params['serverVersion'])) { + return $this->params['serverVersion']; + } + + // If not connected, we need to connect now to determine the platform version. + if ($this->_conn === null) { + try { + $this->connect(); + } catch (Exception $originalException) { + if (! isset($this->params['dbname'])) { + throw $originalException; + } + + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5707', + 'Relying on a fallback connection used to determine the database platform while connecting' + . ' to a non-existing database is deprecated. Either use an existing database name in' + . ' connection parameters or omit the database name if the platform' + . ' and the server configuration allow that.', + ); + + // The database to connect to might not yet exist. + // Retry detection without database name connection parameter. + $params = $this->params; + + unset($this->params['dbname']); + + try { + $this->connect(); + } catch (Exception $fallbackException) { + // Either the platform does not support database-less connections + // or something else went wrong. + throw $originalException; + } finally { + $this->params = $params; + } + + $serverVersion = $this->getServerVersion(); + + // Close "temporary" connection to allow connecting to the real database again. + $this->close(); + + return $serverVersion; + } + } + + return $this->getServerVersion(); + } + + /** + * Returns the database server version if the underlying driver supports it. + * + * @return string|null + * + * @throws Exception + */ + private function getServerVersion() + { + $connection = $this->getWrappedConnection(); + + // Automatic platform version detection. + if ($connection instanceof ServerInfoAwareConnection) { + try { + return $connection->getServerVersion(); + } catch (Driver\Exception $e) { + throw $this->convertException($e); + } + } + + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4750', + 'Not implementing the ServerInfoAwareConnection interface in %s is deprecated', + get_class($connection), + ); + + // Unable to detect platform version. + return null; + } + + /** + * Returns the current auto-commit mode for this connection. + * + * @see setAutoCommit + * + * @return bool True if auto-commit mode is currently enabled for this connection, false otherwise. + */ + public function isAutoCommit() + { + return $this->autoCommit === true; + } + + /** + * Sets auto-commit mode for this connection. + * + * If a connection is in auto-commit mode, then all its SQL statements will be executed and committed as individual + * transactions. Otherwise, its SQL statements are grouped into transactions that are terminated by a call to either + * the method commit or the method rollback. By default, new connections are in auto-commit mode. + * + * NOTE: If this method is called during a transaction and the auto-commit mode is changed, the transaction is + * committed. If this method is called and the auto-commit mode is not changed, the call is a no-op. + * + * @see isAutoCommit + * + * @param bool $autoCommit True to enable auto-commit mode; false to disable it. + * + * @return void + */ + public function setAutoCommit($autoCommit) + { + $autoCommit = (bool) $autoCommit; + + // Mode not changed, no-op. + if ($autoCommit === $this->autoCommit) { + return; + } + + $this->autoCommit = $autoCommit; + + // Commit all currently active transactions if any when switching auto-commit mode. + if ($this->_conn === null || $this->transactionNestingLevel === 0) { + return; + } + + $this->commitAll(); + } + + /** + * Prepares and executes an SQL query and returns the first row of the result + * as an associative array. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return array|false False is returned if no rows are found. + * + * @throws Exception + */ + public function fetchAssociative(string $query, array $params = [], array $types = []) + { + return $this->executeQuery($query, $params, $types)->fetchAssociative(); + } + + /** + * Prepares and executes an SQL query and returns the first row of the result + * as a numerically indexed array. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return list|false False is returned if no rows are found. + * + * @throws Exception + */ + public function fetchNumeric(string $query, array $params = [], array $types = []) + { + return $this->executeQuery($query, $params, $types)->fetchNumeric(); + } + + /** + * Prepares and executes an SQL query and returns the value of a single column + * of the first row of the result. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return mixed|false False is returned if no rows are found. + * + * @throws Exception + */ + public function fetchOne(string $query, array $params = [], array $types = []) + { + return $this->executeQuery($query, $params, $types)->fetchOne(); + } + + /** + * Whether an actual connection to the database is established. + * + * @return bool + */ + public function isConnected() + { + return $this->_conn !== null; + } + + /** + * Checks whether a transaction is currently active. + * + * @return bool TRUE if a transaction is currently active, FALSE otherwise. + */ + public function isTransactionActive() + { + return $this->transactionNestingLevel > 0; + } + + /** + * Adds condition based on the criteria to the query components + * + * @param array $criteria Map of key columns to their values + * @param string[] $columns Column names + * @param mixed[] $values Column values + * @param string[] $conditions Key conditions + * + * @throws Exception + */ + private function addCriteriaCondition( + array $criteria, + array &$columns, + array &$values, + array &$conditions + ): void { + $platform = $this->getDatabasePlatform(); + + foreach ($criteria as $columnName => $value) { + if ($value === null) { + $conditions[] = $platform->getIsNullExpression($columnName); + continue; + } + + $columns[] = $columnName; + $values[] = $value; + $conditions[] = $columnName . ' = ?'; + } + } + + /** + * Executes an SQL DELETE statement on a table. + * + * Table expression and columns are not escaped and are not safe for user-input. + * + * @param string $table Table name + * @param array $criteria Deletion criteria + * @param array|array $types Parameter types + * + * @return int|string The number of affected rows. + * + * @throws Exception + */ + public function delete($table, array $criteria, array $types = []) + { + if (count($criteria) === 0) { + throw InvalidArgumentException::fromEmptyCriteria(); + } + + $columns = $values = $conditions = []; + + $this->addCriteriaCondition($criteria, $columns, $values, $conditions); + + return $this->executeStatement( + 'DELETE FROM ' . $table . ' WHERE ' . implode(' AND ', $conditions), + $values, + is_string(key($types)) ? $this->extractTypeValues($columns, $types) : $types, + ); + } + + /** + * Closes the connection. + * + * @return void + */ + public function close() + { + $this->_conn = null; + $this->transactionNestingLevel = 0; + } + + /** + * Sets the transaction isolation level. + * + * @param TransactionIsolationLevel::* $level The level to set. + * + * @return int|string + * + * @throws Exception + */ + public function setTransactionIsolation($level) + { + $this->transactionIsolationLevel = $level; + + return $this->executeStatement($this->getDatabasePlatform()->getSetTransactionIsolationSQL($level)); + } + + /** + * Gets the currently active transaction isolation level. + * + * @return TransactionIsolationLevel::* The current transaction isolation level. + * + * @throws Exception + */ + public function getTransactionIsolation() + { + return $this->transactionIsolationLevel ??= $this->getDatabasePlatform()->getDefaultTransactionIsolationLevel(); + } + + /** + * Executes an SQL UPDATE statement on a table. + * + * Table expression and columns are not escaped and are not safe for user-input. + * + * @param string $table Table name + * @param array $data Column-value pairs + * @param array $criteria Update criteria + * @param array|array $types Parameter types + * + * @return int|string The number of affected rows. + * + * @throws Exception + */ + public function update($table, array $data, array $criteria, array $types = []) + { + $columns = $values = $conditions = $set = []; + + foreach ($data as $columnName => $value) { + $columns[] = $columnName; + $values[] = $value; + $set[] = $columnName . ' = ?'; + } + + $this->addCriteriaCondition($criteria, $columns, $values, $conditions); + + if (is_string(key($types))) { + $types = $this->extractTypeValues($columns, $types); + } + + $sql = 'UPDATE ' . $table . ' SET ' . implode(', ', $set) + . ' WHERE ' . implode(' AND ', $conditions); + + return $this->executeStatement($sql, $values, $types); + } + + /** + * Inserts a table row with specified data. + * + * Table expression and columns are not escaped and are not safe for user-input. + * + * @param string $table Table name + * @param array $data Column-value pairs + * @param array|array $types Parameter types + * + * @return int|string The number of affected rows. + * + * @throws Exception + */ + public function insert($table, array $data, array $types = []) + { + if (count($data) === 0) { + return $this->executeStatement('INSERT INTO ' . $table . ' () VALUES ()'); + } + + $columns = []; + $values = []; + $set = []; + + foreach ($data as $columnName => $value) { + $columns[] = $columnName; + $values[] = $value; + $set[] = '?'; + } + + return $this->executeStatement( + 'INSERT INTO ' . $table . ' (' . implode(', ', $columns) . ')' . + ' VALUES (' . implode(', ', $set) . ')', + $values, + is_string(key($types)) ? $this->extractTypeValues($columns, $types) : $types, + ); + } + + /** + * Extract ordered type list from an ordered column list and type map. + * + * @param array $columnList + * @param array|array $types + * + * @return array|array + */ + private function extractTypeValues(array $columnList, array $types): array + { + $typeValues = []; + + foreach ($columnList as $columnName) { + $typeValues[] = $types[$columnName] ?? ParameterType::STRING; + } + + return $typeValues; + } + + /** + * Quotes a string so it can be safely used as a table or column name, even if + * it is a reserved name. + * + * Delimiting style depends on the underlying database platform that is being used. + * + * NOTE: Just because you CAN use quoted identifiers does not mean + * you SHOULD use them. In general, they end up causing way more + * problems than they solve. + * + * @param string $str The name to be quoted. + * + * @return string The quoted name. + */ + public function quoteIdentifier($str) + { + return $this->getDatabasePlatform()->quoteIdentifier($str); + } + + /** + * The usage of this method is discouraged. Use prepared statements + * or {@see AbstractPlatform::quoteStringLiteral()} instead. + * + * @param mixed $value + * @param int|string|Type|null $type + * + * @return mixed + */ + public function quote($value, $type = ParameterType::STRING) + { + $connection = $this->getWrappedConnection(); + + [$value, $bindingType] = $this->getBindingInfo($value, $type); + + return $connection->quote($value, $bindingType); + } + + /** + * Prepares and executes an SQL query and returns the result as an array of numeric arrays. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return list> + * + * @throws Exception + */ + public function fetchAllNumeric(string $query, array $params = [], array $types = []): array + { + return $this->executeQuery($query, $params, $types)->fetchAllNumeric(); + } + + /** + * Prepares and executes an SQL query and returns the result as an array of associative arrays. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return list> + * + * @throws Exception + */ + public function fetchAllAssociative(string $query, array $params = [], array $types = []): array + { + return $this->executeQuery($query, $params, $types)->fetchAllAssociative(); + } + + /** + * Prepares and executes an SQL query and returns the result as an associative array with the keys + * mapped to the first column and the values mapped to the second column. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return array + * + * @throws Exception + */ + public function fetchAllKeyValue(string $query, array $params = [], array $types = []): array + { + return $this->executeQuery($query, $params, $types)->fetchAllKeyValue(); + } + + /** + * Prepares and executes an SQL query and returns the result as an associative array with the keys mapped + * to the first column and the values being an associative array representing the rest of the columns + * and their values. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return array> + * + * @throws Exception + */ + public function fetchAllAssociativeIndexed(string $query, array $params = [], array $types = []): array + { + return $this->executeQuery($query, $params, $types)->fetchAllAssociativeIndexed(); + } + + /** + * Prepares and executes an SQL query and returns the result as an array of the first column values. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return list + * + * @throws Exception + */ + public function fetchFirstColumn(string $query, array $params = [], array $types = []): array + { + return $this->executeQuery($query, $params, $types)->fetchFirstColumn(); + } + + /** + * Prepares and executes an SQL query and returns the result as an iterator over rows represented as numeric arrays. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return Traversable> + * + * @throws Exception + */ + public function iterateNumeric(string $query, array $params = [], array $types = []): Traversable + { + return $this->executeQuery($query, $params, $types)->iterateNumeric(); + } + + /** + * Prepares and executes an SQL query and returns the result as an iterator over rows represented + * as associative arrays. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return Traversable> + * + * @throws Exception + */ + public function iterateAssociative(string $query, array $params = [], array $types = []): Traversable + { + return $this->executeQuery($query, $params, $types)->iterateAssociative(); + } + + /** + * Prepares and executes an SQL query and returns the result as an iterator with the keys + * mapped to the first column and the values mapped to the second column. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return Traversable + * + * @throws Exception + */ + public function iterateKeyValue(string $query, array $params = [], array $types = []): Traversable + { + return $this->executeQuery($query, $params, $types)->iterateKeyValue(); + } + + /** + * Prepares and executes an SQL query and returns the result as an iterator with the keys mapped + * to the first column and the values being an associative array representing the rest of the columns + * and their values. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return Traversable> + * + * @throws Exception + */ + public function iterateAssociativeIndexed(string $query, array $params = [], array $types = []): Traversable + { + return $this->executeQuery($query, $params, $types)->iterateAssociativeIndexed(); + } + + /** + * Prepares and executes an SQL query and returns the result as an iterator over the first column values. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return Traversable + * + * @throws Exception + */ + public function iterateColumn(string $query, array $params = [], array $types = []): Traversable + { + return $this->executeQuery($query, $params, $types)->iterateColumn(); + } + + /** + * Prepares an SQL statement. + * + * @param string $sql The SQL statement to prepare. + * + * @throws Exception + */ + public function prepare(string $sql): Statement + { + $connection = $this->getWrappedConnection(); + + try { + $statement = $connection->prepare($sql); + } catch (Driver\Exception $e) { + throw $this->convertExceptionDuringQuery($e, $sql); + } + + return new Statement($this, $statement, $sql); + } + + /** + * Executes an, optionally parametrized, SQL query. + * + * If the query is parametrized, a prepared statement is used. + * If an SQLLogger is configured, the execution is logged. + * + * @param string $sql SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @throws Exception + */ + public function executeQuery( + string $sql, + array $params = [], + $types = [], + ?QueryCacheProfile $qcp = null + ): Result { + if ($qcp !== null) { + return $this->executeCacheQuery($sql, $params, $types, $qcp); + } + + $connection = $this->getWrappedConnection(); + + $logger = $this->_config->getSQLLogger(); + if ($logger !== null) { + $logger->startQuery($sql, $params, $types); + } + + try { + if (count($params) > 0) { + if ($this->needsArrayParameterConversion($params, $types)) { + [$sql, $params, $types] = $this->expandArrayParameters($sql, $params, $types); + } + + $stmt = $connection->prepare($sql); + + $this->bindParameters($stmt, $params, $types); + + $result = $stmt->execute(); + } else { + $result = $connection->query($sql); + } + + return new Result($result, $this); + } catch (Driver\Exception $e) { + throw $this->convertExceptionDuringQuery($e, $sql, $params, $types); + } finally { + if ($logger !== null) { + $logger->stopQuery(); + } + } + } + + /** + * Executes a caching query. + * + * @param string $sql SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @throws CacheException + * @throws Exception + */ + public function executeCacheQuery($sql, $params, $types, QueryCacheProfile $qcp): Result + { + $resultCache = $qcp->getResultCache() ?? $this->_config->getResultCache(); + + if ($resultCache === null) { + throw CacheException::noResultDriverConfigured(); + } + + $connectionParams = $this->params; + unset($connectionParams['platform']); + + [$cacheKey, $realKey] = $qcp->generateCacheKeys($sql, $params, $types, $connectionParams); + + $item = $resultCache->getItem($cacheKey); + + if ($item->isHit()) { + $value = $item->get(); + if (isset($value[$realKey])) { + return new Result(new ArrayResult($value[$realKey]), $this); + } + } else { + $value = []; + } + + $data = $this->fetchAllAssociative($sql, $params, $types); + + $value[$realKey] = $data; + + $item->set($value); + + $lifetime = $qcp->getLifetime(); + if ($lifetime > 0) { + $item->expiresAfter($lifetime); + } + + $resultCache->save($item); + + return new Result(new ArrayResult($data), $this); + } + + /** + * Executes an SQL statement with the given parameters and returns the number of affected rows. + * + * Could be used for: + * - DML statements: INSERT, UPDATE, DELETE, etc. + * - DDL statements: CREATE, DROP, ALTER, etc. + * - DCL statements: GRANT, REVOKE, etc. + * - Session control statements: ALTER SESSION, SET, DECLARE, etc. + * - Other statements that don't yield a row set. + * + * This method supports PDO binding types as well as DBAL mapping types. + * + * @param string $sql SQL statement + * @param list|array $params Statement parameters + * @param array|array $types Parameter types + * + * @return int|string The number of affected rows. + * + * @throws Exception + */ + public function executeStatement($sql, array $params = [], array $types = []) + { + $connection = $this->getWrappedConnection(); + + $logger = $this->_config->getSQLLogger(); + if ($logger !== null) { + $logger->startQuery($sql, $params, $types); + } + + try { + if (count($params) > 0) { + if ($this->needsArrayParameterConversion($params, $types)) { + [$sql, $params, $types] = $this->expandArrayParameters($sql, $params, $types); + } + + $stmt = $connection->prepare($sql); + + $this->bindParameters($stmt, $params, $types); + + return $stmt->execute() + ->rowCount(); + } + + return $connection->exec($sql); + } catch (Driver\Exception $e) { + throw $this->convertExceptionDuringQuery($e, $sql, $params, $types); + } finally { + if ($logger !== null) { + $logger->stopQuery(); + } + } + } + + /** + * Returns the current transaction nesting level. + * + * @return int The nesting level. A value of 0 means there's no active transaction. + */ + public function getTransactionNestingLevel() + { + return $this->transactionNestingLevel; + } + + /** + * Returns the ID of the last inserted row, or the last value from a sequence object, + * depending on the underlying driver. + * + * Note: This method may not return a meaningful or consistent result across different drivers, + * because the underlying database may not even support the notion of AUTO_INCREMENT/IDENTITY + * columns or sequences. + * + * @param string|null $name Name of the sequence object from which the ID should be returned. + * + * @return string|int|false A string representation of the last inserted ID. + * + * @throws Exception + */ + public function lastInsertId($name = null) + { + if ($name !== null) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4687', + 'The usage of Connection::lastInsertId() with a sequence name is deprecated.', + ); + } + + try { + return $this->getWrappedConnection()->lastInsertId($name); + } catch (Driver\Exception $e) { + throw $this->convertException($e); + } + } + + /** + * Executes a function in a transaction. + * + * The function gets passed this Connection instance as an (optional) parameter. + * + * If an exception occurs during execution of the function or transaction commit, + * the transaction is rolled back and the exception re-thrown. + * + * @param Closure(self):T $func The function to execute transactionally. + * + * @return T The value returned by $func + * + * @throws Throwable + * + * @template T + */ + public function transactional(Closure $func) + { + $this->beginTransaction(); + try { + $res = $func($this); + $this->commit(); + + return $res; + } catch (Throwable $e) { + $this->rollBack(); + + throw $e; + } + } + + /** + * Sets if nested transactions should use savepoints. + * + * @param bool $nestTransactionsWithSavepoints + * + * @return void + * + * @throws Exception + */ + public function setNestTransactionsWithSavepoints($nestTransactionsWithSavepoints) + { + if (! $nestTransactionsWithSavepoints) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5383', + <<<'DEPRECATION' + Nesting transactions without enabling savepoints is deprecated. + Call %s::setNestTransactionsWithSavepoints(true) to enable savepoints. + DEPRECATION, + self::class, + ); + } + + if ($this->transactionNestingLevel > 0) { + throw ConnectionException::mayNotAlterNestedTransactionWithSavepointsInTransaction(); + } + + if (! $this->getDatabasePlatform()->supportsSavepoints()) { + throw ConnectionException::savepointsNotSupported(); + } + + $this->nestTransactionsWithSavepoints = (bool) $nestTransactionsWithSavepoints; + } + + /** + * Gets if nested transactions should use savepoints. + * + * @return bool + */ + public function getNestTransactionsWithSavepoints() + { + return $this->nestTransactionsWithSavepoints; + } + + /** + * Returns the savepoint name to use for nested transactions. + * + * @return string + */ + protected function _getNestedTransactionSavePointName() + { + return 'DOCTRINE2_SAVEPOINT_' . $this->transactionNestingLevel; + } + + /** + * @return bool + * + * @throws Exception + */ + public function beginTransaction() + { + $connection = $this->getWrappedConnection(); + + ++$this->transactionNestingLevel; + + $logger = $this->_config->getSQLLogger(); + + if ($this->transactionNestingLevel === 1) { + if ($logger !== null) { + $logger->startQuery('"START TRANSACTION"'); + } + + $connection->beginTransaction(); + + if ($logger !== null) { + $logger->stopQuery(); + } + } elseif ($this->nestTransactionsWithSavepoints) { + if ($logger !== null) { + $logger->startQuery('"SAVEPOINT"'); + } + + $this->createSavepoint($this->_getNestedTransactionSavePointName()); + if ($logger !== null) { + $logger->stopQuery(); + } + } else { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5383', + <<<'DEPRECATION' + Nesting transactions without enabling savepoints is deprecated. + Call %s::setNestTransactionsWithSavepoints(true) to enable savepoints. + DEPRECATION, + self::class, + ); + } + + $eventManager = $this->getEventManager(); + + if ($eventManager->hasListeners(Events::onTransactionBegin)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/5784', + 'Subscribing to %s events is deprecated.', + Events::onTransactionBegin, + ); + + $eventManager->dispatchEvent(Events::onTransactionBegin, new TransactionBeginEventArgs($this)); + } + + return true; + } + + /** + * @return bool + * + * @throws Exception + */ + public function commit() + { + if ($this->transactionNestingLevel === 0) { + throw ConnectionException::noActiveTransaction(); + } + + if ($this->isRollbackOnly) { + throw ConnectionException::commitFailedRollbackOnly(); + } + + $result = true; + + $connection = $this->getWrappedConnection(); + + if ($this->transactionNestingLevel === 1) { + $result = $this->doCommit($connection); + } elseif ($this->nestTransactionsWithSavepoints) { + $this->releaseSavepoint($this->_getNestedTransactionSavePointName()); + } + + --$this->transactionNestingLevel; + + $eventManager = $this->getEventManager(); + + if ($eventManager->hasListeners(Events::onTransactionCommit)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/5784', + 'Subscribing to %s events is deprecated.', + Events::onTransactionCommit, + ); + + $eventManager->dispatchEvent(Events::onTransactionCommit, new TransactionCommitEventArgs($this)); + } + + if ($this->autoCommit !== false || $this->transactionNestingLevel !== 0) { + return $result; + } + + $this->beginTransaction(); + + return $result; + } + + /** + * @return bool + * + * @throws DriverException + */ + private function doCommit(DriverConnection $connection) + { + $logger = $this->_config->getSQLLogger(); + + if ($logger !== null) { + $logger->startQuery('"COMMIT"'); + } + + $result = $connection->commit(); + + if ($logger !== null) { + $logger->stopQuery(); + } + + return $result; + } + + /** + * Commits all current nesting transactions. + * + * @throws Exception + */ + private function commitAll(): void + { + while ($this->transactionNestingLevel !== 0) { + if ($this->autoCommit === false && $this->transactionNestingLevel === 1) { + // When in no auto-commit mode, the last nesting commit immediately starts a new transaction. + // Therefore we need to do the final commit here and then leave to avoid an infinite loop. + $this->commit(); + + return; + } + + $this->commit(); + } + } + + /** + * Cancels any database changes done during the current transaction. + * + * @return bool + * + * @throws Exception + */ + public function rollBack() + { + if ($this->transactionNestingLevel === 0) { + throw ConnectionException::noActiveTransaction(); + } + + $connection = $this->getWrappedConnection(); + + $logger = $this->_config->getSQLLogger(); + + if ($this->transactionNestingLevel === 1) { + if ($logger !== null) { + $logger->startQuery('"ROLLBACK"'); + } + + $this->transactionNestingLevel = 0; + $connection->rollBack(); + $this->isRollbackOnly = false; + if ($logger !== null) { + $logger->stopQuery(); + } + + if ($this->autoCommit === false) { + $this->beginTransaction(); + } + } elseif ($this->nestTransactionsWithSavepoints) { + if ($logger !== null) { + $logger->startQuery('"ROLLBACK TO SAVEPOINT"'); + } + + $this->rollbackSavepoint($this->_getNestedTransactionSavePointName()); + --$this->transactionNestingLevel; + if ($logger !== null) { + $logger->stopQuery(); + } + } else { + $this->isRollbackOnly = true; + --$this->transactionNestingLevel; + } + + $eventManager = $this->getEventManager(); + + if ($eventManager->hasListeners(Events::onTransactionRollBack)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/5784', + 'Subscribing to %s events is deprecated.', + Events::onTransactionRollBack, + ); + + $eventManager->dispatchEvent(Events::onTransactionRollBack, new TransactionRollBackEventArgs($this)); + } + + return true; + } + + /** + * Creates a new savepoint. + * + * @param string $savepoint The name of the savepoint to create. + * + * @return void + * + * @throws Exception + */ + public function createSavepoint($savepoint) + { + $platform = $this->getDatabasePlatform(); + + if (! $platform->supportsSavepoints()) { + throw ConnectionException::savepointsNotSupported(); + } + + $this->executeStatement($platform->createSavePoint($savepoint)); + } + + /** + * Releases the given savepoint. + * + * @param string $savepoint The name of the savepoint to release. + * + * @return void + * + * @throws Exception + */ + public function releaseSavepoint($savepoint) + { + $logger = $this->_config->getSQLLogger(); + + $platform = $this->getDatabasePlatform(); + + if (! $platform->supportsSavepoints()) { + throw ConnectionException::savepointsNotSupported(); + } + + if (! $platform->supportsReleaseSavepoints()) { + if ($logger !== null) { + $logger->stopQuery(); + } + + return; + } + + if ($logger !== null) { + $logger->startQuery('"RELEASE SAVEPOINT"'); + } + + $this->executeStatement($platform->releaseSavePoint($savepoint)); + + if ($logger === null) { + return; + } + + $logger->stopQuery(); + } + + /** + * Rolls back to the given savepoint. + * + * @param string $savepoint The name of the savepoint to rollback to. + * + * @return void + * + * @throws Exception + */ + public function rollbackSavepoint($savepoint) + { + $platform = $this->getDatabasePlatform(); + + if (! $platform->supportsSavepoints()) { + throw ConnectionException::savepointsNotSupported(); + } + + $this->executeStatement($platform->rollbackSavePoint($savepoint)); + } + + /** + * Gets the wrapped driver connection. + * + * @deprecated Use {@link getNativeConnection()} to access the native connection. + * + * @return DriverConnection + * + * @throws Exception + */ + public function getWrappedConnection() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4966', + 'Connection::getWrappedConnection() is deprecated.' + . ' Use Connection::getNativeConnection() to access the native connection.', + ); + + $this->connect(); + + assert($this->_conn !== null); + + return $this->_conn; + } + + /** @return resource|object */ + public function getNativeConnection() + { + $this->connect(); + + assert($this->_conn !== null); + if (! method_exists($this->_conn, 'getNativeConnection')) { + throw new LogicException(sprintf( + 'The driver connection %s does not support accessing the native connection.', + get_class($this->_conn), + )); + } + + return $this->_conn->getNativeConnection(); + } + + /** + * Creates a SchemaManager that can be used to inspect or change the + * database schema through the connection. + * + * @throws Exception + */ + public function createSchemaManager(): AbstractSchemaManager + { + return $this->_driver->getSchemaManager( + $this, + $this->getDatabasePlatform(), + ); + } + + /** + * Gets the SchemaManager that can be used to inspect or change the + * database schema through the connection. + * + * @deprecated Use {@see createSchemaManager()} instead. + * + * @return AbstractSchemaManager + * + * @throws Exception + */ + public function getSchemaManager() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4515', + 'Connection::getSchemaManager() is deprecated, use Connection::createSchemaManager() instead.', + ); + + return $this->_schemaManager ??= $this->createSchemaManager(); + } + + /** + * Marks the current transaction so that the only possible + * outcome for the transaction to be rolled back. + * + * @return void + * + * @throws ConnectionException If no transaction is active. + */ + public function setRollbackOnly() + { + if ($this->transactionNestingLevel === 0) { + throw ConnectionException::noActiveTransaction(); + } + + $this->isRollbackOnly = true; + } + + /** + * Checks whether the current transaction is marked for rollback only. + * + * @return bool + * + * @throws ConnectionException If no transaction is active. + */ + public function isRollbackOnly() + { + if ($this->transactionNestingLevel === 0) { + throw ConnectionException::noActiveTransaction(); + } + + return $this->isRollbackOnly; + } + + /** + * Converts a given value to its database representation according to the conversion + * rules of a specific DBAL mapping type. + * + * @param mixed $value The value to convert. + * @param string $type The name of the DBAL mapping type. + * + * @return mixed The converted value. + * + * @throws Exception + */ + public function convertToDatabaseValue($value, $type) + { + return Type::getType($type)->convertToDatabaseValue($value, $this->getDatabasePlatform()); + } + + /** + * Converts a given value to its PHP representation according to the conversion + * rules of a specific DBAL mapping type. + * + * @param mixed $value The value to convert. + * @param string $type The name of the DBAL mapping type. + * + * @return mixed The converted type. + * + * @throws Exception + */ + public function convertToPHPValue($value, $type) + { + return Type::getType($type)->convertToPHPValue($value, $this->getDatabasePlatform()); + } + + /** + * Binds a set of parameters, some or all of which are typed with a PDO binding type + * or DBAL mapping type, to a given statement. + * + * @param DriverStatement $stmt Prepared statement + * @param list|array $params Statement parameters + * @param array|array $types Parameter types + * + * @throws Exception + */ + private function bindParameters(DriverStatement $stmt, array $params, array $types): void + { + // Check whether parameters are positional or named. Mixing is not allowed. + if (is_int(key($params))) { + $bindIndex = 1; + + foreach ($params as $key => $value) { + if (isset($types[$key])) { + $type = $types[$key]; + [$value, $bindingType] = $this->getBindingInfo($value, $type); + } else { + if (array_key_exists($key, $types)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5550', + 'Using NULL as prepared statement parameter type is deprecated.' + . 'Omit or use Parameter::STRING instead', + ); + } + + $bindingType = ParameterType::STRING; + } + + $stmt->bindValue($bindIndex, $value, $bindingType); + + ++$bindIndex; + } + } else { + // Named parameters + foreach ($params as $name => $value) { + if (isset($types[$name])) { + $type = $types[$name]; + [$value, $bindingType] = $this->getBindingInfo($value, $type); + } else { + if (array_key_exists($name, $types)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5550', + 'Using NULL as prepared statement parameter type is deprecated.' + . 'Omit or use Parameter::STRING instead', + ); + } + + $bindingType = ParameterType::STRING; + } + + $stmt->bindValue($name, $value, $bindingType); + } + } + } + + /** + * Gets the binding type of a given type. + * + * @param mixed $value The value to bind. + * @param int|string|Type|null $type The type to bind (PDO or DBAL). + * + * @return array{mixed, int} [0] => the (escaped) value, [1] => the binding type. + * + * @throws Exception + */ + private function getBindingInfo($value, $type): array + { + if (is_string($type)) { + $type = Type::getType($type); + } + + if ($type instanceof Type) { + $value = $type->convertToDatabaseValue($value, $this->getDatabasePlatform()); + $bindingType = $type->getBindingType(); + } else { + $bindingType = $type ?? ParameterType::STRING; + } + + return [$value, $bindingType]; + } + + /** + * Creates a new instance of a SQL query builder. + * + * @return QueryBuilder + */ + public function createQueryBuilder() + { + return new Query\QueryBuilder($this); + } + + /** + * @internal + * + * @param list|array $params + * @param array|array $types + */ + final public function convertExceptionDuringQuery( + Driver\Exception $e, + string $sql, + array $params = [], + array $types = [] + ): DriverException { + return $this->handleDriverException($e, new Query($sql, $params, $types)); + } + + /** @internal */ + final public function convertException(Driver\Exception $e): DriverException + { + return $this->handleDriverException($e, null); + } + + /** + * @param array|array $params + * @param array|array $types + * + * @return array{string, list, array} + */ + private function expandArrayParameters(string $sql, array $params, array $types): array + { + $this->parser ??= $this->getDatabasePlatform()->createSQLParser(); + $visitor = new ExpandArrayParameters($params, $types); + + $this->parser->parse($sql, $visitor); + + return [ + $visitor->getSQL(), + $visitor->getParameters(), + $visitor->getTypes(), + ]; + } + + /** + * @param array|array $params + * @param array|array $types + */ + private function needsArrayParameterConversion(array $params, array $types): bool + { + if (is_string(key($params))) { + return true; + } + + foreach ($types as $type) { + if ( + $type === self::PARAM_INT_ARRAY + || $type === self::PARAM_STR_ARRAY + || $type === self::PARAM_ASCII_STR_ARRAY + ) { + return true; + } + } + + return false; + } + + private function handleDriverException( + Driver\Exception $driverException, + ?Query $query + ): DriverException { + $this->exceptionConverter ??= $this->_driver->getExceptionConverter(); + $exception = $this->exceptionConverter->convert($driverException, $query); + + if ($exception instanceof ConnectionLost) { + $this->close(); + } + + return $exception; + } + + /** + * BC layer for a wide-spread use-case of old DBAL APIs + * + * @deprecated This API is deprecated and will be removed after 2022 + * + * @param array $params The query parameters + * @param array $types The parameter types + */ + public function executeUpdate(string $sql, array $params = [], array $types = []): int + { + return $this->executeStatement($sql, $params, $types); + } + + /** + * BC layer for a wide-spread use-case of old DBAL APIs + * + * @deprecated This API is deprecated and will be removed after 2022 + */ + public function query(string $sql): Result + { + return $this->executeQuery($sql); + } + + /** + * BC layer for a wide-spread use-case of old DBAL APIs + * + * @deprecated This API is deprecated and will be removed after 2022 + */ + public function exec(string $sql): int + { + return $this->executeStatement($sql); + } +} diff --git a/vendor/doctrine/dbal/src/ConnectionException.php b/vendor/doctrine/dbal/src/ConnectionException.php new file mode 100644 index 00000000..f1e18987 --- /dev/null +++ b/vendor/doctrine/dbal/src/ConnectionException.php @@ -0,0 +1,31 @@ +executeQuery("DELETE FROM table"); + * + * Be aware that Connection#executeQuery is a method specifically for READ + * operations only. + * + * Use Connection#executeStatement for any SQL statement that changes/updates + * state in the database (UPDATE, INSERT, DELETE or DDL statements). + * + * This connection is limited to replica operations using the + * Connection#executeQuery operation only, because it wouldn't be compatible + * with the ORM or SchemaManager code otherwise. Both use all the other + * operations in a context where writes could happen to a replica, which makes + * this restricted approach necessary. + * + * You can manually connect to the primary at any time by calling: + * + * $conn->ensureConnectedToPrimary(); + * + * Instantiation through the DriverManager looks like: + * + * @psalm-import-type Params from DriverManager + * @example + * + * $conn = DriverManager::getConnection(array( + * 'wrapperClass' => 'Doctrine\DBAL\Connections\PrimaryReadReplicaConnection', + * 'driver' => 'pdo_mysql', + * 'primary' => array('user' => '', 'password' => '', 'host' => '', 'dbname' => ''), + * 'replica' => array( + * array('user' => 'replica1', 'password', 'host' => '', 'dbname' => ''), + * array('user' => 'replica2', 'password', 'host' => '', 'dbname' => ''), + * ) + * )); + * + * You can also pass 'driverOptions' and any other documented option to each of this drivers + * to pass additional information. + */ +class PrimaryReadReplicaConnection extends Connection +{ + /** + * Primary and Replica connection (one of the randomly picked replicas). + * + * @var DriverConnection[]|null[] + */ + protected $connections = ['primary' => null, 'replica' => null]; + + /** + * You can keep the replica connection and then switch back to it + * during the request if you know what you are doing. + * + * @var bool + */ + protected $keepReplica = false; + + /** + * Creates Primary Replica Connection. + * + * @internal The connection can be only instantiated by the driver manager. + * + * @param array $params + * @psalm-param Params $params + * @phpstan-param array $params + * + * @throws Exception + * @throws InvalidArgumentException + */ + public function __construct( + array $params, + Driver $driver, + ?Configuration $config = null, + ?EventManager $eventManager = null + ) { + if (! isset($params['replica'], $params['primary'])) { + throw new InvalidArgumentException('primary or replica configuration missing'); + } + + if (count($params['replica']) === 0) { + throw new InvalidArgumentException('You have to configure at least one replica.'); + } + + if (isset($params['driver'])) { + $params['primary']['driver'] = $params['driver']; + + foreach ($params['replica'] as $replicaKey => $replica) { + $params['replica'][$replicaKey]['driver'] = $params['driver']; + } + } + + $this->keepReplica = (bool) ($params['keepReplica'] ?? false); + + parent::__construct($params, $driver, $config, $eventManager); + } + + /** + * Checks if the connection is currently towards the primary or not. + */ + public function isConnectedToPrimary(): bool + { + return $this->_conn !== null && $this->_conn === $this->connections['primary']; + } + + /** + * @param string|null $connectionName + * + * @return bool + */ + public function connect($connectionName = null) + { + if ($connectionName !== null) { + throw new InvalidArgumentException( + 'Passing a connection name as first argument is not supported anymore.' + . ' Use ensureConnectedToPrimary()/ensureConnectedToReplica() instead.', + ); + } + + return $this->performConnect(); + } + + protected function performConnect(?string $connectionName = null): bool + { + $requestedConnectionChange = ($connectionName !== null); + $connectionName = $connectionName ?? 'replica'; + + if ($connectionName !== 'replica' && $connectionName !== 'primary') { + throw new InvalidArgumentException('Invalid option to connect(), only primary or replica allowed.'); + } + + // If we have a connection open, and this is not an explicit connection + // change request, then abort right here, because we are already done. + // This prevents writes to the replica in case of "keepReplica" option enabled. + if ($this->_conn !== null && ! $requestedConnectionChange) { + return false; + } + + $forcePrimaryAsReplica = false; + + if ($this->getTransactionNestingLevel() > 0) { + $connectionName = 'primary'; + $forcePrimaryAsReplica = true; + } + + if (isset($this->connections[$connectionName])) { + $this->_conn = $this->connections[$connectionName]; + + if ($forcePrimaryAsReplica && ! $this->keepReplica) { + $this->connections['replica'] = $this->_conn; + } + + return false; + } + + if ($connectionName === 'primary') { + $this->connections['primary'] = $this->_conn = $this->connectTo($connectionName); + + // Set replica connection to primary to avoid invalid reads + if (! $this->keepReplica) { + $this->connections['replica'] = $this->connections['primary']; + } + } else { + $this->connections['replica'] = $this->_conn = $this->connectTo($connectionName); + } + + if ($this->_eventManager->hasListeners(Events::postConnect)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/5784', + 'Subscribing to %s events is deprecated. Implement a middleware instead.', + Events::postConnect, + ); + + $eventArgs = new ConnectionEventArgs($this); + $this->_eventManager->dispatchEvent(Events::postConnect, $eventArgs); + } + + return true; + } + + /** + * Connects to the primary node of the database cluster. + * + * All following statements after this will be executed against the primary node. + */ + public function ensureConnectedToPrimary(): bool + { + return $this->performConnect('primary'); + } + + /** + * Connects to a replica node of the database cluster. + * + * All following statements after this will be executed against the replica node, + * unless the keepReplica option is set to false and a primary connection + * was already opened. + */ + public function ensureConnectedToReplica(): bool + { + return $this->performConnect('replica'); + } + + /** + * Connects to a specific connection. + * + * @param string $connectionName + * + * @return DriverConnection + * + * @throws Exception + */ + protected function connectTo($connectionName) + { + $params = $this->getParams(); + + $connectionParams = $this->chooseConnectionConfiguration($connectionName, $params); + + try { + return $this->_driver->connect($connectionParams); + } catch (DriverException $e) { + throw $this->convertException($e); + } + } + + /** + * @param string $connectionName + * @param mixed[] $params + * + * @return mixed + */ + protected function chooseConnectionConfiguration($connectionName, $params) + { + if ($connectionName === 'primary') { + return $params['primary']; + } + + $config = $params['replica'][array_rand($params['replica'])]; + + if (! isset($config['charset']) && isset($params['primary']['charset'])) { + $config['charset'] = $params['primary']['charset']; + } + + return $config; + } + + /** + * {@inheritDoc} + */ + public function executeStatement($sql, array $params = [], array $types = []) + { + $this->ensureConnectedToPrimary(); + + return parent::executeStatement($sql, $params, $types); + } + + /** + * {@inheritDoc} + */ + public function beginTransaction() + { + $this->ensureConnectedToPrimary(); + + return parent::beginTransaction(); + } + + /** + * {@inheritDoc} + */ + public function commit() + { + $this->ensureConnectedToPrimary(); + + return parent::commit(); + } + + /** + * {@inheritDoc} + */ + public function rollBack() + { + $this->ensureConnectedToPrimary(); + + return parent::rollBack(); + } + + /** + * {@inheritDoc} + */ + public function close() + { + unset($this->connections['primary'], $this->connections['replica']); + + parent::close(); + + $this->_conn = null; + $this->connections = ['primary' => null, 'replica' => null]; + } + + /** + * {@inheritDoc} + */ + public function createSavepoint($savepoint) + { + $this->ensureConnectedToPrimary(); + + parent::createSavepoint($savepoint); + } + + /** + * {@inheritDoc} + */ + public function releaseSavepoint($savepoint) + { + $this->ensureConnectedToPrimary(); + + parent::releaseSavepoint($savepoint); + } + + /** + * {@inheritDoc} + */ + public function rollbackSavepoint($savepoint) + { + $this->ensureConnectedToPrimary(); + + parent::rollbackSavepoint($savepoint); + } + + public function prepare(string $sql): Statement + { + $this->ensureConnectedToPrimary(); + + return parent::prepare($sql); + } +} diff --git a/vendor/doctrine/dbal/src/Driver.php b/vendor/doctrine/dbal/src/Driver.php new file mode 100644 index 00000000..efc1792b --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver.php @@ -0,0 +1,50 @@ +getCode()) { + case -104: + return new SyntaxErrorException($exception, $query); + + case -203: + return new NonUniqueFieldNameException($exception, $query); + + case -204: + return new TableNotFoundException($exception, $query); + + case -206: + return new InvalidFieldNameException($exception, $query); + + case -407: + return new NotNullConstraintViolationException($exception, $query); + + case -530: + case -531: + case -532: + case -20356: + return new ForeignKeyConstraintViolationException($exception, $query); + + case -601: + return new TableExistsException($exception, $query); + + case -803: + return new UniqueConstraintViolationException($exception, $query); + + case -1336: + case -30082: + return new ConnectionException($exception, $query); + } + + return new DriverException($exception, $query); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php b/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php new file mode 100644 index 00000000..87d50aff --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php @@ -0,0 +1,119 @@ +getCode()) { + case 1008: + return new DatabaseDoesNotExist($exception, $query); + + case 1213: + return new DeadlockException($exception, $query); + + case 1205: + return new LockWaitTimeoutException($exception, $query); + + case 1050: + return new TableExistsException($exception, $query); + + case 1051: + case 1146: + return new TableNotFoundException($exception, $query); + + case 1216: + case 1217: + case 1451: + case 1452: + case 1701: + return new ForeignKeyConstraintViolationException($exception, $query); + + case 1062: + case 1557: + case 1569: + case 1586: + return new UniqueConstraintViolationException($exception, $query); + + case 1054: + case 1166: + case 1611: + return new InvalidFieldNameException($exception, $query); + + case 1052: + case 1060: + case 1110: + return new NonUniqueFieldNameException($exception, $query); + + case 1064: + case 1149: + case 1287: + case 1341: + case 1342: + case 1343: + case 1344: + case 1382: + case 1479: + case 1541: + case 1554: + case 1626: + return new SyntaxErrorException($exception, $query); + + case 1044: + case 1045: + case 1046: + case 1049: + case 1095: + case 1142: + case 1143: + case 1227: + case 1370: + case 1429: + case 2002: + case 2005: + case 2054: + return new ConnectionException($exception, $query); + + case 2006: + return new ConnectionLost($exception, $query); + + case 1048: + case 1121: + case 1138: + case 1171: + case 1252: + case 1263: + case 1364: + case 1566: + return new NotNullConstraintViolationException($exception, $query); + } + + return new DriverException($exception, $query); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/API/OCI/ExceptionConverter.php b/vendor/doctrine/dbal/src/Driver/API/OCI/ExceptionConverter.php new file mode 100644 index 00000000..4703a57d --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/API/OCI/ExceptionConverter.php @@ -0,0 +1,74 @@ +getCode()) { + case 1: + case 2299: + case 38911: + return new UniqueConstraintViolationException($exception, $query); + + case 904: + return new InvalidFieldNameException($exception, $query); + + case 918: + case 960: + return new NonUniqueFieldNameException($exception, $query); + + case 923: + return new SyntaxErrorException($exception, $query); + + case 942: + return new TableNotFoundException($exception, $query); + + case 955: + return new TableExistsException($exception, $query); + + case 1017: + case 12545: + return new ConnectionException($exception, $query); + + case 1400: + return new NotNullConstraintViolationException($exception, $query); + + case 1918: + return new DatabaseDoesNotExist($exception, $query); + + case 2289: + case 2443: + case 4080: + return new DatabaseObjectNotFoundException($exception, $query); + + case 2266: + case 2291: + case 2292: + return new ForeignKeyConstraintViolationException($exception, $query); + } + + return new DriverException($exception, $query); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php b/vendor/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php new file mode 100644 index 00000000..2baca1ee --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php @@ -0,0 +1,89 @@ +getSQLState()) { + case '40001': + case '40P01': + return new DeadlockException($exception, $query); + + case '0A000': + // Foreign key constraint violations during a TRUNCATE operation + // are considered "feature not supported" in PostgreSQL. + if (strpos($exception->getMessage(), 'truncate') !== false) { + return new ForeignKeyConstraintViolationException($exception, $query); + } + + break; + + case '23502': + return new NotNullConstraintViolationException($exception, $query); + + case '23503': + return new ForeignKeyConstraintViolationException($exception, $query); + + case '23505': + return new UniqueConstraintViolationException($exception, $query); + + case '3D000': + return new DatabaseDoesNotExist($exception, $query); + + case '3F000': + return new SchemaDoesNotExist($exception, $query); + + case '42601': + return new SyntaxErrorException($exception, $query); + + case '42702': + return new NonUniqueFieldNameException($exception, $query); + + case '42703': + return new InvalidFieldNameException($exception, $query); + + case '42P01': + return new TableNotFoundException($exception, $query); + + case '42P07': + return new TableExistsException($exception, $query); + + case '08006': + return new ConnectionException($exception, $query); + } + + // Prior to fixing https://bugs.php.net/bug.php?id=64705 (PHP 7.4.10), + // in some cases (mainly connection errors) the PDO exception wouldn't provide a SQLSTATE via its code. + // We have to match against the SQLSTATE in the error message in these cases. + if ($exception->getCode() === 7 && strpos($exception->getMessage(), 'SQLSTATE[08006]') !== false) { + return new ConnectionException($exception, $query); + } + + return new DriverException($exception, $query); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/API/SQLSrv/ExceptionConverter.php b/vendor/doctrine/dbal/src/Driver/API/SQLSrv/ExceptionConverter.php new file mode 100644 index 00000000..d0e8e9f4 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/API/SQLSrv/ExceptionConverter.php @@ -0,0 +1,69 @@ +getCode()) { + case 102: + return new SyntaxErrorException($exception, $query); + + case 207: + return new InvalidFieldNameException($exception, $query); + + case 208: + return new TableNotFoundException($exception, $query); + + case 209: + return new NonUniqueFieldNameException($exception, $query); + + case 515: + return new NotNullConstraintViolationException($exception, $query); + + case 547: + case 4712: + return new ForeignKeyConstraintViolationException($exception, $query); + + case 2601: + case 2627: + return new UniqueConstraintViolationException($exception, $query); + + case 2714: + return new TableExistsException($exception, $query); + + case 3701: + case 15151: + return new DatabaseObjectNotFoundException($exception, $query); + + case 11001: + case 18456: + return new ConnectionException($exception, $query); + } + + return new DriverException($exception, $query); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/API/SQLite/ExceptionConverter.php b/vendor/doctrine/dbal/src/Driver/API/SQLite/ExceptionConverter.php new file mode 100644 index 00000000..9e67155a --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/API/SQLite/ExceptionConverter.php @@ -0,0 +1,85 @@ +getMessage(), 'database is locked') !== false) { + return new LockWaitTimeoutException($exception, $query); + } + + if ( + strpos($exception->getMessage(), 'must be unique') !== false || + strpos($exception->getMessage(), 'is not unique') !== false || + strpos($exception->getMessage(), 'are not unique') !== false || + strpos($exception->getMessage(), 'UNIQUE constraint failed') !== false + ) { + return new UniqueConstraintViolationException($exception, $query); + } + + if ( + strpos($exception->getMessage(), 'may not be NULL') !== false || + strpos($exception->getMessage(), 'NOT NULL constraint failed') !== false + ) { + return new NotNullConstraintViolationException($exception, $query); + } + + if (strpos($exception->getMessage(), 'no such table:') !== false) { + return new TableNotFoundException($exception, $query); + } + + if (strpos($exception->getMessage(), 'already exists') !== false) { + return new TableExistsException($exception, $query); + } + + if (strpos($exception->getMessage(), 'has no column named') !== false) { + return new InvalidFieldNameException($exception, $query); + } + + if (strpos($exception->getMessage(), 'ambiguous column name') !== false) { + return new NonUniqueFieldNameException($exception, $query); + } + + if (strpos($exception->getMessage(), 'syntax error') !== false) { + return new SyntaxErrorException($exception, $query); + } + + if (strpos($exception->getMessage(), 'attempt to write a readonly database') !== false) { + return new ReadOnlyException($exception, $query); + } + + if (strpos($exception->getMessage(), 'unable to open database file') !== false) { + return new ConnectionException($exception, $query); + } + + if (strpos($exception->getMessage(), 'FOREIGN KEY constraint failed') !== false) { + return new ForeignKeyConstraintViolationException($exception, $query); + } + + return new DriverException($exception, $query); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/API/SQLite/UserDefinedFunctions.php b/vendor/doctrine/dbal/src/Driver/API/SQLite/UserDefinedFunctions.php new file mode 100644 index 00000000..3779c8ba --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/API/SQLite/UserDefinedFunctions.php @@ -0,0 +1,80 @@ + ['callback' => [SqlitePlatform::class, 'udfSqrt'], 'numArgs' => 1], + 'mod' => ['callback' => [SqlitePlatform::class, 'udfMod'], 'numArgs' => 2], + 'locate' => ['callback' => [SqlitePlatform::class, 'udfLocate'], 'numArgs' => -1], + ]; + + /** + * @param callable(string, callable, int): bool $callback + * @param array $additionalFunctions + */ + public static function register(callable $callback, array $additionalFunctions = []): void + { + $userDefinedFunctions = array_merge(self::DEFAULT_FUNCTIONS, $additionalFunctions); + + foreach ($userDefinedFunctions as $function => $data) { + $callback($function, $data['callback'], $data['numArgs']); + } + } + + /** + * User-defined function that implements MOD(). + * + * @param int $a + * @param int $b + */ + public static function mod($a, $b): int + { + return $a % $b; + } + + /** + * User-defined function that implements LOCATE(). + * + * @param string $str + * @param string $substr + * @param int $offset + */ + public static function locate($str, $substr, $offset = 0): int + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5749', + 'Relying on DBAL\'s emulated LOCATE() function is deprecated. ' + . 'Use INSTR() or %s::getLocateExpression() instead.', + AbstractPlatform::class, + ); + + // SQL's LOCATE function works on 1-based positions, while PHP's strpos works on 0-based positions. + // So we have to make them compatible if an offset is given. + if ($offset > 0) { + $offset -= 1; + } + + $pos = strpos($str, $substr, $offset); + + if ($pos !== false) { + return $pos + 1; + } + + return 0; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/AbstractDB2Driver.php b/vendor/doctrine/dbal/src/Driver/AbstractDB2Driver.php new file mode 100644 index 00000000..3a08312d --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/AbstractDB2Driver.php @@ -0,0 +1,52 @@ +sqlState = $sqlState; + } + + /** + * {@inheritdoc} + */ + public function getSQLState() + { + return $this->sqlState; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/AbstractMySQLDriver.php b/vendor/doctrine/dbal/src/Driver/AbstractMySQLDriver.php new file mode 100644 index 00000000..d8f3fb35 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/AbstractMySQLDriver.php @@ -0,0 +1,157 @@ +getMariaDbMysqlVersionNumber($version), '10.2.7', '>=')) { + return new MariaDb1027Platform(); + } + + if (! $mariadb) { + $oracleMysqlVersion = $this->getOracleMysqlVersionNumber($version); + if (version_compare($oracleMysqlVersion, '8', '>=')) { + return new MySQL80Platform(); + } + + if (version_compare($oracleMysqlVersion, '5.7.9', '>=')) { + return new MySQL57Platform(); + } + } + + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5060', + 'MySQL 5.6 support is deprecated and will be removed in DBAL 4.' + . ' Consider upgrading to MySQL 5.7 or later.', + ); + + return $this->getDatabasePlatform(); + } + + /** + * Get a normalized 'version number' from the server string + * returned by Oracle MySQL servers. + * + * @param string $versionString Version string returned by the driver, i.e. '5.7.10' + * + * @throws Exception + */ + private function getOracleMysqlVersionNumber(string $versionString): string + { + if ( + preg_match( + '/^(?P\d+)(?:\.(?P\d+)(?:\.(?P\d+))?)?/', + $versionString, + $versionParts, + ) === 0 + ) { + throw Exception::invalidPlatformVersionSpecified( + $versionString, + '..', + ); + } + + $majorVersion = $versionParts['major']; + $minorVersion = $versionParts['minor'] ?? 0; + $patchVersion = $versionParts['patch'] ?? null; + + if ($majorVersion === '5' && $minorVersion === '7') { + $patchVersion ??= '9'; + } + + return $majorVersion . '.' . $minorVersion . '.' . $patchVersion; + } + + /** + * Detect MariaDB server version, including hack for some mariadb distributions + * that starts with the prefix '5.5.5-' + * + * @param string $versionString Version string as returned by mariadb server, i.e. '5.5.5-Mariadb-10.0.8-xenial' + * + * @throws Exception + */ + private function getMariaDbMysqlVersionNumber(string $versionString): string + { + if ( + preg_match( + '/^(?:5\.5\.5-)?(mariadb-)?(?P\d+)\.(?P\d+)\.(?P\d+)/i', + $versionString, + $versionParts, + ) === 0 + ) { + throw Exception::invalidPlatformVersionSpecified( + $versionString, + '^(?:5\.5\.5-)?(mariadb-)?..', + ); + } + + return $versionParts['major'] . '.' . $versionParts['minor'] . '.' . $versionParts['patch']; + } + + /** + * {@inheritdoc} + * + * @return AbstractMySQLPlatform + */ + public function getDatabasePlatform() + { + return new MySQLPlatform(); + } + + /** + * {@inheritdoc} + * + * @deprecated Use {@link AbstractMySQLPlatform::createSchemaManager()} instead. + * + * @return MySQLSchemaManager + */ + public function getSchemaManager(Connection $conn, AbstractPlatform $platform) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5458', + 'AbstractMySQLDriver::getSchemaManager() is deprecated.' + . ' Use MySQLPlatform::createSchemaManager() instead.', + ); + + assert($platform instanceof AbstractMySQLPlatform); + + return new MySQLSchemaManager($conn, $platform); + } + + public function getExceptionConverter(): ExceptionConverter + { + return new MySQL\ExceptionConverter(); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/AbstractOracleDriver.php b/vendor/doctrine/dbal/src/Driver/AbstractOracleDriver.php new file mode 100644 index 00000000..d912109a --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/AbstractOracleDriver.php @@ -0,0 +1,65 @@ +string = $string; + } + + public function __toString(): string + { + return $this->string; + } + + /** + * Creates the object from an array representation + * + * @param mixed[] $params + */ + public static function fromArray(array $params): self + { + return new self(self::renderParams($params)); + } + + /** + * Creates the object from the given DBAL connection parameters. + * + * @param mixed[] $params + */ + public static function fromConnectionParameters(array $params): self + { + if (isset($params['connectstring'])) { + return new self($params['connectstring']); + } + + if (! isset($params['host'])) { + return new self($params['dbname'] ?? ''); + } + + $connectData = []; + + if (isset($params['servicename']) || isset($params['dbname'])) { + $serviceKey = 'SID'; + + if (isset($params['service'])) { + $serviceKey = 'SERVICE_NAME'; + } + + $serviceName = $params['servicename'] ?? $params['dbname']; + + $connectData[$serviceKey] = $serviceName; + } + + if (isset($params['instancename'])) { + $connectData['INSTANCE_NAME'] = $params['instancename']; + } + + if (! empty($params['pooled'])) { + $connectData['SERVER'] = 'POOLED'; + } + + return self::fromArray([ + 'DESCRIPTION' => [ + 'ADDRESS' => [ + 'PROTOCOL' => 'TCP', + 'HOST' => $params['host'], + 'PORT' => $params['port'] ?? 1521, + ], + 'CONNECT_DATA' => $connectData, + ], + ]); + } + + /** @param mixed[] $params */ + private static function renderParams(array $params): string + { + $chunks = []; + + foreach ($params as $key => $value) { + $string = self::renderValue($value); + + if ($string === '') { + continue; + } + + $chunks[] = sprintf('(%s=%s)', $key, $string); + } + + return implode('', $chunks); + } + + /** @param mixed $value */ + private static function renderValue($value): string + { + if (is_array($value)) { + return self::renderParams($value); + } + + return (string) $value; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/AbstractPostgreSQLDriver.php b/vendor/doctrine/dbal/src/Driver/AbstractPostgreSQLDriver.php new file mode 100644 index 00000000..69e4baff --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/AbstractPostgreSQLDriver.php @@ -0,0 +1,88 @@ +\d+)(?:\.(?P\d+)(?:\.(?P\d+))?)?/', $version, $versionParts) === 0) { + throw Exception::invalidPlatformVersionSpecified( + $version, + '..', + ); + } + + $majorVersion = $versionParts['major']; + $minorVersion = $versionParts['minor'] ?? 0; + $patchVersion = $versionParts['patch'] ?? 0; + $version = $majorVersion . '.' . $minorVersion . '.' . $patchVersion; + + if (version_compare($version, '10.0', '>=')) { + return new PostgreSQL100Platform(); + } + + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5060', + 'PostgreSQL 9 support is deprecated and will be removed in DBAL 4.' + . ' Consider upgrading to Postgres 10 or later.', + ); + + return new PostgreSQL94Platform(); + } + + /** + * {@inheritdoc} + */ + public function getDatabasePlatform() + { + return new PostgreSQL94Platform(); + } + + /** + * {@inheritdoc} + * + * @deprecated Use {@link PostgreSQLPlatform::createSchemaManager()} instead. + */ + public function getSchemaManager(Connection $conn, AbstractPlatform $platform) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5458', + 'AbstractPostgreSQLDriver::getSchemaManager() is deprecated.' + . ' Use PostgreSQLPlatform::createSchemaManager() instead.', + ); + + assert($platform instanceof PostgreSQLPlatform); + + return new PostgreSQLSchemaManager($conn, $platform); + } + + public function getExceptionConverter(): ExceptionConverter + { + return new PostgreSQL\ExceptionConverter(); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/AbstractSQLServerDriver.php b/vendor/doctrine/dbal/src/Driver/AbstractSQLServerDriver.php new file mode 100644 index 00000000..c5d79fee --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/AbstractSQLServerDriver.php @@ -0,0 +1,53 @@ +exec('PRAGMA foreign_keys=ON'); + + return $connection; + } + }; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/Connection.php b/vendor/doctrine/dbal/src/Driver/Connection.php new file mode 100644 index 00000000..2f460fd1 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/Connection.php @@ -0,0 +1,86 @@ +fetchNumeric(); + + if ($row === false) { + return false; + } + + return $row[0]; + } + + /** + * @return list> + * + * @throws Exception + */ + public static function fetchAllNumeric(Result $result): array + { + $rows = []; + + while (($row = $result->fetchNumeric()) !== false) { + $rows[] = $row; + } + + return $rows; + } + + /** + * @return list> + * + * @throws Exception + */ + public static function fetchAllAssociative(Result $result): array + { + $rows = []; + + while (($row = $result->fetchAssociative()) !== false) { + $rows[] = $row; + } + + return $rows; + } + + /** + * @return list + * + * @throws Exception + */ + public static function fetchFirstColumn(Result $result): array + { + $rows = []; + + while (($row = $result->fetchOne()) !== false) { + $rows[] = $row; + } + + return $rows; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/IBMDB2/Connection.php b/vendor/doctrine/dbal/src/Driver/IBMDB2/Connection.php new file mode 100644 index 00000000..6a2aa802 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/IBMDB2/Connection.php @@ -0,0 +1,151 @@ +connection = $connection; + } + + /** + * {@inheritdoc} + */ + public function getServerVersion() + { + $serverInfo = db2_server_info($this->connection); + assert($serverInfo instanceof stdClass); + + return $serverInfo->DBMS_VER; + } + + public function prepare(string $sql): DriverStatement + { + $stmt = @db2_prepare($this->connection, $sql); + + if ($stmt === false) { + throw PrepareFailed::new(error_get_last()); + } + + return new Statement($stmt); + } + + public function query(string $sql): ResultInterface + { + return $this->prepare($sql)->execute(); + } + + /** + * {@inheritdoc} + */ + public function quote($value, $type = ParameterType::STRING) + { + $value = db2_escape_string($value); + + if ($type === ParameterType::INTEGER) { + return $value; + } + + return "'" . $value . "'"; + } + + public function exec(string $sql): int + { + $stmt = @db2_exec($this->connection, $sql); + + if ($stmt === false) { + throw StatementError::new(); + } + + return db2_num_rows($stmt); + } + + /** + * {@inheritdoc} + */ + public function lastInsertId($name = null) + { + if ($name !== null) { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4687', + 'The usage of Connection::lastInsertId() with a sequence name is deprecated.', + ); + } + + return db2_last_insert_id($this->connection) ?? false; + } + + public function beginTransaction(): bool + { + $result = db2_autocommit($this->connection, DB2_AUTOCOMMIT_OFF); + assert(is_bool($result)); + + return $result; + } + + public function commit(): bool + { + if (! db2_commit($this->connection)) { + throw ConnectionError::new($this->connection); + } + + $result = db2_autocommit($this->connection, DB2_AUTOCOMMIT_ON); + assert(is_bool($result)); + + return $result; + } + + public function rollBack(): bool + { + if (! db2_rollback($this->connection)) { + throw ConnectionError::new($this->connection); + } + + $result = db2_autocommit($this->connection, DB2_AUTOCOMMIT_ON); + assert(is_bool($result)); + + return $result; + } + + /** @return resource */ + public function getNativeConnection() + { + return $this->connection; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/IBMDB2/DataSourceName.php b/vendor/doctrine/dbal/src/Driver/IBMDB2/DataSourceName.php new file mode 100644 index 00000000..6379efcf --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/IBMDB2/DataSourceName.php @@ -0,0 +1,76 @@ +string = $string; + } + + public function toString(): string + { + return $this->string; + } + + /** + * Creates the object from an array representation + * + * @param array $params + */ + public static function fromArray(array $params): self + { + $chunks = []; + + foreach ($params as $key => $value) { + $chunks[] = sprintf('%s=%s', $key, $value); + } + + return new self(implode(';', $chunks)); + } + + /** + * Creates the object from the given DBAL connection parameters. + * + * @param array $params + */ + public static function fromConnectionParameters(array $params): self + { + if (isset($params['dbname']) && strpos($params['dbname'], '=') !== false) { + return new self($params['dbname']); + } + + $dsnParams = []; + + foreach ( + [ + 'host' => 'HOSTNAME', + 'port' => 'PORT', + 'protocol' => 'PROTOCOL', + 'dbname' => 'DATABASE', + 'user' => 'UID', + 'password' => 'PWD', + ] as $dbalParam => $dsnParam + ) { + if (! isset($params[$dbalParam])) { + continue; + } + + $dsnParams[$dsnParam] = $params[$dbalParam]; + } + + return self::fromArray($dsnParams); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/IBMDB2/Driver.php b/vendor/doctrine/dbal/src/Driver/IBMDB2/Driver.php new file mode 100644 index 00000000..142b369b --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/IBMDB2/Driver.php @@ -0,0 +1,38 @@ +toString(); + + $username = $params['user'] ?? ''; + $password = $params['password'] ?? ''; + $driverOptions = $params['driverOptions'] ?? []; + + if (! empty($params['persistent'])) { + $connection = db2_pconnect($dataSourceName, $username, $password, $driverOptions); + } else { + $connection = db2_connect($dataSourceName, $username, $password, $driverOptions); + } + + if ($connection === false) { + throw ConnectionFailed::new(); + } + + return new Connection($connection); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/CannotCopyStreamToStream.php b/vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/CannotCopyStreamToStream.php new file mode 100644 index 00000000..231c9d47 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/CannotCopyStreamToStream.php @@ -0,0 +1,27 @@ +statement = $statement; + } + + /** + * {@inheritDoc} + */ + public function fetchNumeric() + { + $row = @db2_fetch_array($this->statement); + + if ($row === false && db2_stmt_error($this->statement) !== '02000') { + throw StatementError::new($this->statement); + } + + return $row; + } + + /** + * {@inheritDoc} + */ + public function fetchAssociative() + { + $row = @db2_fetch_assoc($this->statement); + + if ($row === false && db2_stmt_error($this->statement) !== '02000') { + throw StatementError::new($this->statement); + } + + return $row; + } + + /** + * {@inheritDoc} + */ + public function fetchOne() + { + return FetchUtils::fetchOne($this); + } + + /** + * {@inheritDoc} + */ + public function fetchAllNumeric(): array + { + return FetchUtils::fetchAllNumeric($this); + } + + /** + * {@inheritDoc} + */ + public function fetchAllAssociative(): array + { + return FetchUtils::fetchAllAssociative($this); + } + + /** + * {@inheritDoc} + */ + public function fetchFirstColumn(): array + { + return FetchUtils::fetchFirstColumn($this); + } + + public function rowCount(): int + { + return @db2_num_rows($this->statement); + } + + public function columnCount(): int + { + $count = db2_num_fields($this->statement); + + if ($count !== false) { + return $count; + } + + return 0; + } + + public function free(): void + { + db2_free_result($this->statement); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/IBMDB2/Statement.php b/vendor/doctrine/dbal/src/Driver/IBMDB2/Statement.php new file mode 100644 index 00000000..4cfb135d --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/IBMDB2/Statement.php @@ -0,0 +1,218 @@ + + */ + private array $lobs = []; + + /** + * @internal The statement can be only instantiated by its driver connection. + * + * @param resource $stmt + */ + public function __construct($stmt) + { + $this->stmt = $stmt; + } + + /** + * {@inheritdoc} + */ + public function bindValue($param, $value, $type = ParameterType::STRING): bool + { + assert(is_int($param)); + + if (func_num_args() < 3) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5558', + 'Not passing $type to Statement::bindValue() is deprecated.' + . ' Pass the type corresponding to the parameter being bound.', + ); + } + + return $this->bindParam($param, $value, $type); + } + + /** + * {@inheritdoc} + * + * @deprecated Use {@see bindValue()} instead. + */ + public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null): bool + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5563', + '%s is deprecated. Use bindValue() instead.', + __METHOD__, + ); + + assert(is_int($param)); + + if (func_num_args() < 3) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5558', + 'Not passing $type to Statement::bindParam() is deprecated.' + . ' Pass the type corresponding to the parameter being bound.', + ); + } + + switch ($type) { + case ParameterType::INTEGER: + $this->bind($param, $variable, DB2_PARAM_IN, DB2_LONG); + break; + + case ParameterType::LARGE_OBJECT: + $this->lobs[$param] = &$variable; + break; + + default: + $this->bind($param, $variable, DB2_PARAM_IN, DB2_CHAR); + break; + } + + return true; + } + + /** + * @param int $position Parameter position + * @param mixed $variable + * + * @throws Exception + */ + private function bind($position, &$variable, int $parameterType, int $dataType): void + { + $this->parameters[$position] =& $variable; + + if (! db2_bind_param($this->stmt, $position, '', $parameterType, $dataType)) { + throw StatementError::new($this->stmt); + } + } + + /** + * {@inheritdoc} + */ + public function execute($params = null): ResultInterface + { + if ($params !== null) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5556', + 'Passing $params to Statement::execute() is deprecated. Bind parameters using' + . ' Statement::bindParam() or Statement::bindValue() instead.', + ); + } + + $handles = $this->bindLobs(); + + $result = @db2_execute($this->stmt, $params ?? $this->parameters); + + foreach ($handles as $handle) { + fclose($handle); + } + + $this->lobs = []; + + if ($result === false) { + throw StatementError::new($this->stmt); + } + + return new Result($this->stmt); + } + + /** + * @return list + * + * @throws Exception + */ + private function bindLobs(): array + { + $handles = []; + + foreach ($this->lobs as $param => $value) { + if (is_resource($value)) { + $handle = $handles[] = $this->createTemporaryFile(); + $path = stream_get_meta_data($handle)['uri']; + + $this->copyStreamToStream($value, $handle); + + $this->bind($param, $path, DB2_PARAM_FILE, DB2_BINARY); + } else { + $this->bind($param, $value, DB2_PARAM_IN, DB2_CHAR); + } + } + + return $handles; + } + + /** + * @return resource + * + * @throws Exception + */ + private function createTemporaryFile() + { + $handle = @tmpfile(); + + if ($handle === false) { + throw CannotCreateTemporaryFile::new(error_get_last()); + } + + return $handle; + } + + /** + * @param resource $source + * @param resource $target + * + * @throws Exception + */ + private function copyStreamToStream($source, $target): void + { + if (@stream_copy_to_stream($source, $target) === false) { + throw CannotCopyStreamToStream::new(error_get_last()); + } + } +} diff --git a/vendor/doctrine/dbal/src/Driver/Middleware.php b/vendor/doctrine/dbal/src/Driver/Middleware.php new file mode 100644 index 00000000..4629d9a8 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/Middleware.php @@ -0,0 +1,12 @@ +wrappedConnection = $wrappedConnection; + } + + public function prepare(string $sql): Statement + { + return $this->wrappedConnection->prepare($sql); + } + + public function query(string $sql): Result + { + return $this->wrappedConnection->query($sql); + } + + /** + * {@inheritdoc} + */ + public function quote($value, $type = ParameterType::STRING) + { + return $this->wrappedConnection->quote($value, $type); + } + + public function exec(string $sql): int + { + return $this->wrappedConnection->exec($sql); + } + + /** + * {@inheritdoc} + */ + public function lastInsertId($name = null) + { + if ($name !== null) { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4687', + 'The usage of Connection::lastInsertId() with a sequence name is deprecated.', + ); + } + + return $this->wrappedConnection->lastInsertId($name); + } + + /** + * {@inheritdoc} + */ + public function beginTransaction() + { + return $this->wrappedConnection->beginTransaction(); + } + + /** + * {@inheritdoc} + */ + public function commit() + { + return $this->wrappedConnection->commit(); + } + + /** + * {@inheritdoc} + */ + public function rollBack() + { + return $this->wrappedConnection->rollBack(); + } + + /** + * {@inheritdoc} + */ + public function getServerVersion() + { + if (! $this->wrappedConnection instanceof ServerInfoAwareConnection) { + throw new LogicException('The underlying connection is not a ServerInfoAwareConnection'); + } + + return $this->wrappedConnection->getServerVersion(); + } + + /** @return resource|object */ + public function getNativeConnection() + { + if (! method_exists($this->wrappedConnection, 'getNativeConnection')) { + throw new LogicException(sprintf( + 'The driver connection %s does not support accessing the native connection.', + get_class($this->wrappedConnection), + )); + } + + return $this->wrappedConnection->getNativeConnection(); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/Middleware/AbstractDriverMiddleware.php b/vendor/doctrine/dbal/src/Driver/Middleware/AbstractDriverMiddleware.php new file mode 100644 index 00000000..6914176f --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/Middleware/AbstractDriverMiddleware.php @@ -0,0 +1,70 @@ +wrappedDriver = $wrappedDriver; + } + + /** + * {@inheritdoc} + */ + public function connect(array $params) + { + return $this->wrappedDriver->connect($params); + } + + /** + * {@inheritdoc} + */ + public function getDatabasePlatform() + { + return $this->wrappedDriver->getDatabasePlatform(); + } + + /** + * {@inheritdoc} + * + * @deprecated Use {@link AbstractPlatform::createSchemaManager()} instead. + */ + public function getSchemaManager(Connection $conn, AbstractPlatform $platform) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5458', + 'AbstractDriverMiddleware::getSchemaManager() is deprecated.' + . ' Use AbstractPlatform::createSchemaManager() instead.', + ); + + return $this->wrappedDriver->getSchemaManager($conn, $platform); + } + + public function getExceptionConverter(): ExceptionConverter + { + return $this->wrappedDriver->getExceptionConverter(); + } + + /** + * {@inheritdoc} + */ + public function createDatabasePlatformForVersion($version) + { + if ($this->wrappedDriver instanceof VersionAwarePlatformDriver) { + return $this->wrappedDriver->createDatabasePlatformForVersion($version); + } + + return $this->wrappedDriver->getDatabasePlatform(); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/Middleware/AbstractResultMiddleware.php b/vendor/doctrine/dbal/src/Driver/Middleware/AbstractResultMiddleware.php new file mode 100644 index 00000000..de90207b --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/Middleware/AbstractResultMiddleware.php @@ -0,0 +1,78 @@ +wrappedResult = $result; + } + + /** + * {@inheritdoc} + */ + public function fetchNumeric() + { + return $this->wrappedResult->fetchNumeric(); + } + + /** + * {@inheritdoc} + */ + public function fetchAssociative() + { + return $this->wrappedResult->fetchAssociative(); + } + + /** + * {@inheritdoc} + */ + public function fetchOne() + { + return $this->wrappedResult->fetchOne(); + } + + /** + * {@inheritdoc} + */ + public function fetchAllNumeric(): array + { + return $this->wrappedResult->fetchAllNumeric(); + } + + /** + * {@inheritdoc} + */ + public function fetchAllAssociative(): array + { + return $this->wrappedResult->fetchAllAssociative(); + } + + /** + * {@inheritdoc} + */ + public function fetchFirstColumn(): array + { + return $this->wrappedResult->fetchFirstColumn(); + } + + public function rowCount(): int + { + return $this->wrappedResult->rowCount(); + } + + public function columnCount(): int + { + return $this->wrappedResult->columnCount(); + } + + public function free(): void + { + $this->wrappedResult->free(); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/Middleware/AbstractStatementMiddleware.php b/vendor/doctrine/dbal/src/Driver/Middleware/AbstractStatementMiddleware.php new file mode 100644 index 00000000..70e8df63 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/Middleware/AbstractStatementMiddleware.php @@ -0,0 +1,71 @@ +wrappedStatement = $wrappedStatement; + } + + /** + * {@inheritdoc} + */ + public function bindValue($param, $value, $type = ParameterType::STRING) + { + if (func_num_args() < 3) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5558', + 'Not passing $type to Statement::bindValue() is deprecated.' + . ' Pass the type corresponding to the parameter being bound.', + ); + } + + return $this->wrappedStatement->bindValue($param, $value, $type); + } + + /** + * {@inheritdoc} + * + * @deprecated Use {@see bindValue()} instead. + */ + public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5563', + '%s is deprecated. Use bindValue() instead.', + __METHOD__, + ); + + if (func_num_args() < 3) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5558', + 'Not passing $type to Statement::bindParam() is deprecated.' + . ' Pass the type corresponding to the parameter being bound.', + ); + } + + return $this->wrappedStatement->bindParam($param, $variable, $type, $length); + } + + /** + * {@inheritdoc} + */ + public function execute($params = null): Result + { + return $this->wrappedStatement->execute($params); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/Mysqli/Connection.php b/vendor/doctrine/dbal/src/Driver/Mysqli/Connection.php new file mode 100644 index 00000000..78112d82 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/Mysqli/Connection.php @@ -0,0 +1,141 @@ +connection = $connection; + } + + /** + * Retrieves mysqli native resource handle. + * + * Could be used if part of your application is not using DBAL. + * + * @deprecated Call {@see getNativeConnection()} instead. + */ + public function getWrappedResourceHandle(): mysqli + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5037', + '%s is deprecated, call getNativeConnection() instead.', + __METHOD__, + ); + + return $this->getNativeConnection(); + } + + public function getServerVersion(): string + { + return $this->connection->get_server_info(); + } + + public function prepare(string $sql): DriverStatement + { + try { + $stmt = $this->connection->prepare($sql); + } catch (mysqli_sql_exception $e) { + throw ConnectionError::upcast($e); + } + + if ($stmt === false) { + throw ConnectionError::new($this->connection); + } + + return new Statement($stmt); + } + + public function query(string $sql): ResultInterface + { + return $this->prepare($sql)->execute(); + } + + /** + * {@inheritdoc} + */ + public function quote($value, $type = ParameterType::STRING) + { + return "'" . $this->connection->escape_string($value) . "'"; + } + + public function exec(string $sql): int + { + try { + $result = $this->connection->query($sql); + } catch (mysqli_sql_exception $e) { + throw ConnectionError::upcast($e); + } + + if ($result === false) { + throw ConnectionError::new($this->connection); + } + + return $this->connection->affected_rows; + } + + /** + * {@inheritdoc} + */ + public function lastInsertId($name = null) + { + if ($name !== null) { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4687', + 'The usage of Connection::lastInsertId() with a sequence name is deprecated.', + ); + } + + return $this->connection->insert_id; + } + + public function beginTransaction(): bool + { + $this->connection->begin_transaction(); + + return true; + } + + public function commit(): bool + { + try { + return $this->connection->commit(); + } catch (mysqli_sql_exception $e) { + return false; + } + } + + public function rollBack(): bool + { + try { + return $this->connection->rollback(); + } catch (mysqli_sql_exception $e) { + return false; + } + } + + public function getNativeConnection(): mysqli + { + return $this->connection; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/Mysqli/Driver.php b/vendor/doctrine/dbal/src/Driver/Mysqli/Driver.php new file mode 100644 index 00000000..af305230 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/Mysqli/Driver.php @@ -0,0 +1,140 @@ +withOptions($preInitializers, $driverOptions); + } + + $preInitializers = $this->withSecure($preInitializers, $params); + $postInitializers = $this->withCharset($postInitializers, $params); + + $connection = new mysqli(); + + foreach ($preInitializers as $initializer) { + $initializer->initialize($connection); + } + + try { + $success = @$connection->real_connect( + $host, + $params['user'] ?? null, + $params['password'] ?? null, + $params['dbname'] ?? null, + $params['port'] ?? null, + $params['unix_socket'] ?? null, + $flags, + ); + } catch (mysqli_sql_exception $e) { + throw ConnectionFailed::upcast($e); + } + + if (! $success) { + throw ConnectionFailed::new($connection); + } + + foreach ($postInitializers as $initializer) { + $initializer->initialize($connection); + } + + return new Connection($connection); + } + + /** + * @param list $initializers + * @param array $options + * + * @return list + */ + private function withOptions(array $initializers, array $options): array + { + if (count($options) !== 0) { + $initializers[] = new Options($options); + } + + return $initializers; + } + + /** + * @param list $initializers + * @param array $params + * + * @return list + */ + private function withSecure(array $initializers, array $params): array + { + if ( + isset($params['ssl_key']) || + isset($params['ssl_cert']) || + isset($params['ssl_ca']) || + isset($params['ssl_capath']) || + isset($params['ssl_cipher']) + ) { + $initializers[] = new Secure( + $params['ssl_key'] ?? '', + $params['ssl_cert'] ?? '', + $params['ssl_ca'] ?? '', + $params['ssl_capath'] ?? '', + $params['ssl_cipher'] ?? '', + ); + } + + return $initializers; + } + + /** + * @param list $initializers + * @param array $params + * + * @return list + */ + private function withCharset(array $initializers, array $params): array + { + if (isset($params['charset'])) { + $initializers[] = new Charset($params['charset']); + } + + return $initializers; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionError.php b/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionError.php new file mode 100644 index 00000000..ef5b9801 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionError.php @@ -0,0 +1,31 @@ +error, $connection->sqlstate, $connection->errno); + } + + public static function upcast(mysqli_sql_exception $exception): self + { + $p = new ReflectionProperty(mysqli_sql_exception::class, 'sqlstate'); + $p->setAccessible(true); + + return new self($exception->getMessage(), $p->getValue($exception), (int) $exception->getCode(), $exception); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionFailed.php b/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionFailed.php new file mode 100644 index 00000000..44a8cab9 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionFailed.php @@ -0,0 +1,36 @@ +connect_error; + assert($error !== null); + + return new self($error, 'HY000', $connection->connect_errno); + } + + public static function upcast(mysqli_sql_exception $exception): self + { + $p = new ReflectionProperty(mysqli_sql_exception::class, 'sqlstate'); + $p->setAccessible(true); + + return new self($exception->getMessage(), $p->getValue($exception), (int) $exception->getCode(), $exception); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/FailedReadingStreamOffset.php b/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/FailedReadingStreamOffset.php new file mode 100644 index 00000000..6f26dbec --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/FailedReadingStreamOffset.php @@ -0,0 +1,22 @@ +error), + $connection->sqlstate, + $connection->errno, + ); + } + + public static function upcast(mysqli_sql_exception $exception, string $charset): self + { + $p = new ReflectionProperty(mysqli_sql_exception::class, 'sqlstate'); + $p->setAccessible(true); + + return new self( + sprintf('Failed to set charset "%s": %s', $charset, $exception->getMessage()), + $p->getValue($exception), + (int) $exception->getCode(), + $exception, + ); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/InvalidOption.php b/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/InvalidOption.php new file mode 100644 index 00000000..6fb46316 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/InvalidOption.php @@ -0,0 +1,25 @@ +error, $statement->sqlstate, $statement->errno); + } + + public static function upcast(mysqli_sql_exception $exception): self + { + $p = new ReflectionProperty(mysqli_sql_exception::class, 'sqlstate'); + $p->setAccessible(true); + + return new self($exception->getMessage(), $p->getValue($exception), (int) $exception->getCode(), $exception); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer.php b/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer.php new file mode 100644 index 00000000..efab67e2 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer.php @@ -0,0 +1,14 @@ +charset = $charset; + } + + public function initialize(mysqli $connection): void + { + try { + $success = $connection->set_charset($this->charset); + } catch (mysqli_sql_exception $e) { + throw InvalidCharset::upcast($e, $this->charset); + } + + if ($success) { + return; + } + + throw InvalidCharset::fromCharset($connection, $this->charset); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer/Options.php b/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer/Options.php new file mode 100644 index 00000000..2e66f8d6 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer/Options.php @@ -0,0 +1,32 @@ + */ + private array $options; + + /** @param array $options */ + public function __construct(array $options) + { + $this->options = $options; + } + + public function initialize(mysqli $connection): void + { + foreach ($this->options as $option => $value) { + if (! mysqli_options($connection, $option, $value)) { + throw InvalidOption::fromOption($option, $value); + } + } + } +} diff --git a/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer/Secure.php b/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer/Secure.php new file mode 100644 index 00000000..643475e5 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer/Secure.php @@ -0,0 +1,31 @@ +key = $key; + $this->cert = $cert; + $this->ca = $ca; + $this->capath = $capath; + $this->cipher = $cipher; + } + + public function initialize(mysqli $connection): void + { + $connection->ssl_set($this->key, $this->cert, $this->ca, $this->capath, $this->cipher); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/Mysqli/Result.php b/vendor/doctrine/dbal/src/Driver/Mysqli/Result.php new file mode 100644 index 00000000..c096e6d7 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/Mysqli/Result.php @@ -0,0 +1,179 @@ + + */ + private array $columnNames = []; + + /** @var mixed[] */ + private array $boundValues = []; + + /** + * @internal The result can be only instantiated by its driver connection or statement. + * + * @throws Exception + */ + public function __construct(mysqli_stmt $statement) + { + $this->statement = $statement; + + $meta = $statement->result_metadata(); + + if ($meta === false) { + return; + } + + $this->hasColumns = true; + + $this->columnNames = array_column($meta->fetch_fields(), 'name'); + + $meta->free(); + + // Store result of every execution which has it. Otherwise it will be impossible + // to execute a new statement in case if the previous one has non-fetched rows + // @link http://dev.mysql.com/doc/refman/5.7/en/commands-out-of-sync.html + $this->statement->store_result(); + + // Bind row values _after_ storing the result. Otherwise, if mysqli is compiled with libmysql, + // it will have to allocate as much memory as it may be needed for the given column type + // (e.g. for a LONGBLOB column it's 4 gigabytes) + // @link https://bugs.php.net/bug.php?id=51386#1270673122 + // + // Make sure that the values are bound after each execution. Otherwise, if free() has been + // previously called on the result, the values are unbound making the statement unusable. + // + // It's also important that row values are bound after _each_ call to store_result(). Otherwise, + // if mysqli is compiled with libmysql, subsequently fetched string values will get truncated + // to the length of the ones fetched during the previous execution. + $this->boundValues = array_fill(0, count($this->columnNames), null); + + // The following is necessary as PHP cannot handle references to properties properly + $refs = &$this->boundValues; + + if (! $this->statement->bind_result(...$refs)) { + throw StatementError::new($this->statement); + } + } + + /** + * {@inheritdoc} + */ + public function fetchNumeric() + { + try { + $ret = $this->statement->fetch(); + } catch (mysqli_sql_exception $e) { + throw StatementError::upcast($e); + } + + if ($ret === false) { + throw StatementError::new($this->statement); + } + + if ($ret === null) { + return false; + } + + $values = []; + + foreach ($this->boundValues as $v) { + $values[] = $v; + } + + return $values; + } + + /** + * {@inheritDoc} + */ + public function fetchAssociative() + { + $values = $this->fetchNumeric(); + + if ($values === false) { + return false; + } + + return array_combine($this->columnNames, $values); + } + + /** + * {@inheritdoc} + */ + public function fetchOne() + { + return FetchUtils::fetchOne($this); + } + + /** + * {@inheritdoc} + */ + public function fetchAllNumeric(): array + { + return FetchUtils::fetchAllNumeric($this); + } + + /** + * {@inheritdoc} + */ + public function fetchAllAssociative(): array + { + return FetchUtils::fetchAllAssociative($this); + } + + /** + * {@inheritdoc} + */ + public function fetchFirstColumn(): array + { + return FetchUtils::fetchFirstColumn($this); + } + + public function rowCount(): int + { + if ($this->hasColumns) { + return $this->statement->num_rows; + } + + return $this->statement->affected_rows; + } + + public function columnCount(): int + { + return $this->statement->field_count; + } + + public function free(): void + { + $this->statement->free_result(); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/Mysqli/Statement.php b/vendor/doctrine/dbal/src/Driver/Mysqli/Statement.php new file mode 100644 index 00000000..7b7c9312 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/Mysqli/Statement.php @@ -0,0 +1,236 @@ + 's', + ParameterType::STRING => 's', + ParameterType::BINARY => 's', + ParameterType::BOOLEAN => 'i', + ParameterType::NULL => 's', + ParameterType::INTEGER => 'i', + ParameterType::LARGE_OBJECT => 'b', + ]; + + private mysqli_stmt $stmt; + + /** @var mixed[] */ + private array $boundValues; + + private string $types; + + /** + * Contains ref values for bindValue(). + * + * @var mixed[] + */ + private array $values = []; + + /** @internal The statement can be only instantiated by its driver connection. */ + public function __construct(mysqli_stmt $stmt) + { + $this->stmt = $stmt; + + $paramCount = $this->stmt->param_count; + $this->types = str_repeat('s', $paramCount); + $this->boundValues = array_fill(1, $paramCount, null); + } + + /** + * {@inheritdoc} + * + * @deprecated Use {@see bindValue()} instead. + */ + public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null): bool + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5563', + '%s is deprecated. Use bindValue() instead.', + __METHOD__, + ); + + assert(is_int($param)); + + if (func_num_args() < 3) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5558', + 'Not passing $type to Statement::bindParam() is deprecated.' + . ' Pass the type corresponding to the parameter being bound.', + ); + } + + if (! isset(self::$paramTypeMap[$type])) { + throw UnknownParameterType::new($type); + } + + $this->boundValues[$param] =& $variable; + $this->types[$param - 1] = self::$paramTypeMap[$type]; + + return true; + } + + /** + * {@inheritdoc} + */ + public function bindValue($param, $value, $type = ParameterType::STRING): bool + { + assert(is_int($param)); + + if (func_num_args() < 3) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5558', + 'Not passing $type to Statement::bindValue() is deprecated.' + . ' Pass the type corresponding to the parameter being bound.', + ); + } + + if (! isset(self::$paramTypeMap[$type])) { + throw UnknownParameterType::new($type); + } + + $this->values[$param] = $value; + $this->boundValues[$param] =& $this->values[$param]; + $this->types[$param - 1] = self::$paramTypeMap[$type]; + + return true; + } + + /** + * {@inheritdoc} + */ + public function execute($params = null): ResultInterface + { + if ($params !== null) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5556', + 'Passing $params to Statement::execute() is deprecated. Bind parameters using' + . ' Statement::bindParam() or Statement::bindValue() instead.', + ); + } + + if ($params !== null && count($params) > 0) { + if (! $this->bindUntypedValues($params)) { + throw StatementError::new($this->stmt); + } + } elseif (count($this->boundValues) > 0) { + $this->bindTypedParameters(); + } + + try { + $result = $this->stmt->execute(); + } catch (mysqli_sql_exception $e) { + throw StatementError::upcast($e); + } + + if (! $result) { + throw StatementError::new($this->stmt); + } + + return new Result($this->stmt); + } + + /** + * Binds parameters with known types previously bound to the statement + * + * @throws Exception + */ + private function bindTypedParameters(): void + { + $streams = $values = []; + $types = $this->types; + + foreach ($this->boundValues as $parameter => $value) { + assert(is_int($parameter)); + + if (! isset($types[$parameter - 1])) { + $types[$parameter - 1] = self::$paramTypeMap[ParameterType::STRING]; + } + + if ($types[$parameter - 1] === self::$paramTypeMap[ParameterType::LARGE_OBJECT]) { + if (is_resource($value)) { + if (get_resource_type($value) !== 'stream') { + throw NonStreamResourceUsedAsLargeObject::new($parameter); + } + + $streams[$parameter] = $value; + $values[$parameter] = null; + continue; + } + + $types[$parameter - 1] = self::$paramTypeMap[ParameterType::STRING]; + } + + $values[$parameter] = $value; + } + + if (! $this->stmt->bind_param($types, ...$values)) { + throw StatementError::new($this->stmt); + } + + $this->sendLongData($streams); + } + + /** + * Handle $this->_longData after regular query parameters have been bound + * + * @param array $streams + * + * @throws Exception + */ + private function sendLongData(array $streams): void + { + foreach ($streams as $paramNr => $stream) { + while (! feof($stream)) { + $chunk = fread($stream, 8192); + + if ($chunk === false) { + throw FailedReadingStreamOffset::new($paramNr); + } + + if (! $this->stmt->send_long_data($paramNr - 1, $chunk)) { + throw StatementError::new($this->stmt); + } + } + } + } + + /** + * Binds a array of values to bound parameters. + * + * @param mixed[] $values + */ + private function bindUntypedValues(array $values): bool + { + return $this->stmt->bind_param(str_repeat('s', count($values)), ...$values); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/OCI8/Connection.php b/vendor/doctrine/dbal/src/Driver/OCI8/Connection.php new file mode 100644 index 00000000..da4f61ae --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/OCI8/Connection.php @@ -0,0 +1,170 @@ +connection = $connection; + $this->parser = new Parser(false); + $this->executionMode = new ExecutionMode(); + } + + public function getServerVersion(): string + { + $version = oci_server_version($this->connection); + + if ($version === false) { + throw Error::new($this->connection); + } + + $result = preg_match('/\s+(\d+\.\d+\.\d+\.\d+\.\d+)\s+/', $version, $matches); + assert($result === 1); + + return $matches[1]; + } + + /** @throws Parser\Exception */ + public function prepare(string $sql): DriverStatement + { + $visitor = new ConvertPositionalToNamedPlaceholders(); + + $this->parser->parse($sql, $visitor); + + $statement = oci_parse($this->connection, $visitor->getSQL()); + assert(is_resource($statement)); + + return new Statement($this->connection, $statement, $visitor->getParameterMap(), $this->executionMode); + } + + /** + * @throws Exception + * @throws Parser\Exception + */ + public function query(string $sql): ResultInterface + { + return $this->prepare($sql)->execute(); + } + + /** + * {@inheritdoc} + */ + public function quote($value, $type = ParameterType::STRING) + { + if (is_int($value) || is_float($value)) { + return $value; + } + + $value = str_replace("'", "''", $value); + + return "'" . addcslashes($value, "\000\n\r\\\032") . "'"; + } + + /** + * @throws Exception + * @throws Parser\Exception + */ + public function exec(string $sql): int + { + return $this->prepare($sql)->execute()->rowCount(); + } + + /** + * {@inheritdoc} + * + * @param string|null $name + * + * @return int|false + * + * @throws Parser\Exception + */ + public function lastInsertId($name = null) + { + if ($name === null) { + return false; + } + + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4687', + 'The usage of Connection::lastInsertId() with a sequence name is deprecated.', + ); + + $result = $this->query('SELECT ' . $name . '.CURRVAL FROM DUAL')->fetchOne(); + + if ($result === false) { + throw SequenceDoesNotExist::new(); + } + + return (int) $result; + } + + public function beginTransaction(): bool + { + $this->executionMode->disableAutoCommit(); + + return true; + } + + public function commit(): bool + { + if (! oci_commit($this->connection)) { + throw Error::new($this->connection); + } + + $this->executionMode->enableAutoCommit(); + + return true; + } + + public function rollBack(): bool + { + if (! oci_rollback($this->connection)) { + throw Error::new($this->connection); + } + + $this->executionMode->enableAutoCommit(); + + return true; + } + + /** @return resource */ + public function getNativeConnection() + { + return $this->connection; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/OCI8/ConvertPositionalToNamedPlaceholders.php b/vendor/doctrine/dbal/src/Driver/OCI8/ConvertPositionalToNamedPlaceholders.php new file mode 100644 index 00000000..e2a11262 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/OCI8/ConvertPositionalToNamedPlaceholders.php @@ -0,0 +1,56 @@ +). + * + * Oracle does not support positional parameters, hence this method converts all + * positional parameters into artificially named parameters. + * + * @internal This class is not covered by the backward compatibility promise + */ +final class ConvertPositionalToNamedPlaceholders implements Visitor +{ + /** @var list */ + private array $buffer = []; + + /** @var array */ + private array $parameterMap = []; + + public function acceptOther(string $sql): void + { + $this->buffer[] = $sql; + } + + public function acceptPositionalParameter(string $sql): void + { + $position = count($this->parameterMap) + 1; + $param = ':param' . $position; + + $this->parameterMap[$position] = $param; + + $this->buffer[] = $param; + } + + public function acceptNamedParameter(string $sql): void + { + $this->buffer[] = $sql; + } + + public function getSQL(): string + { + return implode('', $this->buffer); + } + + /** @return array */ + public function getParameterMap(): array + { + return $this->parameterMap; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/OCI8/Driver.php b/vendor/doctrine/dbal/src/Driver/OCI8/Driver.php new file mode 100644 index 00000000..48ef0bbe --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/OCI8/Driver.php @@ -0,0 +1,44 @@ +getEasyConnectString($params); + + if (! empty($params['persistent'])) { + $connection = @oci_pconnect($username, $password, $connectionString, $charset, $sessionMode); + } else { + $connection = @oci_connect($username, $password, $connectionString, $charset, $sessionMode); + } + + if ($connection === false) { + throw ConnectionFailed::new(); + } + + return new Connection($connection); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/OCI8/Exception/ConnectionFailed.php b/vendor/doctrine/dbal/src/Driver/OCI8/Exception/ConnectionFailed.php new file mode 100644 index 00000000..cefe9a3a --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/OCI8/Exception/ConnectionFailed.php @@ -0,0 +1,26 @@ +isAutoCommitEnabled = true; + } + + public function disableAutoCommit(): void + { + $this->isAutoCommitEnabled = false; + } + + public function isAutoCommitEnabled(): bool + { + return $this->isAutoCommitEnabled; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/OCI8/Middleware/InitializeSession.php b/vendor/doctrine/dbal/src/Driver/OCI8/Middleware/InitializeSession.php new file mode 100644 index 00000000..30896a23 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/OCI8/Middleware/InitializeSession.php @@ -0,0 +1,36 @@ +exec( + 'ALTER SESSION SET' + . " NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'" + . " NLS_TIME_FORMAT = 'HH24:MI:SS'" + . " NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'" + . " NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS'" + . " NLS_TIMESTAMP_TZ_FORMAT = 'YYYY-MM-DD HH24:MI:SS TZH:TZM'" + . " NLS_NUMERIC_CHARACTERS = '.,'", + ); + + return $connection; + } + }; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/OCI8/Result.php b/vendor/doctrine/dbal/src/Driver/OCI8/Result.php new file mode 100644 index 00000000..08add4fa --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/OCI8/Result.php @@ -0,0 +1,145 @@ +statement = $statement; + } + + /** + * {@inheritDoc} + */ + public function fetchNumeric() + { + return $this->fetch(OCI_NUM); + } + + /** + * {@inheritDoc} + */ + public function fetchAssociative() + { + return $this->fetch(OCI_ASSOC); + } + + /** + * {@inheritDoc} + */ + public function fetchOne() + { + return FetchUtils::fetchOne($this); + } + + /** + * {@inheritDoc} + */ + public function fetchAllNumeric(): array + { + return $this->fetchAll(OCI_NUM, OCI_FETCHSTATEMENT_BY_ROW); + } + + /** + * {@inheritDoc} + */ + public function fetchAllAssociative(): array + { + return $this->fetchAll(OCI_ASSOC, OCI_FETCHSTATEMENT_BY_ROW); + } + + /** + * {@inheritDoc} + */ + public function fetchFirstColumn(): array + { + return $this->fetchAll(OCI_NUM, OCI_FETCHSTATEMENT_BY_COLUMN)[0]; + } + + public function rowCount(): int + { + $count = oci_num_rows($this->statement); + + if ($count !== false) { + return $count; + } + + return 0; + } + + public function columnCount(): int + { + $count = oci_num_fields($this->statement); + + if ($count !== false) { + return $count; + } + + return 0; + } + + public function free(): void + { + oci_cancel($this->statement); + } + + /** + * @return mixed|false + * + * @throws Exception + */ + private function fetch(int $mode) + { + $result = oci_fetch_array($this->statement, $mode | OCI_RETURN_NULLS | OCI_RETURN_LOBS); + + if ($result === false && oci_error($this->statement) !== false) { + throw Error::new($this->statement); + } + + return $result; + } + + /** @return array */ + private function fetchAll(int $mode, int $fetchStructure): array + { + oci_fetch_all( + $this->statement, + $result, + 0, + -1, + $mode | OCI_RETURN_NULLS | $fetchStructure | OCI_RETURN_LOBS, + ); + + return $result; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/OCI8/Statement.php b/vendor/doctrine/dbal/src/Driver/OCI8/Statement.php new file mode 100644 index 00000000..e707f721 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/OCI8/Statement.php @@ -0,0 +1,174 @@ + */ + private array $parameterMap; + + private ExecutionMode $executionMode; + + /** + * @internal The statement can be only instantiated by its driver connection. + * + * @param resource $connection + * @param resource $statement + * @param array $parameterMap + */ + public function __construct($connection, $statement, array $parameterMap, ExecutionMode $executionMode) + { + $this->connection = $connection; + $this->statement = $statement; + $this->parameterMap = $parameterMap; + $this->executionMode = $executionMode; + } + + /** + * {@inheritdoc} + */ + public function bindValue($param, $value, $type = ParameterType::STRING): bool + { + if (func_num_args() < 3) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5558', + 'Not passing $type to Statement::bindValue() is deprecated.' + . ' Pass the type corresponding to the parameter being bound.', + ); + } + + return $this->bindParam($param, $value, $type); + } + + /** + * {@inheritdoc} + * + * @deprecated Use {@see bindValue()} instead. + */ + public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null): bool + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5563', + '%s is deprecated. Use bindValue() instead.', + __METHOD__, + ); + + if (func_num_args() < 3) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5558', + 'Not passing $type to Statement::bindParam() is deprecated.' + . ' Pass the type corresponding to the parameter being bound.', + ); + } + + if (is_int($param)) { + if (! isset($this->parameterMap[$param])) { + throw UnknownParameterIndex::new($param); + } + + $param = $this->parameterMap[$param]; + } + + if ($type === ParameterType::LARGE_OBJECT) { + if ($variable !== null) { + $lob = oci_new_descriptor($this->connection, OCI_D_LOB); + $lob->writeTemporary($variable, OCI_TEMP_BLOB); + + $variable =& $lob; + } else { + $type = ParameterType::STRING; + } + } + + return oci_bind_by_name( + $this->statement, + $param, + $variable, + $length ?? -1, + $this->convertParameterType($type), + ); + } + + /** + * Converts DBAL parameter type to oci8 parameter type + */ + private function convertParameterType(int $type): int + { + switch ($type) { + case ParameterType::BINARY: + return OCI_B_BIN; + + case ParameterType::LARGE_OBJECT: + return OCI_B_BLOB; + + default: + return SQLT_CHR; + } + } + + /** + * {@inheritdoc} + */ + public function execute($params = null): ResultInterface + { + if ($params !== null) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5556', + 'Passing $params to Statement::execute() is deprecated. Bind parameters using' + . ' Statement::bindParam() or Statement::bindValue() instead.', + ); + + foreach ($params as $key => $val) { + if (is_int($key)) { + $this->bindValue($key + 1, $val, ParameterType::STRING); + } else { + $this->bindValue($key, $val, ParameterType::STRING); + } + } + } + + if ($this->executionMode->isAutoCommitEnabled()) { + $mode = OCI_COMMIT_ON_SUCCESS; + } else { + $mode = OCI_NO_AUTO_COMMIT; + } + + $ret = @oci_execute($this->statement, $mode); + if (! $ret) { + throw Error::new($this->statement); + } + + return new Result($this->statement); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/PDO/Connection.php b/vendor/doctrine/dbal/src/Driver/PDO/Connection.php new file mode 100644 index 00000000..e0b6221f --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/PDO/Connection.php @@ -0,0 +1,140 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + + $this->connection = $connection; + } + + public function exec(string $sql): int + { + try { + $result = $this->connection->exec($sql); + + assert($result !== false); + + return $result; + } catch (PDOException $exception) { + throw Exception::new($exception); + } + } + + /** + * {@inheritdoc} + */ + public function getServerVersion() + { + return $this->connection->getAttribute(PDO::ATTR_SERVER_VERSION); + } + + /** + * {@inheritDoc} + * + * @return Statement + */ + public function prepare(string $sql): StatementInterface + { + try { + $stmt = $this->connection->prepare($sql); + assert($stmt instanceof PDOStatement); + + return new Statement($stmt); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + } + + public function query(string $sql): ResultInterface + { + try { + $stmt = $this->connection->query($sql); + assert($stmt instanceof PDOStatement); + + return new Result($stmt); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + } + + /** + * {@inheritdoc} + */ + public function quote($value, $type = ParameterType::STRING) + { + return $this->connection->quote($value, $type); + } + + /** + * {@inheritdoc} + */ + public function lastInsertId($name = null) + { + try { + if ($name === null) { + return $this->connection->lastInsertId(); + } + + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4687', + 'The usage of Connection::lastInsertId() with a sequence name is deprecated.', + ); + + return $this->connection->lastInsertId($name); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + } + + public function beginTransaction(): bool + { + return $this->connection->beginTransaction(); + } + + public function commit(): bool + { + return $this->connection->commit(); + } + + public function rollBack(): bool + { + return $this->connection->rollBack(); + } + + public function getNativeConnection(): PDO + { + return $this->connection; + } + + /** @deprecated Call {@see getNativeConnection()} instead. */ + public function getWrappedConnection(): PDO + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5037', + '%s is deprecated, call getNativeConnection() instead.', + __METHOD__, + ); + + return $this->getNativeConnection(); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/PDO/Exception.php b/vendor/doctrine/dbal/src/Driver/PDO/Exception.php new file mode 100644 index 00000000..fbb81253 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/PDO/Exception.php @@ -0,0 +1,30 @@ +errorInfo !== null) { + [$sqlState, $code] = $exception->errorInfo; + + $code ??= 0; + } else { + $code = $exception->getCode(); + $sqlState = null; + } + + return new self($exception->getMessage(), $sqlState, $code, $exception); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php b/vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php new file mode 100644 index 00000000..505b0fa6 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php @@ -0,0 +1,70 @@ +constructPdoDsn($params), + $params['user'] ?? '', + $params['password'] ?? '', + $driverOptions, + ); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + + return new Connection($pdo); + } + + /** + * Constructs the MySQL PDO DSN. + * + * @param mixed[] $params + */ + private function constructPdoDsn(array $params): string + { + $dsn = 'mysql:'; + if (isset($params['host']) && $params['host'] !== '') { + $dsn .= 'host=' . $params['host'] . ';'; + } + + if (isset($params['port'])) { + $dsn .= 'port=' . $params['port'] . ';'; + } + + if (isset($params['dbname'])) { + $dsn .= 'dbname=' . $params['dbname'] . ';'; + } + + if (isset($params['unix_socket'])) { + $dsn .= 'unix_socket=' . $params['unix_socket'] . ';'; + } + + if (isset($params['charset'])) { + $dsn .= 'charset=' . $params['charset'] . ';'; + } + + return $dsn; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/PDO/OCI/Driver.php b/vendor/doctrine/dbal/src/Driver/PDO/OCI/Driver.php new file mode 100644 index 00000000..fb9944bb --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/PDO/OCI/Driver.php @@ -0,0 +1,55 @@ +constructPdoDsn($params), + $params['user'] ?? '', + $params['password'] ?? '', + $driverOptions, + ); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + + return new Connection($pdo); + } + + /** + * Constructs the Oracle PDO DSN. + * + * @param mixed[] $params + */ + private function constructPdoDsn(array $params): string + { + $dsn = 'oci:dbname=' . $this->getEasyConnectString($params); + + if (isset($params['charset'])) { + $dsn .= ';charset=' . $params['charset']; + } + + return $dsn; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/PDO/PgSQL/Driver.php b/vendor/doctrine/dbal/src/Driver/PDO/PgSQL/Driver.php new file mode 100644 index 00000000..caa9cd60 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/PDO/PgSQL/Driver.php @@ -0,0 +1,125 @@ +constructPdoDsn($params), + $params['user'] ?? '', + $params['password'] ?? '', + $driverOptions, + ); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + + if ( + ! isset($driverOptions[PDO::PGSQL_ATTR_DISABLE_PREPARES]) + || $driverOptions[PDO::PGSQL_ATTR_DISABLE_PREPARES] === true + ) { + $pdo->setAttribute(PDO::PGSQL_ATTR_DISABLE_PREPARES, true); + } + + $connection = new Connection($pdo); + + /* defining client_encoding via SET NAMES to avoid inconsistent DSN support + * - passing client_encoding via the 'options' param breaks pgbouncer support + */ + if (isset($params['charset'])) { + $connection->exec('SET NAMES \'' . $params['charset'] . '\''); + } + + return $connection; + } + + /** + * Constructs the Postgres PDO DSN. + * + * @param mixed[] $params + */ + private function constructPdoDsn(array $params): string + { + $dsn = 'pgsql:'; + + if (isset($params['host']) && $params['host'] !== '') { + $dsn .= 'host=' . $params['host'] . ';'; + } + + if (isset($params['port']) && $params['port'] !== '') { + $dsn .= 'port=' . $params['port'] . ';'; + } + + if (isset($params['dbname'])) { + $dsn .= 'dbname=' . $params['dbname'] . ';'; + } elseif (isset($params['default_dbname'])) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5705', + 'The "default_dbname" connection parameter is deprecated. Use "dbname" instead.', + ); + + $dsn .= 'dbname=' . $params['default_dbname'] . ';'; + } else { + if (isset($params['user']) && $params['user'] !== 'postgres') { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5705', + 'Relying on the DBAL connecting to the "postgres" database by default is deprecated.' + . ' Unless you want to have the server determine the default database for the connection,' + . ' specify the database name explicitly.', + ); + } + + // Used for temporary connections to allow operations like dropping the database currently connected to. + $dsn .= 'dbname=postgres;'; + } + + if (isset($params['sslmode'])) { + $dsn .= 'sslmode=' . $params['sslmode'] . ';'; + } + + if (isset($params['sslrootcert'])) { + $dsn .= 'sslrootcert=' . $params['sslrootcert'] . ';'; + } + + if (isset($params['sslcert'])) { + $dsn .= 'sslcert=' . $params['sslcert'] . ';'; + } + + if (isset($params['sslkey'])) { + $dsn .= 'sslkey=' . $params['sslkey'] . ';'; + } + + if (isset($params['sslcrl'])) { + $dsn .= 'sslcrl=' . $params['sslcrl'] . ';'; + } + + if (isset($params['application_name'])) { + $dsn .= 'application_name=' . $params['application_name'] . ';'; + } + + return $dsn; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/PDO/Result.php b/vendor/doctrine/dbal/src/Driver/PDO/Result.php new file mode 100644 index 00000000..88957d23 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/PDO/Result.php @@ -0,0 +1,120 @@ +statement = $statement; + } + + /** + * {@inheritDoc} + */ + public function fetchNumeric() + { + return $this->fetch(PDO::FETCH_NUM); + } + + /** + * {@inheritDoc} + */ + public function fetchAssociative() + { + return $this->fetch(PDO::FETCH_ASSOC); + } + + /** + * {@inheritDoc} + */ + public function fetchOne() + { + return $this->fetch(PDO::FETCH_COLUMN); + } + + /** + * {@inheritDoc} + */ + public function fetchAllNumeric(): array + { + return $this->fetchAll(PDO::FETCH_NUM); + } + + /** + * {@inheritDoc} + */ + public function fetchAllAssociative(): array + { + return $this->fetchAll(PDO::FETCH_ASSOC); + } + + /** + * {@inheritDoc} + */ + public function fetchFirstColumn(): array + { + return $this->fetchAll(PDO::FETCH_COLUMN); + } + + public function rowCount(): int + { + try { + return $this->statement->rowCount(); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + } + + public function columnCount(): int + { + try { + return $this->statement->columnCount(); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + } + + public function free(): void + { + $this->statement->closeCursor(); + } + + /** + * @return mixed|false + * + * @throws Exception + */ + private function fetch(int $mode) + { + try { + return $this->statement->fetch($mode); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + } + + /** + * @return list + * + * @throws Exception + */ + private function fetchAll(int $mode): array + { + try { + return $this->statement->fetchAll($mode); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + } +} diff --git a/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Connection.php b/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Connection.php new file mode 100644 index 00000000..9015f555 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Connection.php @@ -0,0 +1,70 @@ +connection = $connection; + } + + public function prepare(string $sql): StatementInterface + { + return new Statement( + $this->connection->prepare($sql), + ); + } + + /** + * {@inheritDoc} + */ + public function lastInsertId($name = null) + { + if ($name === null) { + return parent::lastInsertId($name); + } + + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4687', + 'The usage of Connection::lastInsertId() with a sequence name is deprecated.', + ); + + $statement = $this->prepare( + 'SELECT CONVERT(VARCHAR(MAX), current_value) FROM sys.sequences WHERE name = ?', + ); + $statement->bindValue(1, $name); + + return $statement->execute() + ->fetchOne(); + } + + public function getNativeConnection(): PDO + { + return $this->connection->getNativeConnection(); + } + + /** @deprecated Call {@see getNativeConnection()} instead. */ + public function getWrappedConnection(): PDO + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5037', + '%s is deprecated, call getNativeConnection() instead.', + __METHOD__, + ); + + return $this->connection->getWrappedConnection(); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Driver.php b/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Driver.php new file mode 100644 index 00000000..eba640e6 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Driver.php @@ -0,0 +1,102 @@ + $value) { + if (is_int($option)) { + $driverOptions[$option] = $value; + } else { + $dsnOptions[$option] = $value; + } + } + } + + if (! empty($params['persistent'])) { + $driverOptions[PDO::ATTR_PERSISTENT] = true; + } + + try { + $pdo = new PDO( + $this->constructDsn($params, $dsnOptions), + $params['user'] ?? '', + $params['password'] ?? '', + $driverOptions, + ); + } catch (\PDOException $exception) { + throw PDOException::new($exception); + } + + return new Connection(new PDOConnection($pdo)); + } + + /** + * Constructs the Sqlsrv PDO DSN. + * + * @param mixed[] $params + * @param string[] $connectionOptions + * + * @throws Exception + */ + private function constructDsn(array $params, array $connectionOptions): string + { + $dsn = 'sqlsrv:server='; + + if (isset($params['host'])) { + $dsn .= $params['host']; + + if (isset($params['port'])) { + $dsn .= ',' . $params['port']; + } + } elseif (isset($params['port'])) { + throw PortWithoutHost::new(); + } + + if (isset($params['dbname'])) { + $connectionOptions['Database'] = $params['dbname']; + } + + if (isset($params['MultipleActiveResultSets'])) { + $connectionOptions['MultipleActiveResultSets'] = $params['MultipleActiveResultSets'] ? 'true' : 'false'; + } + + return $dsn . $this->getConnectionOptionsDsn($connectionOptions); + } + + /** + * Converts a connection options array to the DSN + * + * @param string[] $connectionOptions + */ + private function getConnectionOptionsDsn(array $connectionOptions): string + { + $connectionOptionsDsn = ''; + + foreach ($connectionOptions as $paramName => $paramValue) { + $connectionOptionsDsn .= sprintf(';%s=%s', $paramName, $paramValue); + } + + return $connectionOptionsDsn; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Statement.php b/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Statement.php new file mode 100644 index 00000000..edabd410 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Statement.php @@ -0,0 +1,100 @@ +statement = $statement; + } + + /** + * {@inheritdoc} + * + * @deprecated Use {@see bindValue()} instead. + * + * @param string|int $param + * @param mixed $variable + * @param int $type + * @param int|null $length + * @param mixed $driverOptions The usage of the argument is deprecated. + */ + public function bindParam( + $param, + &$variable, + $type = ParameterType::STRING, + $length = null, + $driverOptions = null + ): bool { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5563', + '%s is deprecated. Use bindValue() instead.', + __METHOD__, + ); + + if (func_num_args() < 3) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5558', + 'Not passing $type to Statement::bindParam() is deprecated.' + . ' Pass the type corresponding to the parameter being bound.', + ); + } + + if (func_num_args() > 4) { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4533', + 'The $driverOptions argument of Statement::bindParam() is deprecated.', + ); + } + + switch ($type) { + case ParameterType::LARGE_OBJECT: + case ParameterType::BINARY: + $driverOptions ??= PDO::SQLSRV_ENCODING_BINARY; + + break; + + case ParameterType::ASCII: + $type = ParameterType::STRING; + $length = 0; + $driverOptions = PDO::SQLSRV_ENCODING_SYSTEM; + break; + } + + return $this->statement->bindParam($param, $variable, $type, $length ?? 0, $driverOptions); + } + + /** + * {@inheritdoc} + */ + public function bindValue($param, $value, $type = ParameterType::STRING): bool + { + if (func_num_args() < 3) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5558', + 'Not passing $type to Statement::bindValue() is deprecated.' + . ' Pass the type corresponding to the parameter being bound.', + ); + } + + return $this->bindParam($param, $value, $type); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/PDO/SQLite/Driver.php b/vendor/doctrine/dbal/src/Driver/PDO/SQLite/Driver.php new file mode 100644 index 00000000..4840b678 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/PDO/SQLite/Driver.php @@ -0,0 +1,72 @@ +constructPdoDsn($params), + $params['user'] ?? '', + $params['password'] ?? '', + $driverOptions, + ); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + + UserDefinedFunctions::register( + [$pdo, 'sqliteCreateFunction'], + $userDefinedFunctions, + ); + + return new Connection($pdo); + } + + /** + * Constructs the Sqlite PDO DSN. + * + * @param mixed[] $params + */ + private function constructPdoDsn(array $params): string + { + $dsn = 'sqlite:'; + if (isset($params['path'])) { + $dsn .= $params['path']; + } elseif (isset($params['memory'])) { + $dsn .= ':memory:'; + } + + return $dsn; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/PDO/Statement.php b/vendor/doctrine/dbal/src/Driver/PDO/Statement.php new file mode 100644 index 00000000..aaf494cc --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/PDO/Statement.php @@ -0,0 +1,157 @@ + PDO::PARAM_NULL, + ParameterType::INTEGER => PDO::PARAM_INT, + ParameterType::STRING => PDO::PARAM_STR, + ParameterType::ASCII => PDO::PARAM_STR, + ParameterType::BINARY => PDO::PARAM_LOB, + ParameterType::LARGE_OBJECT => PDO::PARAM_LOB, + ParameterType::BOOLEAN => PDO::PARAM_BOOL, + ]; + + private PDOStatement $stmt; + + /** @internal The statement can be only instantiated by its driver connection. */ + public function __construct(PDOStatement $stmt) + { + $this->stmt = $stmt; + } + + /** + * {@inheritdoc} + */ + public function bindValue($param, $value, $type = ParameterType::STRING) + { + if (func_num_args() < 3) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5558', + 'Not passing $type to Statement::bindValue() is deprecated.' + . ' Pass the type corresponding to the parameter being bound.', + ); + } + + $type = $this->convertParamType($type); + + try { + return $this->stmt->bindValue($param, $value, $type); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + } + + /** + * {@inheritDoc} + * + * @deprecated Use {@see bindValue()} instead. + * + * @param mixed $param + * @param mixed $variable + * @param int $type + * @param int|null $length + * @param mixed $driverOptions The usage of the argument is deprecated. + */ + public function bindParam( + $param, + &$variable, + $type = ParameterType::STRING, + $length = null, + $driverOptions = null + ): bool { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5563', + '%s is deprecated. Use bindValue() instead.', + __METHOD__, + ); + + if (func_num_args() < 3) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5558', + 'Not passing $type to Statement::bindParam() is deprecated.' + . ' Pass the type corresponding to the parameter being bound.', + ); + } + + if (func_num_args() > 4) { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4533', + 'The $driverOptions argument of Statement::bindParam() is deprecated.', + ); + } + + $type = $this->convertParamType($type); + + try { + return $this->stmt->bindParam( + $param, + $variable, + $type, + $length ?? 0, + ...array_slice(func_get_args(), 4), + ); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + } + + /** + * {@inheritdoc} + */ + public function execute($params = null): ResultInterface + { + if ($params !== null) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5556', + 'Passing $params to Statement::execute() is deprecated. Bind parameters using' + . ' Statement::bindParam() or Statement::bindValue() instead.', + ); + } + + try { + $this->stmt->execute($params); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + + return new Result($this->stmt); + } + + /** + * Converts DBAL parameter type to PDO parameter type + * + * @param int $type Parameter type + * + * @throws ExceptionInterface + */ + private function convertParamType(int $type): int + { + if (! isset(self::PARAM_TYPE_MAP[$type])) { + throw UnknownParameterType::new($type); + } + + return self::PARAM_TYPE_MAP[$type]; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/Result.php b/vendor/doctrine/dbal/src/Driver/Result.php new file mode 100644 index 00000000..7843a958 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/Result.php @@ -0,0 +1,93 @@ +|false + * + * @throws Exception + */ + public function fetchNumeric(); + + /** + * Returns the next row of the result as an associative array or FALSE if there are no more rows. + * + * @return array|false + * + * @throws Exception + */ + public function fetchAssociative(); + + /** + * Returns the first value of the next row of the result or FALSE if there are no more rows. + * + * @return mixed|false + * + * @throws Exception + */ + public function fetchOne(); + + /** + * Returns an array containing all of the result rows represented as numeric arrays. + * + * @return list> + * + * @throws Exception + */ + public function fetchAllNumeric(): array; + + /** + * Returns an array containing all of the result rows represented as associative arrays. + * + * @return list> + * + * @throws Exception + */ + public function fetchAllAssociative(): array; + + /** + * Returns an array containing the values of the first column of the result. + * + * @return list + * + * @throws Exception + */ + public function fetchFirstColumn(): array; + + /** + * Returns the number of rows affected by the DELETE, INSERT, or UPDATE statement that produced the result. + * + * If the statement executed a SELECT query or a similar platform-specific SQL (e.g. DESCRIBE, SHOW, etc.), + * some database drivers may return the number of rows returned by that query. However, this behaviour + * is not guaranteed for all drivers and should not be relied on in portable applications. + * + * @return int The number of rows. + * + * @throws Exception + */ + public function rowCount(): int; + + /** + * Returns the number of columns in the result + * + * @return int The number of columns in the result. If the columns cannot be counted, + * this method must return 0. + * + * @throws Exception + */ + public function columnCount(): int; + + /** + * Discards the non-fetched portion of the result, enabling the originating statement to be executed again. + */ + public function free(): void; +} diff --git a/vendor/doctrine/dbal/src/Driver/SQLSrv/Connection.php b/vendor/doctrine/dbal/src/Driver/SQLSrv/Connection.php new file mode 100644 index 00000000..ba1c58c1 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/SQLSrv/Connection.php @@ -0,0 +1,144 @@ +connection = $connection; + } + + /** + * {@inheritdoc} + */ + public function getServerVersion() + { + $serverInfo = sqlsrv_server_info($this->connection); + + return $serverInfo['SQLServerVersion']; + } + + public function prepare(string $sql): DriverStatement + { + return new Statement($this->connection, $sql); + } + + public function query(string $sql): ResultInterface + { + return $this->prepare($sql)->execute(); + } + + /** + * {@inheritDoc} + */ + public function quote($value, $type = ParameterType::STRING) + { + if (is_int($value)) { + return $value; + } + + if (is_float($value)) { + return sprintf('%F', $value); + } + + return "'" . str_replace("'", "''", $value) . "'"; + } + + public function exec(string $sql): int + { + $stmt = sqlsrv_query($this->connection, $sql); + + if ($stmt === false) { + throw Error::new(); + } + + $rowsAffected = sqlsrv_rows_affected($stmt); + + if ($rowsAffected === false) { + throw Error::new(); + } + + return $rowsAffected; + } + + /** + * {@inheritDoc} + */ + public function lastInsertId($name = null) + { + if ($name !== null) { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4687', + 'The usage of Connection::lastInsertId() with a sequence name is deprecated.', + ); + + $result = $this->prepare('SELECT CONVERT(VARCHAR(MAX), current_value) FROM sys.sequences WHERE name = ?') + ->execute([$name]); + } else { + $result = $this->query('SELECT @@IDENTITY'); + } + + return $result->fetchOne(); + } + + public function beginTransaction(): bool + { + if (! sqlsrv_begin_transaction($this->connection)) { + throw Error::new(); + } + + return true; + } + + public function commit(): bool + { + if (! sqlsrv_commit($this->connection)) { + throw Error::new(); + } + + return true; + } + + public function rollBack(): bool + { + if (! sqlsrv_rollback($this->connection)) { + throw Error::new(); + } + + return true; + } + + /** @return resource */ + public function getNativeConnection() + { + return $this->connection; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/SQLSrv/Driver.php b/vendor/doctrine/dbal/src/Driver/SQLSrv/Driver.php new file mode 100644 index 00000000..085b2241 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/SQLSrv/Driver.php @@ -0,0 +1,70 @@ +statement = $stmt; + } + + /** + * {@inheritDoc} + */ + public function fetchNumeric() + { + return $this->fetch(SQLSRV_FETCH_NUMERIC); + } + + /** + * {@inheritDoc} + */ + public function fetchAssociative() + { + return $this->fetch(SQLSRV_FETCH_ASSOC); + } + + /** + * {@inheritDoc} + */ + public function fetchOne() + { + return FetchUtils::fetchOne($this); + } + + /** + * {@inheritDoc} + */ + public function fetchAllNumeric(): array + { + return FetchUtils::fetchAllNumeric($this); + } + + /** + * {@inheritDoc} + */ + public function fetchAllAssociative(): array + { + return FetchUtils::fetchAllAssociative($this); + } + + /** + * {@inheritDoc} + */ + public function fetchFirstColumn(): array + { + return FetchUtils::fetchFirstColumn($this); + } + + public function rowCount(): int + { + $count = sqlsrv_rows_affected($this->statement); + + if ($count !== false) { + return $count; + } + + return 0; + } + + public function columnCount(): int + { + $count = sqlsrv_num_fields($this->statement); + + if ($count !== false) { + return $count; + } + + return 0; + } + + public function free(): void + { + // emulate it by fetching and discarding rows, similarly to what PDO does in this case + // @link http://php.net/manual/en/pdostatement.closecursor.php + // @link https://github.com/php/php-src/blob/php-7.0.11/ext/pdo/pdo_stmt.c#L2075 + // deliberately do not consider multiple result sets, since doctrine/dbal doesn't support them + while (sqlsrv_fetch($this->statement)) { + } + } + + /** @return mixed|false */ + private function fetch(int $fetchType) + { + return sqlsrv_fetch_array($this->statement, $fetchType) ?? false; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/SQLSrv/Statement.php b/vendor/doctrine/dbal/src/Driver/SQLSrv/Statement.php new file mode 100644 index 00000000..1244ba51 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/SQLSrv/Statement.php @@ -0,0 +1,223 @@ + + */ + private array $variables = []; + + /** + * Bound parameter types. + * + * @var array + */ + private array $types = []; + + /** + * Append to any INSERT query to retrieve the last insert id. + */ + private const LAST_INSERT_ID_SQL = ';SELECT SCOPE_IDENTITY() AS LastInsertId;'; + + /** + * @internal The statement can be only instantiated by its driver connection. + * + * @param resource $conn + * @param string $sql + */ + public function __construct($conn, $sql) + { + $this->conn = $conn; + $this->sql = $sql; + + if (stripos($sql, 'INSERT INTO ') !== 0) { + return; + } + + $this->sql .= self::LAST_INSERT_ID_SQL; + } + + /** + * {@inheritdoc} + */ + public function bindValue($param, $value, $type = ParameterType::STRING): bool + { + assert(is_int($param)); + + if (func_num_args() < 3) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5558', + 'Not passing $type to Statement::bindValue() is deprecated.' + . ' Pass the type corresponding to the parameter being bound.', + ); + } + + $this->variables[$param] = $value; + $this->types[$param] = $type; + + return true; + } + + /** + * {@inheritdoc} + * + * @deprecated Use {@see bindValue()} instead. + */ + public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null): bool + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5563', + '%s is deprecated. Use bindValue() instead.', + __METHOD__, + ); + + assert(is_int($param)); + + if (func_num_args() < 3) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5558', + 'Not passing $type to Statement::bindParam() is deprecated.' + . ' Pass the type corresponding to the parameter being bound.', + ); + } + + $this->variables[$param] =& $variable; + $this->types[$param] = $type; + + // unset the statement resource if it exists as the new one will need to be bound to the new variable + $this->stmt = null; + + return true; + } + + /** + * {@inheritdoc} + */ + public function execute($params = null): ResultInterface + { + if ($params !== null) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5556', + 'Passing $params to Statement::execute() is deprecated. Bind parameters using' + . ' Statement::bindParam() or Statement::bindValue() instead.', + ); + + foreach ($params as $key => $val) { + if (is_int($key)) { + $this->bindValue($key + 1, $val, ParameterType::STRING); + } else { + $this->bindValue($key, $val, ParameterType::STRING); + } + } + } + + $this->stmt ??= $this->prepare(); + + if (! sqlsrv_execute($this->stmt)) { + throw Error::new(); + } + + return new Result($this->stmt); + } + + /** + * Prepares SQL Server statement resource + * + * @return resource + * + * @throws Exception + */ + private function prepare() + { + $params = []; + + foreach ($this->variables as $column => &$variable) { + switch ($this->types[$column]) { + case ParameterType::LARGE_OBJECT: + $params[$column - 1] = [ + &$variable, + SQLSRV_PARAM_IN, + SQLSRV_PHPTYPE_STREAM(SQLSRV_ENC_BINARY), + SQLSRV_SQLTYPE_VARBINARY('max'), + ]; + break; + + case ParameterType::BINARY: + $params[$column - 1] = [ + &$variable, + SQLSRV_PARAM_IN, + SQLSRV_PHPTYPE_STRING(SQLSRV_ENC_BINARY), + ]; + break; + + case ParameterType::ASCII: + $params[$column - 1] = [ + &$variable, + SQLSRV_PARAM_IN, + SQLSRV_PHPTYPE_STRING(SQLSRV_ENC_CHAR), + ]; + break; + + default: + $params[$column - 1] =& $variable; + break; + } + } + + $stmt = sqlsrv_prepare($this->conn, $this->sql, $params); + + if ($stmt === false) { + throw Error::new(); + } + + return $stmt; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/SQLite3/Connection.php b/vendor/doctrine/dbal/src/Driver/SQLite3/Connection.php new file mode 100644 index 00000000..de9a8e03 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/SQLite3/Connection.php @@ -0,0 +1,107 @@ +connection = $connection; + } + + public function prepare(string $sql): Statement + { + try { + $statement = $this->connection->prepare($sql); + } catch (\Exception $e) { + throw Exception::new($e); + } + + assert($statement !== false); + + return new Statement($this->connection, $statement); + } + + public function query(string $sql): Result + { + try { + $result = $this->connection->query($sql); + } catch (\Exception $e) { + throw Exception::new($e); + } + + assert($result !== false); + + return new Result($result, $this->connection->changes()); + } + + /** @inheritdoc */ + public function quote($value, $type = ParameterType::STRING): string + { + return sprintf('\'%s\'', SQLite3::escapeString($value)); + } + + public function exec(string $sql): int + { + try { + $this->connection->exec($sql); + } catch (\Exception $e) { + throw Exception::new($e); + } + + return $this->connection->changes(); + } + + /** @inheritdoc */ + public function lastInsertId($name = null): int + { + return $this->connection->lastInsertRowID(); + } + + public function beginTransaction(): bool + { + try { + return $this->connection->exec('BEGIN'); + } catch (\Exception $e) { + return false; + } + } + + public function commit(): bool + { + try { + return $this->connection->exec('COMMIT'); + } catch (\Exception $e) { + return false; + } + } + + public function rollBack(): bool + { + try { + return $this->connection->exec('ROLLBACK'); + } catch (\Exception $e) { + return false; + } + } + + public function getNativeConnection(): SQLite3 + { + return $this->connection; + } + + public function getServerVersion(): string + { + return SQLite3::version()['versionString']; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/SQLite3/Driver.php b/vendor/doctrine/dbal/src/Driver/SQLite3/Driver.php new file mode 100644 index 00000000..a2276d52 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/SQLite3/Driver.php @@ -0,0 +1,46 @@ +enableExceptions(true); + + UserDefinedFunctions::register([$connection, 'createFunction']); + + return new Connection($connection); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/SQLite3/Exception.php b/vendor/doctrine/dbal/src/Driver/SQLite3/Exception.php new file mode 100644 index 00000000..3ca1190b --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/SQLite3/Exception.php @@ -0,0 +1,18 @@ +getMessage(), null, (int) $exception->getCode(), $exception); + } +} diff --git a/vendor/doctrine/dbal/src/Driver/SQLite3/Result.php b/vendor/doctrine/dbal/src/Driver/SQLite3/Result.php new file mode 100644 index 00000000..a51bd4e8 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/SQLite3/Result.php @@ -0,0 +1,91 @@ +result = $result; + $this->changes = $changes; + } + + /** @inheritdoc */ + public function fetchNumeric() + { + if ($this->result === null) { + return false; + } + + return $this->result->fetchArray(SQLITE3_NUM); + } + + /** @inheritdoc */ + public function fetchAssociative() + { + if ($this->result === null) { + return false; + } + + return $this->result->fetchArray(SQLITE3_ASSOC); + } + + /** @inheritdoc */ + public function fetchOne() + { + return FetchUtils::fetchOne($this); + } + + /** @inheritdoc */ + public function fetchAllNumeric(): array + { + return FetchUtils::fetchAllNumeric($this); + } + + /** @inheritdoc */ + public function fetchAllAssociative(): array + { + return FetchUtils::fetchAllAssociative($this); + } + + /** @inheritdoc */ + public function fetchFirstColumn(): array + { + return FetchUtils::fetchFirstColumn($this); + } + + public function rowCount(): int + { + return $this->changes; + } + + public function columnCount(): int + { + if ($this->result === null) { + return 0; + } + + return $this->result->numColumns(); + } + + public function free(): void + { + if ($this->result === null) { + return; + } + + $this->result->finalize(); + $this->result = null; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/SQLite3/Statement.php b/vendor/doctrine/dbal/src/Driver/SQLite3/Statement.php new file mode 100644 index 00000000..878627a6 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/SQLite3/Statement.php @@ -0,0 +1,119 @@ + SQLITE3_NULL, + ParameterType::INTEGER => SQLITE3_INTEGER, + ParameterType::STRING => SQLITE3_TEXT, + ParameterType::ASCII => SQLITE3_TEXT, + ParameterType::BINARY => SQLITE3_BLOB, + ParameterType::LARGE_OBJECT => SQLITE3_BLOB, + ParameterType::BOOLEAN => SQLITE3_INTEGER, + ]; + + private SQLite3 $connection; + private SQLite3Stmt $statement; + + /** @internal The statement can be only instantiated by its driver connection. */ + public function __construct(SQLite3 $connection, SQLite3Stmt $statement) + { + $this->connection = $connection; + $this->statement = $statement; + } + + /** @inheritdoc */ + public function bindValue($param, $value, $type = ParameterType::STRING): bool + { + if (func_num_args() < 3) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5558', + 'Not passing $type to Statement::bindValue() is deprecated.' + . ' Pass the type corresponding to the parameter being bound.', + ); + } + + return $this->statement->bindValue($param, $value, $this->convertParamType($type)); + } + + /** @inheritdoc */ + public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null): bool + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5563', + '%s is deprecated. Use bindValue() instead.', + __METHOD__, + ); + + if (func_num_args() < 3) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5558', + 'Not passing $type to Statement::bindParam() is deprecated.' + . ' Pass the type corresponding to the parameter being bound.', + ); + } + + return $this->statement->bindParam($param, $variable, $this->convertParamType($type)); + } + + /** @inheritdoc */ + public function execute($params = null): Result + { + if ($params !== null) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5556', + 'Passing $params to Statement::execute() is deprecated. Bind parameters using' + . ' Statement::bindParam() or Statement::bindValue() instead.', + ); + + foreach ($params as $param => $value) { + if (is_int($param)) { + $this->bindValue($param + 1, $value, ParameterType::STRING); + } else { + $this->bindValue($param, $value, ParameterType::STRING); + } + } + } + + try { + $result = $this->statement->execute(); + } catch (\Exception $e) { + throw Exception::new($e); + } + + assert($result !== false); + + return new Result($result, $this->connection->changes()); + } + + private function convertParamType(int $type): int + { + if (! isset(self::PARAM_TYPE_MAP[$type])) { + throw UnknownParameterType::new($type); + } + + return self::PARAM_TYPE_MAP[$type]; + } +} diff --git a/vendor/doctrine/dbal/src/Driver/ServerInfoAwareConnection.php b/vendor/doctrine/dbal/src/Driver/ServerInfoAwareConnection.php new file mode 100644 index 00000000..5687ab0b --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/ServerInfoAwareConnection.php @@ -0,0 +1,21 @@ +execute() is called. + * + * As mentioned above, the named parameters are not natively supported by the mysqli driver, use executeQuery(), + * fetchAll(), fetchArray(), fetchColumn(), fetchAssoc() methods to have the named parameter emulated by doctrine. + * + * Most parameters are input parameters, that is, parameters that are + * used in a read-only fashion to build up the query. Some drivers support the invocation + * of stored procedures that return data as output parameters, and some also as input/output + * parameters that both send in data and are updated to receive it. + * + * @deprecated Use {@see bindValue()} instead. + * + * @param string|int $param Parameter identifier. For a prepared statement using named placeholders, + * this will be a parameter name of the form :name. For a prepared statement using + * question mark placeholders, this will be the 1-indexed position of the parameter. + * @param mixed $variable Name of the PHP variable to bind to the SQL statement parameter. + * @param int $type Explicit data type for the parameter using the {@see ParameterType} + * constants. + * @param int|null $length You must specify maxlength when using an OUT bind + * so that PHP allocates enough memory to hold the returned value. + * + * @return bool TRUE on success or FALSE on failure. + * + * @throws Exception + */ + public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null); + + /** + * Executes a prepared statement + * + * If the prepared statement included parameter markers, you must either: + * call {@see bindParam()} to bind PHP variables to the parameter markers: + * bound variables pass their value as input and receive the output value, + * if any, of their associated parameter markers or pass an array of input-only + * parameter values. + * + * @param mixed[]|null $params A numeric array of values with as many elements as there are + * bound parameters in the SQL statement being executed. + * + * @throws Exception + */ + public function execute($params = null): Result; +} diff --git a/vendor/doctrine/dbal/src/DriverManager.php b/vendor/doctrine/dbal/src/DriverManager.php new file mode 100644 index 00000000..5c30088e --- /dev/null +++ b/vendor/doctrine/dbal/src/DriverManager.php @@ -0,0 +1,490 @@ +, + * driverClass?: class-string, + * driverOptions?: array, + * host?: string, + * password?: string, + * path?: string, + * pdo?: \PDO, + * platform?: Platforms\AbstractPlatform, + * port?: int, + * user?: string, + * unix_socket?: string, + * } + * @psalm-type Params = array{ + * charset?: string, + * dbname?: string, + * defaultTableOptions?: array, + * default_dbname?: string, + * driver?: key-of, + * driverClass?: class-string, + * driverOptions?: array, + * host?: string, + * keepSlave?: bool, + * keepReplica?: bool, + * master?: OverrideParams, + * memory?: bool, + * password?: string, + * path?: string, + * pdo?: \PDO, + * platform?: Platforms\AbstractPlatform, + * port?: int, + * primary?: OverrideParams, + * replica?: array, + * serverVersion?: string, + * sharding?: array, + * slaves?: array, + * user?: string, + * wrapperClass?: class-string, + * unix_socket?: string, + * } + */ +final class DriverManager +{ + /** + * List of supported drivers and their mappings to the driver classes. + * + * To add your own driver use the 'driverClass' parameter to {@see DriverManager::getConnection()}. + */ + private const DRIVER_MAP = [ + 'pdo_mysql' => PDO\MySQL\Driver::class, + 'pdo_sqlite' => PDO\SQLite\Driver::class, + 'pdo_pgsql' => PDO\PgSQL\Driver::class, + 'pdo_oci' => PDO\OCI\Driver::class, + 'oci8' => OCI8\Driver::class, + 'ibm_db2' => IBMDB2\Driver::class, + 'pdo_sqlsrv' => PDO\SQLSrv\Driver::class, + 'mysqli' => Mysqli\Driver::class, + 'sqlsrv' => SQLSrv\Driver::class, + 'sqlite3' => SQLite3\Driver::class, + ]; + + /** + * List of URL schemes from a database URL and their mappings to driver. + * + * @deprecated Use actual driver names instead. + * + * @var string[] + */ + private static array $driverSchemeAliases = [ + 'db2' => 'ibm_db2', + 'mssql' => 'pdo_sqlsrv', + 'mysql' => 'pdo_mysql', + 'mysql2' => 'pdo_mysql', // Amazon RDS, for some weird reason + 'postgres' => 'pdo_pgsql', + 'postgresql' => 'pdo_pgsql', + 'pgsql' => 'pdo_pgsql', + 'sqlite' => 'pdo_sqlite', + 'sqlite3' => 'pdo_sqlite', + ]; + + /** + * Private constructor. This class cannot be instantiated. + * + * @codeCoverageIgnore + */ + private function __construct() + { + } + + /** + * Creates a connection object based on the specified parameters. + * This method returns a Doctrine\DBAL\Connection which wraps the underlying + * driver connection. + * + * $params must contain at least one of the following. + * + * Either 'driver' with one of the array keys of {@see DRIVER_MAP}, + * OR 'driverClass' that contains the full class name (with namespace) of the + * driver class to instantiate. + * + * Other (optional) parameters: + * + * user (string): + * The username to use when connecting. + * + * password (string): + * The password to use when connecting. + * + * driverOptions (array): + * Any additional driver-specific options for the driver. These are just passed + * through to the driver. + * + * wrapperClass: + * You may specify a custom wrapper class through the 'wrapperClass' + * parameter but this class MUST inherit from Doctrine\DBAL\Connection. + * + * driverClass: + * The driver class to use. + * + * @param Configuration|null $config The configuration to use. + * @param EventManager|null $eventManager The event manager to use. + * @psalm-param array{ + * charset?: string, + * dbname?: string, + * default_dbname?: string, + * driver?: key-of, + * driverClass?: class-string, + * driverOptions?: array, + * host?: string, + * keepSlave?: bool, + * keepReplica?: bool, + * master?: OverrideParams, + * memory?: bool, + * password?: string, + * path?: string, + * pdo?: \PDO, + * platform?: Platforms\AbstractPlatform, + * port?: int, + * primary?: OverrideParams, + * replica?: array, + * sharding?: array, + * slaves?: array, + * user?: string, + * wrapperClass?: class-string, + * } $params + * + * @psalm-return ($params is array{wrapperClass:mixed} ? T : Connection) + * + * @throws Exception + * + * @template T of Connection + */ + public static function getConnection( + array $params, + ?Configuration $config = null, + ?EventManager $eventManager = null + ): Connection { + // create default config and event manager, if not set + $config ??= new Configuration(); + $eventManager ??= new EventManager(); + $params = self::parseDatabaseUrl($params); + + // URL support for PrimaryReplicaConnection + if (isset($params['primary'])) { + $params['primary'] = self::parseDatabaseUrl($params['primary']); + } + + if (isset($params['replica'])) { + foreach ($params['replica'] as $key => $replicaParams) { + $params['replica'][$key] = self::parseDatabaseUrl($replicaParams); + } + } + + $driver = self::createDriver($params); + + foreach ($config->getMiddlewares() as $middleware) { + $driver = $middleware->wrap($driver); + } + + $wrapperClass = Connection::class; + if (isset($params['wrapperClass'])) { + if (! is_subclass_of($params['wrapperClass'], $wrapperClass)) { + throw Exception::invalidWrapperClass($params['wrapperClass']); + } + + /** @var class-string $wrapperClass */ + $wrapperClass = $params['wrapperClass']; + } + + return new $wrapperClass($params, $driver, $config, $eventManager); + } + + /** + * Returns the list of supported drivers. + * + * @return string[] + */ + public static function getAvailableDrivers(): array + { + return array_keys(self::DRIVER_MAP); + } + + /** + * @param array $params + * @psalm-param Params $params + * @phpstan-param array $params + * + * @throws Exception + */ + private static function createDriver(array $params): Driver + { + if (isset($params['driverClass'])) { + $interfaces = class_implements($params['driverClass']); + + if ($interfaces === false || ! in_array(Driver::class, $interfaces, true)) { + throw Exception::invalidDriverClass($params['driverClass']); + } + + return new $params['driverClass'](); + } + + if (isset($params['driver'])) { + if (! isset(self::DRIVER_MAP[$params['driver']])) { + throw Exception::unknownDriver($params['driver'], array_keys(self::DRIVER_MAP)); + } + + $class = self::DRIVER_MAP[$params['driver']]; + + return new $class(); + } + + throw Exception::driverRequired(); + } + + /** + * Normalizes the given connection URL path. + * + * @return string The normalized connection URL path + */ + private static function normalizeDatabaseUrlPath(string $urlPath): string + { + // Trim leading slash from URL path. + return substr($urlPath, 1); + } + + /** + * Extracts parts from a database URL, if present, and returns an + * updated list of parameters. + * + * @param mixed[] $params The list of parameters. + * @psalm-param Params $params + * @phpstan-param array $params + * + * @return mixed[] A modified list of parameters with info from a database + * URL extracted into indidivual parameter parts. + * @psalm-return Params + * @phpstan-return array + * + * @throws Exception + */ + private static function parseDatabaseUrl(array $params): array + { + if (! isset($params['url'])) { + return $params; + } + + // (pdo_)?sqlite3?:///... => (pdo_)?sqlite3?://localhost/... or else the URL will be invalid + $url = preg_replace('#^((?:pdo_)?sqlite3?):///#', '$1://localhost/', $params['url']); + $url = parse_url($url); + + if ($url === false) { + throw new Exception('Malformed parameter "url".'); + } + + foreach ($url as $param => $value) { + if (! is_string($value)) { + continue; + } + + $url[$param] = rawurldecode($value); + } + + $params = self::parseDatabaseUrlScheme($url['scheme'] ?? null, $params); + + if (isset($url['host'])) { + $params['host'] = $url['host']; + } + + if (isset($url['port'])) { + $params['port'] = $url['port']; + } + + if (isset($url['user'])) { + $params['user'] = $url['user']; + } + + if (isset($url['pass'])) { + $params['password'] = $url['pass']; + } + + $params = self::parseDatabaseUrlPath($url, $params); + $params = self::parseDatabaseUrlQuery($url, $params); + + return $params; + } + + /** + * Parses the given connection URL and resolves the given connection parameters. + * + * Assumes that the connection URL scheme is already parsed and resolved into the given connection parameters + * via {@see parseDatabaseUrlScheme}. + * + * @see parseDatabaseUrlScheme + * + * @param mixed[] $url The URL parts to evaluate. + * @param mixed[] $params The connection parameters to resolve. + * + * @return mixed[] The resolved connection parameters. + */ + private static function parseDatabaseUrlPath(array $url, array $params): array + { + if (! isset($url['path'])) { + return $params; + } + + $url['path'] = self::normalizeDatabaseUrlPath($url['path']); + + // If we do not have a known DBAL driver, we do not know any connection URL path semantics to evaluate + // and therefore treat the path as regular DBAL connection URL path. + if (! isset($params['driver'])) { + return self::parseRegularDatabaseUrlPath($url, $params); + } + + if (strpos($params['driver'], 'sqlite') !== false) { + return self::parseSqliteDatabaseUrlPath($url, $params); + } + + return self::parseRegularDatabaseUrlPath($url, $params); + } + + /** + * Parses the query part of the given connection URL and resolves the given connection parameters. + * + * @param mixed[] $url The connection URL parts to evaluate. + * @param mixed[] $params The connection parameters to resolve. + * + * @return mixed[] The resolved connection parameters. + */ + private static function parseDatabaseUrlQuery(array $url, array $params): array + { + if (! isset($url['query'])) { + return $params; + } + + $query = []; + + parse_str($url['query'], $query); // simply ingest query as extra params, e.g. charset or sslmode + + return array_merge($params, $query); // parse_str wipes existing array elements + } + + /** + * Parses the given regular connection URL and resolves the given connection parameters. + * + * Assumes that the "path" URL part is already normalized via {@see normalizeDatabaseUrlPath}. + * + * @see normalizeDatabaseUrlPath + * + * @param mixed[] $url The regular connection URL parts to evaluate. + * @param mixed[] $params The connection parameters to resolve. + * + * @return mixed[] The resolved connection parameters. + */ + private static function parseRegularDatabaseUrlPath(array $url, array $params): array + { + $params['dbname'] = $url['path']; + + return $params; + } + + /** + * Parses the given SQLite connection URL and resolves the given connection parameters. + * + * Assumes that the "path" URL part is already normalized via {@see normalizeDatabaseUrlPath}. + * + * @see normalizeDatabaseUrlPath + * + * @param mixed[] $url The SQLite connection URL parts to evaluate. + * @param mixed[] $params The connection parameters to resolve. + * + * @return mixed[] The resolved connection parameters. + */ + private static function parseSqliteDatabaseUrlPath(array $url, array $params): array + { + if ($url['path'] === ':memory:') { + $params['memory'] = true; + + return $params; + } + + $params['path'] = $url['path']; // pdo_sqlite driver uses 'path' instead of 'dbname' key + + return $params; + } + + /** + * Parses the scheme part from given connection URL and resolves the given connection parameters. + * + * @param string|null $scheme The connection URL scheme, if available + * @param mixed[] $params The connection parameters to resolve. + * + * @return mixed[] The resolved connection parameters. + * + * @throws Exception If parsing failed or resolution is not possible. + */ + private static function parseDatabaseUrlScheme(?string $scheme, array $params): array + { + if ($scheme !== null) { + // The requested driver from the URL scheme takes precedence + // over the default custom driver from the connection parameters (if any). + unset($params['driverClass']); + + // URL schemes must not contain underscores, but dashes are ok + $driver = str_replace('-', '_', $scheme); + + // If the driver is an alias (e.g. "postgres"), map it to the actual name ("pdo-pgsql"). + // Otherwise, let checkParams decide later if the driver exists. + if (isset(self::$driverSchemeAliases[$driver])) { + $actualDriver = self::$driverSchemeAliases[$driver]; + + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5697', + 'Relying on driver name aliases is deprecated. Use %s instead of %s.', + str_replace('_', '-', $actualDriver), + $driver, + ); + + $driver = $actualDriver; + } + + // The requested driver from the URL scheme takes precedence over the + // default driver from the connection parameters. + $params['driver'] = $driver; + + return $params; + } + + // If a schemeless connection URL is given, we require a default driver or default custom driver + // as connection parameter. + if (! isset($params['driverClass']) && ! isset($params['driver'])) { + throw Exception::driverRequired($params['url']); + } + + return $params; + } +} diff --git a/vendor/doctrine/dbal/src/Event/ConnectionEventArgs.php b/vendor/doctrine/dbal/src/Event/ConnectionEventArgs.php new file mode 100644 index 00000000..9a69c254 --- /dev/null +++ b/vendor/doctrine/dbal/src/Event/ConnectionEventArgs.php @@ -0,0 +1,27 @@ +connection = $connection; + } + + /** @return Connection */ + public function getConnection() + { + return $this->connection; + } +} diff --git a/vendor/doctrine/dbal/src/Event/Listeners/OracleSessionInit.php b/vendor/doctrine/dbal/src/Event/Listeners/OracleSessionInit.php new file mode 100644 index 00000000..6256cdb5 --- /dev/null +++ b/vendor/doctrine/dbal/src/Event/Listeners/OracleSessionInit.php @@ -0,0 +1,77 @@ + 'HH24:MI:SS', + 'NLS_DATE_FORMAT' => 'YYYY-MM-DD HH24:MI:SS', + 'NLS_TIMESTAMP_FORMAT' => 'YYYY-MM-DD HH24:MI:SS', + 'NLS_TIMESTAMP_TZ_FORMAT' => 'YYYY-MM-DD HH24:MI:SS TZH:TZM', + 'NLS_NUMERIC_CHARACTERS' => '.,', + ]; + + /** @param string[] $oracleSessionVars */ + public function __construct(array $oracleSessionVars = []) + { + $this->_defaultSessionVars = array_merge($this->_defaultSessionVars, $oracleSessionVars); + } + + /** + * @return void + * + * @throws Exception + */ + public function postConnect(ConnectionEventArgs $args) + { + if (count($this->_defaultSessionVars) === 0) { + return; + } + + $vars = []; + foreach (array_change_key_case($this->_defaultSessionVars, CASE_UPPER) as $option => $value) { + if ($option === 'CURRENT_SCHEMA') { + $vars[] = $option . ' = ' . $value; + } else { + $vars[] = $option . " = '" . $value . "'"; + } + } + + $sql = 'ALTER SESSION SET ' . implode(' ', $vars); + $args->getConnection()->executeStatement($sql); + } + + /** + * {@inheritdoc} + */ + public function getSubscribedEvents() + { + return [Events::postConnect]; + } +} diff --git a/vendor/doctrine/dbal/src/Event/Listeners/SQLSessionInit.php b/vendor/doctrine/dbal/src/Event/Listeners/SQLSessionInit.php new file mode 100644 index 00000000..0f77e9ff --- /dev/null +++ b/vendor/doctrine/dbal/src/Event/Listeners/SQLSessionInit.php @@ -0,0 +1,43 @@ +sql = $sql; + } + + /** + * @return void + * + * @throws Exception + */ + public function postConnect(ConnectionEventArgs $args) + { + $args->getConnection()->executeStatement($this->sql); + } + + /** + * {@inheritdoc} + */ + public function getSubscribedEvents() + { + return [Events::postConnect]; + } +} diff --git a/vendor/doctrine/dbal/src/Event/Listeners/SQLiteSessionInit.php b/vendor/doctrine/dbal/src/Event/Listeners/SQLiteSessionInit.php new file mode 100644 index 00000000..f2ee05a3 --- /dev/null +++ b/vendor/doctrine/dbal/src/Event/Listeners/SQLiteSessionInit.php @@ -0,0 +1,30 @@ +getConnection()->executeStatement('PRAGMA foreign_keys=ON'); + } + + /** + * {@inheritdoc} + */ + public function getSubscribedEvents() + { + return [Events::postConnect]; + } +} diff --git a/vendor/doctrine/dbal/src/Event/SchemaAlterTableAddColumnEventArgs.php b/vendor/doctrine/dbal/src/Event/SchemaAlterTableAddColumnEventArgs.php new file mode 100644 index 00000000..9f3ff6ea --- /dev/null +++ b/vendor/doctrine/dbal/src/Event/SchemaAlterTableAddColumnEventArgs.php @@ -0,0 +1,81 @@ +column = $column; + $this->tableDiff = $tableDiff; + $this->platform = $platform; + } + + /** @return Column */ + public function getColumn() + { + return $this->column; + } + + /** @return TableDiff */ + public function getTableDiff() + { + return $this->tableDiff; + } + + /** @return AbstractPlatform */ + public function getPlatform() + { + return $this->platform; + } + + /** + * Passing multiple SQL statements as an array is deprecated. Pass each statement as an individual argument instead. + * + * @param string|string[] $sql + * + * @return SchemaAlterTableAddColumnEventArgs + */ + public function addSql($sql) + { + if (is_array($sql)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3580', + 'Passing multiple SQL statements as an array to SchemaAlterTableAddColumnEventaArrgs::addSql() ' . + 'is deprecated. Pass each statement as an individual argument instead.', + ); + } + + $this->sql = array_merge($this->sql, is_array($sql) ? $sql : func_get_args()); + + return $this; + } + + /** @return string[] */ + public function getSql() + { + return $this->sql; + } +} diff --git a/vendor/doctrine/dbal/src/Event/SchemaAlterTableChangeColumnEventArgs.php b/vendor/doctrine/dbal/src/Event/SchemaAlterTableChangeColumnEventArgs.php new file mode 100644 index 00000000..9ba37aad --- /dev/null +++ b/vendor/doctrine/dbal/src/Event/SchemaAlterTableChangeColumnEventArgs.php @@ -0,0 +1,71 @@ +columnDiff = $columnDiff; + $this->tableDiff = $tableDiff; + $this->platform = $platform; + } + + /** @return ColumnDiff */ + public function getColumnDiff() + { + return $this->columnDiff; + } + + /** @return TableDiff */ + public function getTableDiff() + { + return $this->tableDiff; + } + + /** @return AbstractPlatform */ + public function getPlatform() + { + return $this->platform; + } + + /** + * Passing multiple SQL statements as an array is deprecated. Pass each statement as an individual argument instead. + * + * @param string|string[] $sql + * + * @return SchemaAlterTableChangeColumnEventArgs + */ + public function addSql($sql) + { + $this->sql = array_merge($this->sql, is_array($sql) ? $sql : func_get_args()); + + return $this; + } + + /** @return string[] */ + public function getSql() + { + return $this->sql; + } +} diff --git a/vendor/doctrine/dbal/src/Event/SchemaAlterTableEventArgs.php b/vendor/doctrine/dbal/src/Event/SchemaAlterTableEventArgs.php new file mode 100644 index 00000000..07c065a9 --- /dev/null +++ b/vendor/doctrine/dbal/src/Event/SchemaAlterTableEventArgs.php @@ -0,0 +1,62 @@ +tableDiff = $tableDiff; + $this->platform = $platform; + } + + /** @return TableDiff */ + public function getTableDiff() + { + return $this->tableDiff; + } + + /** @return AbstractPlatform */ + public function getPlatform() + { + return $this->platform; + } + + /** + * Passing multiple SQL statements as an array is deprecated. Pass each statement as an individual argument instead. + * + * @param string|string[] $sql + * + * @return SchemaAlterTableEventArgs + */ + public function addSql($sql) + { + $this->sql = array_merge($this->sql, is_array($sql) ? $sql : func_get_args()); + + return $this; + } + + /** @return string[] */ + public function getSql() + { + return $this->sql; + } +} diff --git a/vendor/doctrine/dbal/src/Event/SchemaAlterTableRemoveColumnEventArgs.php b/vendor/doctrine/dbal/src/Event/SchemaAlterTableRemoveColumnEventArgs.php new file mode 100644 index 00000000..4122b418 --- /dev/null +++ b/vendor/doctrine/dbal/src/Event/SchemaAlterTableRemoveColumnEventArgs.php @@ -0,0 +1,71 @@ +column = $column; + $this->tableDiff = $tableDiff; + $this->platform = $platform; + } + + /** @return Column */ + public function getColumn() + { + return $this->column; + } + + /** @return TableDiff */ + public function getTableDiff() + { + return $this->tableDiff; + } + + /** @return AbstractPlatform */ + public function getPlatform() + { + return $this->platform; + } + + /** + * Passing multiple SQL statements as an array is deprecated. Pass each statement as an individual argument instead. + * + * @param string|string[] $sql + * + * @return SchemaAlterTableRemoveColumnEventArgs + */ + public function addSql($sql) + { + $this->sql = array_merge($this->sql, is_array($sql) ? $sql : func_get_args()); + + return $this; + } + + /** @return string[] */ + public function getSql() + { + return $this->sql; + } +} diff --git a/vendor/doctrine/dbal/src/Event/SchemaAlterTableRenameColumnEventArgs.php b/vendor/doctrine/dbal/src/Event/SchemaAlterTableRenameColumnEventArgs.php new file mode 100644 index 00000000..21d3c164 --- /dev/null +++ b/vendor/doctrine/dbal/src/Event/SchemaAlterTableRenameColumnEventArgs.php @@ -0,0 +1,82 @@ +oldColumnName = $oldColumnName; + $this->column = $column; + $this->tableDiff = $tableDiff; + $this->platform = $platform; + } + + /** @return string */ + public function getOldColumnName() + { + return $this->oldColumnName; + } + + /** @return Column */ + public function getColumn() + { + return $this->column; + } + + /** @return TableDiff */ + public function getTableDiff() + { + return $this->tableDiff; + } + + /** @return AbstractPlatform */ + public function getPlatform() + { + return $this->platform; + } + + /** + * Passing multiple SQL statements as an array is deprecated. Pass each statement as an individual argument instead. + * + * @param string|string[] $sql + * + * @return SchemaAlterTableRenameColumnEventArgs + */ + public function addSql($sql) + { + $this->sql = array_merge($this->sql, is_array($sql) ? $sql : func_get_args()); + + return $this; + } + + /** @return string[] */ + public function getSql() + { + return $this->sql; + } +} diff --git a/vendor/doctrine/dbal/src/Event/SchemaColumnDefinitionEventArgs.php b/vendor/doctrine/dbal/src/Event/SchemaColumnDefinitionEventArgs.php new file mode 100644 index 00000000..04fcbde9 --- /dev/null +++ b/vendor/doctrine/dbal/src/Event/SchemaColumnDefinitionEventArgs.php @@ -0,0 +1,87 @@ +tableColumn = $tableColumn; + $this->table = $table; + $this->database = $database; + $this->connection = $connection; + } + + /** + * Allows to clear the column which means the column will be excluded from + * tables column list. + * + * @return SchemaColumnDefinitionEventArgs + */ + public function setColumn(?Column $column = null) + { + $this->column = $column; + + return $this; + } + + /** @return Column|null */ + public function getColumn() + { + return $this->column; + } + + /** @return mixed[] */ + public function getTableColumn() + { + return $this->tableColumn; + } + + /** @return string */ + public function getTable() + { + return $this->table; + } + + /** @return string */ + public function getDatabase() + { + return $this->database; + } + + /** @return Connection */ + public function getConnection() + { + return $this->connection; + } +} diff --git a/vendor/doctrine/dbal/src/Event/SchemaCreateTableColumnEventArgs.php b/vendor/doctrine/dbal/src/Event/SchemaCreateTableColumnEventArgs.php new file mode 100644 index 00000000..54f134d1 --- /dev/null +++ b/vendor/doctrine/dbal/src/Event/SchemaCreateTableColumnEventArgs.php @@ -0,0 +1,71 @@ +column = $column; + $this->table = $table; + $this->platform = $platform; + } + + /** @return Column */ + public function getColumn() + { + return $this->column; + } + + /** @return Table */ + public function getTable() + { + return $this->table; + } + + /** @return AbstractPlatform */ + public function getPlatform() + { + return $this->platform; + } + + /** + * Passing multiple SQL statements as an array is deprecated. Pass each statement as an individual argument instead. + * + * @param string|string[] $sql + * + * @return SchemaCreateTableColumnEventArgs + */ + public function addSql($sql) + { + $this->sql = array_merge($this->sql, is_array($sql) ? $sql : func_get_args()); + + return $this; + } + + /** @return string[] */ + public function getSql() + { + return $this->sql; + } +} diff --git a/vendor/doctrine/dbal/src/Event/SchemaCreateTableEventArgs.php b/vendor/doctrine/dbal/src/Event/SchemaCreateTableEventArgs.php new file mode 100644 index 00000000..a7d548de --- /dev/null +++ b/vendor/doctrine/dbal/src/Event/SchemaCreateTableEventArgs.php @@ -0,0 +1,87 @@ +table = $table; + $this->columns = $columns; + $this->options = $options; + $this->platform = $platform; + } + + /** @return Table */ + public function getTable() + { + return $this->table; + } + + /** @return mixed[][] */ + public function getColumns() + { + return $this->columns; + } + + /** @return mixed[] */ + public function getOptions() + { + return $this->options; + } + + /** @return AbstractPlatform */ + public function getPlatform() + { + return $this->platform; + } + + /** + * Passing multiple SQL statements as an array is deprecated. Pass each statement as an individual argument instead. + * + * @param string|string[] $sql + * + * @return SchemaCreateTableEventArgs + */ + public function addSql($sql) + { + $this->sql = array_merge($this->sql, is_array($sql) ? $sql : func_get_args()); + + return $this; + } + + /** @return string[] */ + public function getSql() + { + return $this->sql; + } +} diff --git a/vendor/doctrine/dbal/src/Event/SchemaDropTableEventArgs.php b/vendor/doctrine/dbal/src/Event/SchemaDropTableEventArgs.php new file mode 100644 index 00000000..f45e3a15 --- /dev/null +++ b/vendor/doctrine/dbal/src/Event/SchemaDropTableEventArgs.php @@ -0,0 +1,64 @@ +table = $table; + $this->platform = $platform; + } + + /** @return string|Table */ + public function getTable() + { + return $this->table; + } + + /** @return AbstractPlatform */ + public function getPlatform() + { + return $this->platform; + } + + /** + * @param string $sql + * + * @return SchemaDropTableEventArgs + */ + public function setSql($sql) + { + $this->sql = $sql; + + return $this; + } + + /** @return string|null */ + public function getSql() + { + return $this->sql; + } +} diff --git a/vendor/doctrine/dbal/src/Event/SchemaEventArgs.php b/vendor/doctrine/dbal/src/Event/SchemaEventArgs.php new file mode 100644 index 00000000..77d1d390 --- /dev/null +++ b/vendor/doctrine/dbal/src/Event/SchemaEventArgs.php @@ -0,0 +1,29 @@ +preventDefault = true; + + return $this; + } + + /** @return bool */ + public function isDefaultPrevented() + { + return $this->preventDefault; + } +} diff --git a/vendor/doctrine/dbal/src/Event/SchemaIndexDefinitionEventArgs.php b/vendor/doctrine/dbal/src/Event/SchemaIndexDefinitionEventArgs.php new file mode 100644 index 00000000..dbee55a0 --- /dev/null +++ b/vendor/doctrine/dbal/src/Event/SchemaIndexDefinitionEventArgs.php @@ -0,0 +1,75 @@ +tableIndex = $tableIndex; + $this->table = $table; + $this->connection = $connection; + } + + /** + * Allows to clear the index which means the index will be excluded from tables index list. + * + * @return SchemaIndexDefinitionEventArgs + */ + public function setIndex(?Index $index = null) + { + $this->index = $index; + + return $this; + } + + /** @return Index|null */ + public function getIndex() + { + return $this->index; + } + + /** @return mixed[] */ + public function getTableIndex() + { + return $this->tableIndex; + } + + /** @return string */ + public function getTable() + { + return $this->table; + } + + /** @return Connection */ + public function getConnection() + { + return $this->connection; + } +} diff --git a/vendor/doctrine/dbal/src/Event/TransactionBeginEventArgs.php b/vendor/doctrine/dbal/src/Event/TransactionBeginEventArgs.php new file mode 100644 index 00000000..be4ccdf1 --- /dev/null +++ b/vendor/doctrine/dbal/src/Event/TransactionBeginEventArgs.php @@ -0,0 +1,10 @@ +connection = $connection; + } + + public function getConnection(): Connection + { + return $this->connection; + } +} diff --git a/vendor/doctrine/dbal/src/Event/TransactionRollBackEventArgs.php b/vendor/doctrine/dbal/src/Event/TransactionRollBackEventArgs.php new file mode 100644 index 00000000..9e6e650d --- /dev/null +++ b/vendor/doctrine/dbal/src/Event/TransactionRollBackEventArgs.php @@ -0,0 +1,10 @@ +getMessage(); + } else { + $message = 'An exception occurred in the driver: ' . $driverException->getMessage(); + } + + parent::__construct($message, $driverException->getCode(), $driverException); + + $this->query = $query; + } + + /** + * {@inheritDoc} + */ + public function getSQLState() + { + $previous = $this->getPrevious(); + assert($previous instanceof TheDriverException); + + return $previous->getSQLState(); + } + + public function getQuery(): ?Query + { + return $this->query; + } +} diff --git a/vendor/doctrine/dbal/src/Exception/ForeignKeyConstraintViolationException.php b/vendor/doctrine/dbal/src/Exception/ForeignKeyConstraintViolationException.php new file mode 100644 index 00000000..f1a612b2 --- /dev/null +++ b/vendor/doctrine/dbal/src/Exception/ForeignKeyConstraintViolationException.php @@ -0,0 +1,12 @@ +|array */ + private array $originalParameters; + + /** @var array|array */ + private array $originalTypes; + + private int $originalParameterIndex = 0; + + /** @var list */ + private array $convertedSQL = []; + + /** @var list */ + private array $convertedParameters = []; + + /** @var array */ + private array $convertedTypes = []; + + /** + * @param array|array $parameters + * @param array|array $types + */ + public function __construct(array $parameters, array $types) + { + $this->originalParameters = $parameters; + $this->originalTypes = $types; + } + + public function acceptPositionalParameter(string $sql): void + { + $index = $this->originalParameterIndex; + + if (! array_key_exists($index, $this->originalParameters)) { + throw MissingPositionalParameter::new($index); + } + + $this->acceptParameter($index, $this->originalParameters[$index]); + + $this->originalParameterIndex++; + } + + public function acceptNamedParameter(string $sql): void + { + $name = substr($sql, 1); + + if (! array_key_exists($name, $this->originalParameters)) { + throw MissingNamedParameter::new($name); + } + + $this->acceptParameter($name, $this->originalParameters[$name]); + } + + public function acceptOther(string $sql): void + { + $this->convertedSQL[] = $sql; + } + + public function getSQL(): string + { + return implode('', $this->convertedSQL); + } + + /** @return list */ + public function getParameters(): array + { + return $this->convertedParameters; + } + + /** + * @param int|string $key + * @param mixed $value + */ + private function acceptParameter($key, $value): void + { + if (! isset($this->originalTypes[$key])) { + $this->convertedSQL[] = '?'; + $this->convertedParameters[] = $value; + + return; + } + + $type = $this->originalTypes[$key]; + + if ( + $type !== Connection::PARAM_INT_ARRAY + && $type !== Connection::PARAM_STR_ARRAY + && $type !== Connection::PARAM_ASCII_STR_ARRAY + ) { + $this->appendTypedParameter([$value], $type); + + return; + } + + if (count($value) === 0) { + $this->convertedSQL[] = 'NULL'; + + return; + } + + $this->appendTypedParameter($value, $type - Connection::ARRAY_PARAM_OFFSET); + } + + /** @return array */ + public function getTypes(): array + { + return $this->convertedTypes; + } + + /** + * @param list $values + * @param Type|int|string|null $type + */ + private function appendTypedParameter(array $values, $type): void + { + $this->convertedSQL[] = implode(', ', array_fill(0, count($values), '?')); + + $index = count($this->convertedParameters); + + foreach ($values as $value) { + $this->convertedParameters[] = $value; + $this->convertedTypes[$index] = $type; + + $index++; + } + } +} diff --git a/vendor/doctrine/dbal/src/FetchMode.php b/vendor/doctrine/dbal/src/FetchMode.php new file mode 100644 index 00000000..4909bc62 --- /dev/null +++ b/vendor/doctrine/dbal/src/FetchMode.php @@ -0,0 +1,18 @@ +getDriver() instanceof Driver\PDO\SQLite\Driver) { + throw new Exception('Cannot use TableGenerator with SQLite.'); + } + + $this->conn = DriverManager::getConnection( + $conn->getParams(), + $conn->getConfiguration(), + $conn->getEventManager(), + ); + + $this->generatorTableName = $generatorTableName; + } + + /** + * Generates the next unused value for the given sequence name. + * + * @param string $sequence + * + * @return int + * + * @throws Exception + */ + public function nextValue($sequence) + { + if (isset($this->sequences[$sequence])) { + $value = $this->sequences[$sequence]['value']; + $this->sequences[$sequence]['value']++; + if ($this->sequences[$sequence]['value'] >= $this->sequences[$sequence]['max']) { + unset($this->sequences[$sequence]); + } + + return $value; + } + + $this->conn->beginTransaction(); + + try { + $platform = $this->conn->getDatabasePlatform(); + $sql = 'SELECT sequence_value, sequence_increment_by' + . ' FROM ' . $platform->appendLockHint($this->generatorTableName, LockMode::PESSIMISTIC_WRITE) + . ' WHERE sequence_name = ? ' . $platform->getWriteLockSQL(); + $row = $this->conn->fetchAssociative($sql, [$sequence]); + + if ($row !== false) { + $row = array_change_key_case($row, CASE_LOWER); + + $value = $row['sequence_value']; + $value++; + + assert(is_int($value)); + + if ($row['sequence_increment_by'] > 1) { + $this->sequences[$sequence] = [ + 'value' => $value, + 'max' => $row['sequence_value'] + $row['sequence_increment_by'], + ]; + } + + $sql = 'UPDATE ' . $this->generatorTableName . ' ' . + 'SET sequence_value = sequence_value + sequence_increment_by ' . + 'WHERE sequence_name = ? AND sequence_value = ?'; + $rows = $this->conn->executeStatement($sql, [$sequence, $row['sequence_value']]); + + if ($rows !== 1) { + throw new Exception('Race-condition detected while updating sequence. Aborting generation'); + } + } else { + $this->conn->insert( + $this->generatorTableName, + ['sequence_name' => $sequence, 'sequence_value' => 1, 'sequence_increment_by' => 1], + ); + $value = 1; + } + + $this->conn->commit(); + } catch (Throwable $e) { + $this->conn->rollBack(); + + throw new Exception( + 'Error occurred while generating ID with TableGenerator, aborted generation: ' . $e->getMessage(), + 0, + $e, + ); + } + + return $value; + } +} diff --git a/vendor/doctrine/dbal/src/Id/TableGeneratorSchemaVisitor.php b/vendor/doctrine/dbal/src/Id/TableGeneratorSchemaVisitor.php new file mode 100644 index 00000000..9b4724dd --- /dev/null +++ b/vendor/doctrine/dbal/src/Id/TableGeneratorSchemaVisitor.php @@ -0,0 +1,77 @@ +generatorTableName = $generatorTableName; + } + + /** + * {@inheritdoc} + */ + public function acceptSchema(Schema $schema) + { + $table = $schema->createTable($this->generatorTableName); + $table->addColumn('sequence_name', 'string'); + $table->addColumn('sequence_value', 'integer', ['default' => 1]); + $table->addColumn('sequence_increment_by', 'integer', ['default' => 1]); + } + + /** + * {@inheritdoc} + */ + public function acceptTable(Table $table) + { + } + + /** + * {@inheritdoc} + */ + public function acceptColumn(Table $table, Column $column) + { + } + + /** + * {@inheritdoc} + */ + public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) + { + } + + /** + * {@inheritdoc} + */ + public function acceptIndex(Table $table, Index $index) + { + } + + /** + * {@inheritdoc} + */ + public function acceptSequence(Sequence $sequence) + { + } +} diff --git a/vendor/doctrine/dbal/src/LockMode.php b/vendor/doctrine/dbal/src/LockMode.php new file mode 100644 index 00000000..1a7ed239 --- /dev/null +++ b/vendor/doctrine/dbal/src/LockMode.php @@ -0,0 +1,23 @@ +logger = $logger; + } + + public function __destruct() + { + $this->logger->info('Disconnecting'); + } + + public function prepare(string $sql): DriverStatement + { + return new Statement( + parent::prepare($sql), + $this->logger, + $sql, + ); + } + + public function query(string $sql): Result + { + $this->logger->debug('Executing query: {sql}', ['sql' => $sql]); + + return parent::query($sql); + } + + public function exec(string $sql): int + { + $this->logger->debug('Executing statement: {sql}', ['sql' => $sql]); + + return parent::exec($sql); + } + + /** + * {@inheritDoc} + */ + public function beginTransaction() + { + $this->logger->debug('Beginning transaction'); + + return parent::beginTransaction(); + } + + /** + * {@inheritDoc} + */ + public function commit() + { + $this->logger->debug('Committing transaction'); + + return parent::commit(); + } + + /** + * {@inheritDoc} + */ + public function rollBack() + { + $this->logger->debug('Rolling back transaction'); + + return parent::rollBack(); + } +} diff --git a/vendor/doctrine/dbal/src/Logging/DebugStack.php b/vendor/doctrine/dbal/src/Logging/DebugStack.php new file mode 100644 index 00000000..e8539e58 --- /dev/null +++ b/vendor/doctrine/dbal/src/Logging/DebugStack.php @@ -0,0 +1,75 @@ +> + */ + public $queries = []; + + /** + * If Debug Stack is enabled (log queries) or not. + * + * @var bool + */ + public $enabled = true; + + /** @var float|null */ + public $start = null; + + /** @var int */ + public $currentQuery = 0; + + public function __construct() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4967', + 'DebugStack is deprecated.', + ); + } + + /** + * {@inheritdoc} + */ + public function startQuery($sql, ?array $params = null, ?array $types = null) + { + if (! $this->enabled) { + return; + } + + $this->start = microtime(true); + + $this->queries[++$this->currentQuery] = [ + 'sql' => $sql, + 'params' => $params, + 'types' => $types, + 'executionMS' => 0, + ]; + } + + /** + * {@inheritdoc} + */ + public function stopQuery() + { + if (! $this->enabled) { + return; + } + + $this->queries[$this->currentQuery]['executionMS'] = microtime(true) - $this->start; + } +} diff --git a/vendor/doctrine/dbal/src/Logging/Driver.php b/vendor/doctrine/dbal/src/Logging/Driver.php new file mode 100644 index 00000000..10cea8f0 --- /dev/null +++ b/vendor/doctrine/dbal/src/Logging/Driver.php @@ -0,0 +1,53 @@ +logger = $logger; + } + + /** + * {@inheritDoc} + */ + public function connect(array $params) + { + $this->logger->info('Connecting with parameters {params}', ['params' => $this->maskPassword($params)]); + + return new Connection( + parent::connect($params), + $this->logger, + ); + } + + /** + * @param array $params Connection parameters + * + * @return array + */ + private function maskPassword(array $params): array + { + if (isset($params['password'])) { + $params['password'] = ''; + } + + if (isset($params['url'])) { + $params['url'] = ''; + } + + return $params; + } +} diff --git a/vendor/doctrine/dbal/src/Logging/LoggerChain.php b/vendor/doctrine/dbal/src/Logging/LoggerChain.php new file mode 100644 index 00000000..3c62a1d8 --- /dev/null +++ b/vendor/doctrine/dbal/src/Logging/LoggerChain.php @@ -0,0 +1,48 @@ + */ + private iterable $loggers; + + /** @param iterable $loggers */ + public function __construct(iterable $loggers = []) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4967', + 'LoggerChain is deprecated', + ); + + $this->loggers = $loggers; + } + + /** + * {@inheritdoc} + */ + public function startQuery($sql, ?array $params = null, ?array $types = null) + { + foreach ($this->loggers as $logger) { + $logger->startQuery($sql, $params, $types); + } + } + + /** + * {@inheritdoc} + */ + public function stopQuery() + { + foreach ($this->loggers as $logger) { + $logger->stopQuery(); + } + } +} diff --git a/vendor/doctrine/dbal/src/Logging/Middleware.php b/vendor/doctrine/dbal/src/Logging/Middleware.php new file mode 100644 index 00000000..da0c1b90 --- /dev/null +++ b/vendor/doctrine/dbal/src/Logging/Middleware.php @@ -0,0 +1,24 @@ +logger = $logger; + } + + public function wrap(DriverInterface $driver): DriverInterface + { + return new Driver($driver, $this->logger); + } +} diff --git a/vendor/doctrine/dbal/src/Logging/SQLLogger.php b/vendor/doctrine/dbal/src/Logging/SQLLogger.php new file mode 100644 index 00000000..dab4a3a7 --- /dev/null +++ b/vendor/doctrine/dbal/src/Logging/SQLLogger.php @@ -0,0 +1,32 @@ +|array|null $params Statement parameters + * @param array|array|null $types Parameter types + * + * @return void + */ + public function startQuery($sql, ?array $params = null, ?array $types = null); + + /** + * Marks the last started query as stopped. This can be used for timing of queries. + * + * @return void + */ + public function stopQuery(); +} diff --git a/vendor/doctrine/dbal/src/Logging/Statement.php b/vendor/doctrine/dbal/src/Logging/Statement.php new file mode 100644 index 00000000..95d60358 --- /dev/null +++ b/vendor/doctrine/dbal/src/Logging/Statement.php @@ -0,0 +1,100 @@ +|array */ + private array $params = []; + + /** @var array|array */ + private array $types = []; + + /** @internal This statement can be only instantiated by its connection. */ + public function __construct(StatementInterface $statement, LoggerInterface $logger, string $sql) + { + parent::__construct($statement); + + $this->logger = $logger; + $this->sql = $sql; + } + + /** + * {@inheritdoc} + * + * @deprecated Use {@see bindValue()} instead. + */ + public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5563', + '%s is deprecated. Use bindValue() instead.', + __METHOD__, + ); + + if (func_num_args() < 3) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5558', + 'Not passing $type to Statement::bindParam() is deprecated.' + . ' Pass the type corresponding to the parameter being bound.', + ); + } + + $this->params[$param] = &$variable; + $this->types[$param] = $type; + + return parent::bindParam($param, $variable, $type, ...array_slice(func_get_args(), 3)); + } + + /** + * {@inheritdoc} + */ + public function bindValue($param, $value, $type = ParameterType::STRING) + { + if (func_num_args() < 3) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5558', + 'Not passing $type to Statement::bindValue() is deprecated.' + . ' Pass the type corresponding to the parameter being bound.', + ); + } + + $this->params[$param] = $value; + $this->types[$param] = $type; + + return parent::bindValue($param, $value, $type); + } + + /** + * {@inheritdoc} + */ + public function execute($params = null): ResultInterface + { + $this->logger->debug('Executing statement: {sql} (parameters: {params}, types: {types})', [ + 'sql' => $this->sql, + 'params' => $params ?? $this->params, + 'types' => $this->types, + ]); + + return parent::execute($params); + } +} diff --git a/vendor/doctrine/dbal/src/ParameterType.php b/vendor/doctrine/dbal/src/ParameterType.php new file mode 100644 index 00000000..77917e87 --- /dev/null +++ b/vendor/doctrine/dbal/src/ParameterType.php @@ -0,0 +1,57 @@ + 0) { + $query .= sprintf(' OFFSET %d', $offset); + } + } elseif ($offset > 0) { + // 2^64-1 is the maximum of unsigned BIGINT, the biggest limit possible + $query .= sprintf(' LIMIT 18446744073709551615 OFFSET %d', $offset); + } + + return $query; + } + + /** + * {@inheritDoc} + * + * @deprecated Use {@see quoteIdentifier()} to quote identifiers instead. + */ + public function getIdentifierQuoteCharacter() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5388', + 'AbstractMySQLPlatform::getIdentifierQuoteCharacter() is deprecated. Use quoteIdentifier() instead.', + ); + + return '`'; + } + + /** + * {@inheritDoc} + */ + public function getRegexpExpression() + { + return 'RLIKE'; + } + + /** + * {@inheritDoc} + */ + public function getLocateExpression($str, $substr, $startPos = false) + { + if ($startPos === false) { + return 'LOCATE(' . $substr . ', ' . $str . ')'; + } + + return 'LOCATE(' . $substr . ', ' . $str . ', ' . $startPos . ')'; + } + + /** + * {@inheritDoc} + */ + public function getConcatExpression() + { + return sprintf('CONCAT(%s)', implode(', ', func_get_args())); + } + + /** + * {@inheritdoc} + */ + protected function getDateArithmeticIntervalExpression($date, $operator, $interval, $unit) + { + $function = $operator === '+' ? 'DATE_ADD' : 'DATE_SUB'; + + return $function . '(' . $date . ', INTERVAL ' . $interval . ' ' . $unit . ')'; + } + + /** + * {@inheritDoc} + */ + public function getDateDiffExpression($date1, $date2) + { + return 'DATEDIFF(' . $date1 . ', ' . $date2 . ')'; + } + + public function getCurrentDatabaseExpression(): string + { + return 'DATABASE()'; + } + + /** + * {@inheritDoc} + */ + public function getLengthExpression($column) + { + return 'CHAR_LENGTH(' . $column . ')'; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractSchemaManager} class hierarchy. + */ + public function getListDatabasesSQL() + { + return 'SHOW DATABASES'; + } + + /** + * @deprecated + * + * {@inheritDoc} + */ + public function getListTableConstraintsSQL($table) + { + return 'SHOW INDEX FROM ' . $table; + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * {@inheritDoc} + * + * Two approaches to listing the table indexes. The information_schema is + * preferred, because it doesn't cause problems with SQL keywords such as "order" or "table". + */ + public function getListTableIndexesSQL($table, $database = null) + { + if ($database !== null) { + return 'SELECT NON_UNIQUE AS Non_Unique, INDEX_NAME AS Key_name, COLUMN_NAME AS Column_Name,' . + ' SUB_PART AS Sub_Part, INDEX_TYPE AS Index_Type' . + ' FROM information_schema.STATISTICS WHERE TABLE_NAME = ' . $this->quoteStringLiteral($table) . + ' AND TABLE_SCHEMA = ' . $this->quoteStringLiteral($database) . + ' ORDER BY SEQ_IN_INDEX ASC'; + } + + return 'SHOW INDEX FROM ' . $table; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractSchemaManager} class hierarchy. + */ + public function getListViewsSQL($database) + { + return 'SELECT * FROM information_schema.VIEWS WHERE TABLE_SCHEMA = ' . $this->quoteStringLiteral($database); + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * @param string $table + * @param string|null $database + * + * @return string + */ + public function getListTableForeignKeysSQL($table, $database = null) + { + // The schema name is passed multiple times as a literal in the WHERE clause instead of using a JOIN condition + // in order to avoid performance issues on MySQL older than 8.0 and the corresponding MariaDB versions + // caused by https://bugs.mysql.com/bug.php?id=81347 + return 'SELECT k.CONSTRAINT_NAME, k.COLUMN_NAME, k.REFERENCED_TABLE_NAME, ' . + 'k.REFERENCED_COLUMN_NAME /*!50116 , c.UPDATE_RULE, c.DELETE_RULE */ ' . + 'FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE k /*!50116 ' . + 'INNER JOIN INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS c ON ' . + 'c.CONSTRAINT_NAME = k.CONSTRAINT_NAME AND ' . + 'c.TABLE_NAME = k.TABLE_NAME */ ' . + 'WHERE k.TABLE_NAME = ' . $this->quoteStringLiteral($table) . ' ' . + 'AND k.TABLE_SCHEMA = ' . $this->getDatabaseNameSQL($database) . ' /*!50116 ' . + 'AND c.CONSTRAINT_SCHEMA = ' . $this->getDatabaseNameSQL($database) . ' */' . + 'ORDER BY k.ORDINAL_POSITION'; + } + + /** + * {@inheritDoc} + */ + protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed/*, $lengthOmitted = false*/) + { + if ($length <= 0 || (func_num_args() > 2 && func_get_arg(2))) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3263', + 'Relying on the default string column length on MySQL is deprecated' + . ', specify the length explicitly.', + ); + } + + return $fixed ? ($length > 0 ? 'CHAR(' . $length . ')' : 'CHAR(255)') + : ($length > 0 ? 'VARCHAR(' . $length . ')' : 'VARCHAR(255)'); + } + + /** + * {@inheritdoc} + */ + protected function getBinaryTypeDeclarationSQLSnippet($length, $fixed/*, $lengthOmitted = false*/) + { + if ($length <= 0 || (func_num_args() > 2 && func_get_arg(2))) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3263', + 'Relying on the default binary column length on MySQL is deprecated' + . ', specify the length explicitly.', + ); + } + + return $fixed + ? 'BINARY(' . ($length > 0 ? $length : 255) . ')' + : 'VARBINARY(' . ($length > 0 ? $length : 255) . ')'; + } + + /** + * Gets the SQL snippet used to declare a CLOB column type. + * TINYTEXT : 2 ^ 8 - 1 = 255 + * TEXT : 2 ^ 16 - 1 = 65535 + * MEDIUMTEXT : 2 ^ 24 - 1 = 16777215 + * LONGTEXT : 2 ^ 32 - 1 = 4294967295 + * + * {@inheritDoc} + */ + public function getClobTypeDeclarationSQL(array $column) + { + if (! empty($column['length']) && is_numeric($column['length'])) { + $length = $column['length']; + + if ($length <= static::LENGTH_LIMIT_TINYTEXT) { + return 'TINYTEXT'; + } + + if ($length <= static::LENGTH_LIMIT_TEXT) { + return 'TEXT'; + } + + if ($length <= static::LENGTH_LIMIT_MEDIUMTEXT) { + return 'MEDIUMTEXT'; + } + } + + return 'LONGTEXT'; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeTypeDeclarationSQL(array $column) + { + if (isset($column['version']) && $column['version'] === true) { + return 'TIMESTAMP'; + } + + return 'DATETIME'; + } + + /** + * {@inheritDoc} + */ + public function getDateTypeDeclarationSQL(array $column) + { + return 'DATE'; + } + + /** + * {@inheritDoc} + */ + public function getTimeTypeDeclarationSQL(array $column) + { + return 'TIME'; + } + + /** + * {@inheritDoc} + */ + public function getBooleanTypeDeclarationSQL(array $column) + { + return 'TINYINT(1)'; + } + + /** + * {@inheritDoc} + * + * @deprecated + * + * MySQL prefers "autoincrement" identity columns since sequences can only + * be emulated with a table. + */ + public function prefersIdentityColumns() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/1519', + 'AbstractMySQLPlatform::prefersIdentityColumns() is deprecated.', + ); + + return true; + } + + /** + * {@inheritDoc} + * + * MySQL supports this through AUTO_INCREMENT columns. + */ + public function supportsIdentityColumns() + { + return true; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function supportsInlineColumnComments() + { + return true; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function supportsColumnCollation() + { + return true; + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * {@inheritDoc} + */ + public function getListTablesSQL() + { + return "SHOW FULL TABLES WHERE Table_type = 'BASE TABLE'"; + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * {@inheritDoc} + */ + public function getListTableColumnsSQL($table, $database = null) + { + return 'SELECT COLUMN_NAME AS Field, COLUMN_TYPE AS Type, IS_NULLABLE AS `Null`, ' . + 'COLUMN_KEY AS `Key`, COLUMN_DEFAULT AS `Default`, EXTRA AS Extra, COLUMN_COMMENT AS Comment, ' . + 'CHARACTER_SET_NAME AS CharacterSet, COLLATION_NAME AS Collation ' . + 'FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = ' . $this->getDatabaseNameSQL($database) . + ' AND TABLE_NAME = ' . $this->quoteStringLiteral($table) . + ' ORDER BY ORDINAL_POSITION ASC'; + } + + /** @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. */ + public function getListTableMetadataSQL(string $table, ?string $database = null): string + { + return sprintf( + <<<'SQL' +SELECT t.ENGINE, + t.AUTO_INCREMENT, + t.TABLE_COMMENT, + t.CREATE_OPTIONS, + t.TABLE_COLLATION, + ccsa.CHARACTER_SET_NAME +FROM information_schema.TABLES t + INNER JOIN information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` ccsa + ON ccsa.COLLATION_NAME = t.TABLE_COLLATION +WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_SCHEMA = %s AND TABLE_NAME = %s +SQL + , + $this->getDatabaseNameSQL($database), + $this->quoteStringLiteral($table), + ); + } + + /** + * {@inheritDoc} + */ + public function getCreateTablesSQL(array $tables): array + { + $sql = []; + + foreach ($tables as $table) { + $sql = array_merge($sql, $this->getCreateTableWithoutForeignKeysSQL($table)); + } + + foreach ($tables as $table) { + if (! $table->hasOption('engine') || $this->engineSupportsForeignKeys($table->getOption('engine'))) { + foreach ($table->getForeignKeys() as $foreignKey) { + $sql[] = $this->getCreateForeignKeySQL( + $foreignKey, + $table->getQuotedName($this), + ); + } + } elseif (count($table->getForeignKeys()) > 0) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5414', + 'Relying on the DBAL not generating DDL for foreign keys on MySQL engines' + . ' other than InnoDB is deprecated.' + . ' Define foreign key constraints only if they are necessary.', + ); + } + } + + return $sql; + } + + /** + * {@inheritDoc} + */ + protected function _getCreateTableSQL($name, array $columns, array $options = []) + { + $queryFields = $this->getColumnDeclarationListSQL($columns); + + if (isset($options['uniqueConstraints']) && ! empty($options['uniqueConstraints'])) { + foreach ($options['uniqueConstraints'] as $constraintName => $definition) { + $queryFields .= ', ' . $this->getUniqueConstraintDeclarationSQL($constraintName, $definition); + } + } + + // add all indexes + if (isset($options['indexes']) && ! empty($options['indexes'])) { + foreach ($options['indexes'] as $indexName => $definition) { + $queryFields .= ', ' . $this->getIndexDeclarationSQL($indexName, $definition); + } + } + + // attach all primary keys + if (isset($options['primary']) && ! empty($options['primary'])) { + $keyColumns = array_unique(array_values($options['primary'])); + $queryFields .= ', PRIMARY KEY(' . implode(', ', $keyColumns) . ')'; + } + + $query = 'CREATE '; + + if (! empty($options['temporary'])) { + $query .= 'TEMPORARY '; + } + + $query .= 'TABLE ' . $name . ' (' . $queryFields . ') '; + $query .= $this->buildTableOptions($options); + $query .= $this->buildPartitionOptions($options); + + $sql = [$query]; + + // Propagate foreign key constraints only for InnoDB. + if (isset($options['foreignKeys'])) { + if (! isset($options['engine']) || $this->engineSupportsForeignKeys($options['engine'])) { + foreach ($options['foreignKeys'] as $definition) { + $sql[] = $this->getCreateForeignKeySQL($definition, $name); + } + } elseif (count($options['foreignKeys']) > 0) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5414', + 'Relying on the DBAL not generating DDL for foreign keys on MySQL engines' + . ' other than InnoDB is deprecated.' + . ' Define foreign key constraints only if they are necessary.', + ); + } + } + + return $sql; + } + + /** + * {@inheritdoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function getDefaultValueDeclarationSQL($column) + { + // Unset the default value if the given column definition does not allow default values. + if ($column['type'] instanceof TextType || $column['type'] instanceof BlobType) { + $column['default'] = null; + } + + return parent::getDefaultValueDeclarationSQL($column); + } + + /** + * Build SQL for table options + * + * @param mixed[] $options + */ + private function buildTableOptions(array $options): string + { + if (isset($options['table_options'])) { + return $options['table_options']; + } + + $tableOptions = []; + + // Charset + if (! isset($options['charset'])) { + $options['charset'] = 'utf8'; + } + + $tableOptions[] = sprintf('DEFAULT CHARACTER SET %s', $options['charset']); + + if (isset($options['collate'])) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/5214', + 'The "collate" option is deprecated in favor of "collation" and will be removed in 4.0.', + ); + $options['collation'] = $options['collate']; + } + + // Collation + if (! isset($options['collation'])) { + $options['collation'] = $options['charset'] . '_unicode_ci'; + } + + $tableOptions[] = $this->getColumnCollationDeclarationSQL($options['collation']); + + // Engine + if (! isset($options['engine'])) { + $options['engine'] = 'InnoDB'; + } + + $tableOptions[] = sprintf('ENGINE = %s', $options['engine']); + + // Auto increment + if (isset($options['auto_increment'])) { + $tableOptions[] = sprintf('AUTO_INCREMENT = %s', $options['auto_increment']); + } + + // Comment + if (isset($options['comment'])) { + $tableOptions[] = sprintf('COMMENT = %s ', $this->quoteStringLiteral($options['comment'])); + } + + // Row format + if (isset($options['row_format'])) { + $tableOptions[] = sprintf('ROW_FORMAT = %s', $options['row_format']); + } + + return implode(' ', $tableOptions); + } + + /** + * Build SQL for partition options. + * + * @param mixed[] $options + */ + private function buildPartitionOptions(array $options): string + { + return isset($options['partition_options']) + ? ' ' . $options['partition_options'] + : ''; + } + + private function engineSupportsForeignKeys(string $engine): bool + { + return strcasecmp(trim($engine), 'InnoDB') === 0; + } + + /** + * {@inheritDoc} + */ + public function getAlterTableSQL(TableDiff $diff) + { + $columnSql = []; + $queryParts = []; + $newName = $diff->getNewName(); + + if ($newName !== false) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5663', + 'Generation of SQL that renames a table using %s is deprecated. Use getRenameTableSQL() instead.', + __METHOD__, + ); + + $queryParts[] = 'RENAME TO ' . $newName->getQuotedName($this); + } + + foreach ($diff->getAddedColumns() as $column) { + if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { + continue; + } + + $columnProperties = array_merge($column->toArray(), [ + 'comment' => $this->getColumnComment($column), + ]); + + $queryParts[] = 'ADD ' . $this->getColumnDeclarationSQL( + $column->getQuotedName($this), + $columnProperties, + ); + } + + foreach ($diff->getDroppedColumns() as $column) { + if ($this->onSchemaAlterTableRemoveColumn($column, $diff, $columnSql)) { + continue; + } + + $queryParts[] = 'DROP ' . $column->getQuotedName($this); + } + + foreach ($diff->getModifiedColumns() as $columnDiff) { + if ($this->onSchemaAlterTableChangeColumn($columnDiff, $diff, $columnSql)) { + continue; + } + + $newColumn = $columnDiff->getNewColumn(); + + $newColumnProperties = array_merge($newColumn->toArray(), [ + 'comment' => $this->getColumnComment($newColumn), + ]); + + $oldColumn = $columnDiff->getOldColumn() ?? $columnDiff->getOldColumnName(); + + $queryParts[] = 'CHANGE ' . $oldColumn->getQuotedName($this) . ' ' + . $this->getColumnDeclarationSQL($newColumn->getQuotedName($this), $newColumnProperties); + } + + foreach ($diff->getRenamedColumns() as $oldColumnName => $column) { + if ($this->onSchemaAlterTableRenameColumn($oldColumnName, $column, $diff, $columnSql)) { + continue; + } + + $oldColumnName = new Identifier($oldColumnName); + + $columnProperties = array_merge($column->toArray(), [ + 'comment' => $this->getColumnComment($column), + ]); + + $queryParts[] = 'CHANGE ' . $oldColumnName->getQuotedName($this) . ' ' + . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnProperties); + } + + $addedIndexes = $this->indexAssetsByLowerCaseName($diff->getAddedIndexes()); + $modifiedIndexes = $this->indexAssetsByLowerCaseName($diff->getModifiedIndexes()); + $diffModified = false; + + if (isset($addedIndexes['primary'])) { + $keyColumns = array_unique(array_values($addedIndexes['primary']->getColumns())); + $queryParts[] = 'ADD PRIMARY KEY (' . implode(', ', $keyColumns) . ')'; + unset($addedIndexes['primary']); + $diffModified = true; + } elseif (isset($modifiedIndexes['primary'])) { + $addedColumns = $this->indexAssetsByLowerCaseName($diff->getAddedColumns()); + + // Necessary in case the new primary key includes a new auto_increment column + foreach ($modifiedIndexes['primary']->getColumns() as $columnName) { + if (isset($addedColumns[$columnName]) && $addedColumns[$columnName]->getAutoincrement()) { + $keyColumns = array_unique(array_values($modifiedIndexes['primary']->getColumns())); + $queryParts[] = 'DROP PRIMARY KEY'; + $queryParts[] = 'ADD PRIMARY KEY (' . implode(', ', $keyColumns) . ')'; + unset($modifiedIndexes['primary']); + $diffModified = true; + break; + } + } + } + + if ($diffModified) { + $diff = new TableDiff( + $diff->name, + $diff->getAddedColumns(), + $diff->getModifiedColumns(), + $diff->getDroppedColumns(), + array_values($addedIndexes), + array_values($modifiedIndexes), + $diff->getDroppedIndexes(), + $diff->getOldTable(), + $diff->getAddedForeignKeys(), + $diff->getModifiedForeignKeys(), + $diff->getDroppedForeignKeys(), + $diff->getRenamedColumns(), + $diff->getRenamedIndexes(), + ); + } + + $sql = []; + $tableSql = []; + + if (! $this->onSchemaAlterTable($diff, $tableSql)) { + if (count($queryParts) > 0) { + $sql[] = 'ALTER TABLE ' . ($diff->getOldTable() ?? $diff->getName($this))->getQuotedName($this) . ' ' + . implode(', ', $queryParts); + } + + $sql = array_merge( + $this->getPreAlterTableIndexForeignKeySQL($diff), + $sql, + $this->getPostAlterTableIndexForeignKeySQL($diff), + ); + } + + return array_merge($sql, $tableSql, $columnSql); + } + + /** + * {@inheritDoc} + */ + protected function getPreAlterTableIndexForeignKeySQL(TableDiff $diff) + { + $sql = []; + + $tableNameSQL = ($diff->getOldTable() ?? $diff->getName($this))->getQuotedName($this); + + foreach ($diff->getModifiedIndexes() as $changedIndex) { + $sql = array_merge($sql, $this->getPreAlterTableAlterPrimaryKeySQL($diff, $changedIndex)); + } + + foreach ($diff->getDroppedIndexes() as $droppedIndex) { + $sql = array_merge($sql, $this->getPreAlterTableAlterPrimaryKeySQL($diff, $droppedIndex)); + + foreach ($diff->getAddedIndexes() as $addedIndex) { + if ($droppedIndex->getColumns() !== $addedIndex->getColumns()) { + continue; + } + + $indexClause = 'INDEX ' . $addedIndex->getName(); + + if ($addedIndex->isPrimary()) { + $indexClause = 'PRIMARY KEY'; + } elseif ($addedIndex->isUnique()) { + $indexClause = 'UNIQUE INDEX ' . $addedIndex->getName(); + } + + $query = 'ALTER TABLE ' . $tableNameSQL . ' DROP INDEX ' . $droppedIndex->getName() . ', '; + $query .= 'ADD ' . $indexClause; + $query .= ' (' . $this->getIndexFieldDeclarationListSQL($addedIndex) . ')'; + + $sql[] = $query; + + $diff->unsetAddedIndex($addedIndex); + $diff->unsetDroppedIndex($droppedIndex); + + break; + } + } + + $engine = 'INNODB'; + + $table = $diff->getOldTable(); + + if ($table !== null && $table->hasOption('engine')) { + $engine = strtoupper(trim($table->getOption('engine'))); + } + + // Suppress foreign key constraint propagation on non-supporting engines. + if ($engine !== 'INNODB') { + $diff->addedForeignKeys = []; + $diff->changedForeignKeys = []; + $diff->removedForeignKeys = []; + } + + $sql = array_merge( + $sql, + $this->getPreAlterTableAlterIndexForeignKeySQL($diff), + parent::getPreAlterTableIndexForeignKeySQL($diff), + $this->getPreAlterTableRenameIndexForeignKeySQL($diff), + ); + + return $sql; + } + + /** + * @return string[] + * + * @throws Exception + */ + private function getPreAlterTableAlterPrimaryKeySQL(TableDiff $diff, Index $index): array + { + if (! $index->isPrimary()) { + return []; + } + + $table = $diff->getOldTable(); + + if ($table === null) { + return []; + } + + $sql = []; + + $tableNameSQL = ($diff->getOldTable() ?? $diff->getName($this))->getQuotedName($this); + + // Dropping primary keys requires to unset autoincrement attribute on the particular column first. + foreach ($index->getColumns() as $columnName) { + if (! $table->hasColumn($columnName)) { + continue; + } + + $column = $table->getColumn($columnName); + + if ($column->getAutoincrement() !== true) { + continue; + } + + $column->setAutoincrement(false); + + $sql[] = 'ALTER TABLE ' . $tableNameSQL . ' MODIFY ' . + $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray()); + + // original autoincrement information might be needed later on by other parts of the table alteration + $column->setAutoincrement(true); + } + + return $sql; + } + + /** + * @param TableDiff $diff The table diff to gather the SQL for. + * + * @return string[] + * + * @throws Exception + */ + private function getPreAlterTableAlterIndexForeignKeySQL(TableDiff $diff): array + { + $table = $diff->getOldTable(); + + if ($table === null) { + return []; + } + + $primaryKey = $table->getPrimaryKey(); + + if ($primaryKey === null) { + return []; + } + + $primaryKeyColumns = []; + + foreach ($primaryKey->getColumns() as $columnName) { + if (! $table->hasColumn($columnName)) { + continue; + } + + $primaryKeyColumns[] = $table->getColumn($columnName); + } + + if (count($primaryKeyColumns) === 0) { + return []; + } + + $sql = []; + + $tableNameSQL = $table->getQuotedName($this); + + foreach ($diff->getModifiedIndexes() as $changedIndex) { + // Changed primary key + if (! $changedIndex->isPrimary()) { + continue; + } + + foreach ($primaryKeyColumns as $column) { + // Check if an autoincrement column was dropped from the primary key. + if (! $column->getAutoincrement() || in_array($column->getName(), $changedIndex->getColumns(), true)) { + continue; + } + + // The autoincrement attribute needs to be removed from the dropped column + // before we can drop and recreate the primary key. + $column->setAutoincrement(false); + + $sql[] = 'ALTER TABLE ' . $tableNameSQL . ' MODIFY ' . + $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray()); + + // Restore the autoincrement attribute as it might be needed later on + // by other parts of the table alteration. + $column->setAutoincrement(true); + } + } + + return $sql; + } + + /** + * @param TableDiff $diff The table diff to gather the SQL for. + * + * @return string[] + */ + protected function getPreAlterTableRenameIndexForeignKeySQL(TableDiff $diff) + { + $sql = []; + + $tableNameSQL = ($diff->getOldTable() ?? $diff->getName($this))->getQuotedName($this); + + foreach ($this->getRemainingForeignKeyConstraintsRequiringRenamedIndexes($diff) as $foreignKey) { + if (in_array($foreignKey, $diff->getModifiedForeignKeys(), true)) { + continue; + } + + $sql[] = $this->getDropForeignKeySQL($foreignKey->getQuotedName($this), $tableNameSQL); + } + + return $sql; + } + + /** + * Returns the remaining foreign key constraints that require one of the renamed indexes. + * + * "Remaining" here refers to the diff between the foreign keys currently defined in the associated + * table and the foreign keys to be removed. + * + * @param TableDiff $diff The table diff to evaluate. + * + * @return ForeignKeyConstraint[] + */ + private function getRemainingForeignKeyConstraintsRequiringRenamedIndexes(TableDiff $diff): array + { + if (count($diff->getRenamedIndexes()) === 0) { + return []; + } + + $table = $diff->getOldTable(); + + if ($table === null) { + return []; + } + + $foreignKeys = []; + /** @var ForeignKeyConstraint[] $remainingForeignKeys */ + $remainingForeignKeys = array_diff_key( + $table->getForeignKeys(), + $diff->getDroppedForeignKeys(), + ); + + foreach ($remainingForeignKeys as $foreignKey) { + foreach ($diff->getRenamedIndexes() as $index) { + if ($foreignKey->intersectsIndexColumns($index)) { + $foreignKeys[] = $foreignKey; + + break; + } + } + } + + return $foreignKeys; + } + + /** + * {@inheritdoc} + */ + protected function getPostAlterTableIndexForeignKeySQL(TableDiff $diff) + { + return array_merge( + parent::getPostAlterTableIndexForeignKeySQL($diff), + $this->getPostAlterTableRenameIndexForeignKeySQL($diff), + ); + } + + /** + * @param TableDiff $diff The table diff to gather the SQL for. + * + * @return string[] + */ + protected function getPostAlterTableRenameIndexForeignKeySQL(TableDiff $diff) + { + $sql = []; + $newName = $diff->getNewName(); + + if ($newName !== false) { + $tableNameSQL = $newName->getQuotedName($this); + } else { + $tableNameSQL = ($diff->getOldTable() ?? $diff->getName($this))->getQuotedName($this); + } + + foreach ($this->getRemainingForeignKeyConstraintsRequiringRenamedIndexes($diff) as $foreignKey) { + if (in_array($foreignKey, $diff->getModifiedForeignKeys(), true)) { + continue; + } + + $sql[] = $this->getCreateForeignKeySQL($foreignKey, $tableNameSQL); + } + + return $sql; + } + + /** + * {@inheritDoc} + */ + protected function getCreateIndexSQLFlags(Index $index) + { + $type = ''; + if ($index->isUnique()) { + $type .= 'UNIQUE '; + } elseif ($index->hasFlag('fulltext')) { + $type .= 'FULLTEXT '; + } elseif ($index->hasFlag('spatial')) { + $type .= 'SPATIAL '; + } + + return $type; + } + + /** + * {@inheritDoc} + */ + public function getIntegerTypeDeclarationSQL(array $column) + { + return 'INT' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + public function getBigIntTypeDeclarationSQL(array $column) + { + return 'BIGINT' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + public function getSmallIntTypeDeclarationSQL(array $column) + { + return 'SMALLINT' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function getFloatDeclarationSQL(array $column) + { + return 'DOUBLE PRECISION' . $this->getUnsignedDeclaration($column); + } + + /** + * {@inheritdoc} + */ + public function getDecimalTypeDeclarationSQL(array $column) + { + return parent::getDecimalTypeDeclarationSQL($column) . $this->getUnsignedDeclaration($column); + } + + /** + * Get unsigned declaration for a column. + * + * @param mixed[] $columnDef + */ + private function getUnsignedDeclaration(array $columnDef): string + { + return ! empty($columnDef['unsigned']) ? ' UNSIGNED' : ''; + } + + /** + * {@inheritDoc} + */ + protected function _getCommonIntegerTypeDeclarationSQL(array $column) + { + $autoinc = ''; + if (! empty($column['autoincrement'])) { + $autoinc = ' AUTO_INCREMENT'; + } + + return $this->getUnsignedDeclaration($column) . $autoinc; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function getColumnCharsetDeclarationSQL($charset) + { + return 'CHARACTER SET ' . $charset; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint $foreignKey) + { + $query = ''; + if ($foreignKey->hasOption('match')) { + $query .= ' MATCH ' . $foreignKey->getOption('match'); + } + + $query .= parent::getAdvancedForeignKeyOptionsSQL($foreignKey); + + return $query; + } + + /** + * {@inheritDoc} + */ + public function getDropIndexSQL($index, $table = null) + { + if ($index instanceof Index) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $index as an Index object to %s is deprecated. Pass it as a quoted name instead.', + __METHOD__, + ); + + $indexName = $index->getQuotedName($this); + } elseif (is_string($index)) { + $indexName = $index; + } else { + throw new InvalidArgumentException( + __METHOD__ . '() expects $index parameter to be string or ' . Index::class . '.', + ); + } + + if ($table instanceof Table) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $table as a Table object to %s is deprecated. Pass it as a quoted name instead.', + __METHOD__, + ); + + $table = $table->getQuotedName($this); + } elseif (! is_string($table)) { + throw new InvalidArgumentException( + __METHOD__ . '() expects $table parameter to be string or ' . Table::class . '.', + ); + } + + if ($index instanceof Index && $index->isPrimary()) { + // MySQL primary keys are always named "PRIMARY", + // so we cannot use them in statements because of them being keyword. + return $this->getDropPrimaryKeySQL($table); + } + + return 'DROP INDEX ' . $indexName . ' ON ' . $table; + } + + /** + * @param string $table + * + * @return string + */ + protected function getDropPrimaryKeySQL($table) + { + return 'ALTER TABLE ' . $table . ' DROP PRIMARY KEY'; + } + + /** + * The `ALTER TABLE ... DROP CONSTRAINT` syntax is only available as of MySQL 8.0.19. + * + * @link https://dev.mysql.com/doc/refman/8.0/en/alter-table.html + */ + public function getDropUniqueConstraintSQL(string $name, string $tableName): string + { + return $this->getDropIndexSQL($name, $tableName); + } + + /** + * {@inheritDoc} + */ + public function getSetTransactionIsolationSQL($level) + { + return 'SET SESSION TRANSACTION ISOLATION LEVEL ' . $this->_getTransactionIsolationLevelSQL($level); + } + + /** + * {@inheritDoc} + */ + public function getName() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4749', + 'AbstractMySQLPlatform::getName() is deprecated. Identify platforms by their class.', + ); + + return 'mysql'; + } + + /** + * {@inheritDoc} + */ + public function getReadLockSQL() + { + return 'LOCK IN SHARE MODE'; + } + + /** + * {@inheritDoc} + */ + protected function initializeDoctrineTypeMappings() + { + $this->doctrineTypeMapping = [ + 'bigint' => 'bigint', + 'binary' => 'binary', + 'blob' => 'blob', + 'char' => 'string', + 'date' => 'date', + 'datetime' => 'datetime', + 'decimal' => 'decimal', + 'double' => 'float', + 'float' => 'float', + 'int' => 'integer', + 'integer' => 'integer', + 'longblob' => 'blob', + 'longtext' => 'text', + 'mediumblob' => 'blob', + 'mediumint' => 'integer', + 'mediumtext' => 'text', + 'numeric' => 'decimal', + 'real' => 'float', + 'set' => 'simple_array', + 'smallint' => 'smallint', + 'string' => 'string', + 'text' => 'text', + 'time' => 'time', + 'timestamp' => 'datetime', + 'tinyblob' => 'blob', + 'tinyint' => 'boolean', + 'tinytext' => 'text', + 'varbinary' => 'binary', + 'varchar' => 'string', + 'year' => 'date', + ]; + } + + /** + * {@inheritDoc} + * + * @deprecated + */ + public function getVarcharMaxLength() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3263', + 'AbstractMySQLPlatform::getVarcharMaxLength() is deprecated.', + ); + + return 65535; + } + + /** + * {@inheritdoc} + * + * @deprecated + */ + public function getBinaryMaxLength() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3263', + 'AbstractMySQLPlatform::getBinaryMaxLength() is deprecated.', + ); + + return 65535; + } + + /** + * {@inheritDoc} + * + * @deprecated Implement {@see createReservedKeywordsList()} instead. + */ + protected function getReservedKeywordsClass() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4510', + 'AbstractMySQLPlatform::getReservedKeywordsClass() is deprecated,' + . ' use AbstractMySQLPlatform::createReservedKeywordsList() instead.', + ); + + return Keywords\MySQLKeywords::class; + } + + /** + * {@inheritDoc} + * + * MySQL commits a transaction implicitly when DROP TABLE is executed, however not + * if DROP TEMPORARY TABLE is executed. + */ + public function getDropTemporaryTableSQL($table) + { + if ($table instanceof Table) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $table as a Table object to %s is deprecated. Pass it as a quoted name instead.', + __METHOD__, + ); + + $table = $table->getQuotedName($this); + } elseif (! is_string($table)) { + throw new InvalidArgumentException( + __METHOD__ . '() expects $table parameter to be string or ' . Table::class . '.', + ); + } + + return 'DROP TEMPORARY TABLE ' . $table; + } + + /** + * Gets the SQL Snippet used to declare a BLOB column type. + * TINYBLOB : 2 ^ 8 - 1 = 255 + * BLOB : 2 ^ 16 - 1 = 65535 + * MEDIUMBLOB : 2 ^ 24 - 1 = 16777215 + * LONGBLOB : 2 ^ 32 - 1 = 4294967295 + * + * {@inheritDoc} + */ + public function getBlobTypeDeclarationSQL(array $column) + { + if (! empty($column['length']) && is_numeric($column['length'])) { + $length = $column['length']; + + if ($length <= static::LENGTH_LIMIT_TINYBLOB) { + return 'TINYBLOB'; + } + + if ($length <= static::LENGTH_LIMIT_BLOB) { + return 'BLOB'; + } + + if ($length <= static::LENGTH_LIMIT_MEDIUMBLOB) { + return 'MEDIUMBLOB'; + } + } + + return 'LONGBLOB'; + } + + /** + * {@inheritdoc} + */ + public function quoteStringLiteral($str) + { + $str = str_replace('\\', '\\\\', $str); // MySQL requires backslashes to be escaped + + return parent::quoteStringLiteral($str); + } + + /** + * {@inheritdoc} + */ + public function getDefaultTransactionIsolationLevel() + { + return TransactionIsolationLevel::REPEATABLE_READ; + } + + public function supportsColumnLengthIndexes(): bool + { + return true; + } + + private function getDatabaseNameSQL(?string $databaseName): string + { + if ($databaseName !== null) { + return $this->quoteStringLiteral($databaseName); + } + + return $this->getCurrentDatabaseExpression(); + } + + public function createSchemaManager(Connection $connection): MySQLSchemaManager + { + return new MySQLSchemaManager($connection, $this); + } + + /** + * @param list $assets + * + * @return array + * + * @template T of AbstractAsset + */ + private function indexAssetsByLowerCaseName(array $assets): array + { + $result = []; + + foreach ($assets as $asset) { + $result[strtolower($asset->getName())] = $asset; + } + + return $result; + } +} diff --git a/vendor/doctrine/dbal/src/Platforms/AbstractPlatform.php b/vendor/doctrine/dbal/src/Platforms/AbstractPlatform.php new file mode 100644 index 00000000..28a0eb58 --- /dev/null +++ b/vendor/doctrine/dbal/src/Platforms/AbstractPlatform.php @@ -0,0 +1,4651 @@ +_eventManager = $eventManager; + } + + /** + * Gets the EventManager used by the Platform. + * + * @deprecated + * + * @return EventManager|null + */ + public function getEventManager() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/5784', + '%s is deprecated.', + __METHOD__, + ); + + return $this->_eventManager; + } + + /** + * Returns the SQL snippet that declares a boolean column. + * + * @param mixed[] $column + * + * @return string + */ + abstract public function getBooleanTypeDeclarationSQL(array $column); + + /** + * Returns the SQL snippet that declares a 4 byte integer column. + * + * @param mixed[] $column + * + * @return string + */ + abstract public function getIntegerTypeDeclarationSQL(array $column); + + /** + * Returns the SQL snippet that declares an 8 byte integer column. + * + * @param mixed[] $column + * + * @return string + */ + abstract public function getBigIntTypeDeclarationSQL(array $column); + + /** + * Returns the SQL snippet that declares a 2 byte integer column. + * + * @param mixed[] $column + * + * @return string + */ + abstract public function getSmallIntTypeDeclarationSQL(array $column); + + /** + * Returns the SQL snippet that declares common properties of an integer column. + * + * @param mixed[] $column + * + * @return string + */ + abstract protected function _getCommonIntegerTypeDeclarationSQL(array $column); + + /** + * Lazy load Doctrine Type Mappings. + * + * @return void + */ + abstract protected function initializeDoctrineTypeMappings(); + + /** + * Initializes Doctrine Type Mappings with the platform defaults + * and with all additional type mappings. + */ + private function initializeAllDoctrineTypeMappings(): void + { + $this->initializeDoctrineTypeMappings(); + + foreach (Type::getTypesMap() as $typeName => $className) { + foreach (Type::getType($typeName)->getMappedDatabaseTypes($this) as $dbType) { + $this->doctrineTypeMapping[$dbType] = $typeName; + } + } + } + + /** + * Returns the SQL snippet used to declare a column that can + * store characters in the ASCII character set + * + * @param mixed[] $column + */ + public function getAsciiStringTypeDeclarationSQL(array $column): string + { + return $this->getStringTypeDeclarationSQL($column); + } + + /** + * Returns the SQL snippet used to declare a VARCHAR column type. + * + * @deprecated Use {@link getStringTypeDeclarationSQL()} instead. + * + * @param mixed[] $column + * + * @return string + */ + public function getVarcharTypeDeclarationSQL(array $column) + { + if (isset($column['length'])) { + $lengthOmitted = false; + } else { + $column['length'] = $this->getVarcharDefaultLength(); + $lengthOmitted = true; + } + + $fixed = $column['fixed'] ?? false; + + $maxLength = $fixed + ? $this->getCharMaxLength() + : $this->getVarcharMaxLength(); + + if ($column['length'] > $maxLength) { + return $this->getClobTypeDeclarationSQL($column); + } + + return $this->getVarcharTypeDeclarationSQLSnippet($column['length'], $fixed, $lengthOmitted); + } + + /** + * Returns the SQL snippet used to declare a string column type. + * + * @param mixed[] $column + * + * @return string + */ + public function getStringTypeDeclarationSQL(array $column) + { + return $this->getVarcharTypeDeclarationSQL($column); + } + + /** + * Returns the SQL snippet used to declare a BINARY/VARBINARY column type. + * + * @param mixed[] $column The column definition. + * + * @return string + */ + public function getBinaryTypeDeclarationSQL(array $column) + { + if (isset($column['length'])) { + $lengthOmitted = false; + } else { + $column['length'] = $this->getBinaryDefaultLength(); + $lengthOmitted = true; + } + + $fixed = $column['fixed'] ?? false; + + $maxLength = $this->getBinaryMaxLength(); + + if ($column['length'] > $maxLength) { + if ($maxLength > 0) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3187', + 'Binary column length %d is greater than supported by the platform (%d).' + . ' Reduce the column length or use a BLOB column instead.', + $column['length'], + $maxLength, + ); + } + + return $this->getBlobTypeDeclarationSQL($column); + } + + return $this->getBinaryTypeDeclarationSQLSnippet($column['length'], $fixed, $lengthOmitted); + } + + /** + * Returns the SQL snippet to declare a GUID/UUID column. + * + * By default this maps directly to a CHAR(36) and only maps to more + * special datatypes when the underlying databases support this datatype. + * + * @param mixed[] $column + * + * @return string + */ + public function getGuidTypeDeclarationSQL(array $column) + { + $column['length'] = 36; + $column['fixed'] = true; + + return $this->getStringTypeDeclarationSQL($column); + } + + /** + * Returns the SQL snippet to declare a JSON column. + * + * By default this maps directly to a CLOB and only maps to more + * special datatypes when the underlying databases support this datatype. + * + * @param mixed[] $column + * + * @return string + */ + public function getJsonTypeDeclarationSQL(array $column) + { + return $this->getClobTypeDeclarationSQL($column); + } + + /** + * @param int|false $length + * @param bool $fixed + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed/*, $lengthOmitted = false*/) + { + throw Exception::notSupported('VARCHARs not supported by Platform.'); + } + + /** + * Returns the SQL snippet used to declare a BINARY/VARBINARY column type. + * + * @param int|false $length The length of the column. + * @param bool $fixed Whether the column length is fixed. + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + protected function getBinaryTypeDeclarationSQLSnippet($length, $fixed/*, $lengthOmitted = false*/) + { + throw Exception::notSupported('BINARY/VARBINARY column types are not supported by this platform.'); + } + + /** + * Returns the SQL snippet used to declare a CLOB column type. + * + * @param mixed[] $column + * + * @return string + */ + abstract public function getClobTypeDeclarationSQL(array $column); + + /** + * Returns the SQL Snippet used to declare a BLOB column type. + * + * @param mixed[] $column + * + * @return string + */ + abstract public function getBlobTypeDeclarationSQL(array $column); + + /** + * Gets the name of the platform. + * + * @deprecated Identify platforms by their class. + * + * @return string + */ + abstract public function getName(); + + /** + * Registers a doctrine type to be used in conjunction with a column type of this platform. + * + * @param string $dbType + * @param string $doctrineType + * + * @return void + * + * @throws Exception If the type is not found. + */ + public function registerDoctrineTypeMapping($dbType, $doctrineType) + { + if ($this->doctrineTypeMapping === null) { + $this->initializeAllDoctrineTypeMappings(); + } + + if (! Types\Type::hasType($doctrineType)) { + throw Exception::typeNotFound($doctrineType); + } + + $dbType = strtolower($dbType); + $this->doctrineTypeMapping[$dbType] = $doctrineType; + + $doctrineType = Type::getType($doctrineType); + + if (! $doctrineType->requiresSQLCommentHint($this)) { + return; + } + + $this->markDoctrineTypeCommented($doctrineType); + } + + /** + * Gets the Doctrine type that is mapped for the given database column type. + * + * @param string $dbType + * + * @return string + * + * @throws Exception + */ + public function getDoctrineTypeMapping($dbType) + { + if ($this->doctrineTypeMapping === null) { + $this->initializeAllDoctrineTypeMappings(); + } + + $dbType = strtolower($dbType); + + if (! isset($this->doctrineTypeMapping[$dbType])) { + throw new Exception( + 'Unknown database type ' . $dbType . ' requested, ' . static::class . ' may not support it.', + ); + } + + return $this->doctrineTypeMapping[$dbType]; + } + + /** + * Checks if a database type is currently supported by this platform. + * + * @param string $dbType + * + * @return bool + */ + public function hasDoctrineTypeMappingFor($dbType) + { + if ($this->doctrineTypeMapping === null) { + $this->initializeAllDoctrineTypeMappings(); + } + + $dbType = strtolower($dbType); + + return isset($this->doctrineTypeMapping[$dbType]); + } + + /** + * Initializes the Doctrine Type comments instance variable for in_array() checks. + * + * @deprecated This API will be removed in Doctrine DBAL 4.0. + * + * @return void + */ + protected function initializeCommentedDoctrineTypes() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5058', + '%s is deprecated and will be removed in Doctrine DBAL 4.0.', + __METHOD__, + ); + + $this->doctrineTypeComments = []; + + foreach (Type::getTypesMap() as $typeName => $className) { + $type = Type::getType($typeName); + + if (! $type->requiresSQLCommentHint($this)) { + continue; + } + + $this->doctrineTypeComments[] = $typeName; + } + } + + /** + * Is it necessary for the platform to add a parsable type comment to allow reverse engineering the given type? + * + * @deprecated Use {@link Type::requiresSQLCommentHint()} instead. + * + * @return bool + */ + public function isCommentedDoctrineType(Type $doctrineType) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5058', + '%s is deprecated and will be removed in Doctrine DBAL 4.0. Use Type::requiresSQLCommentHint() instead.', + __METHOD__, + ); + + if ($this->doctrineTypeComments === null) { + $this->initializeCommentedDoctrineTypes(); + } + + return $doctrineType->requiresSQLCommentHint($this); + } + + /** + * Marks this type as to be commented in ALTER TABLE and CREATE TABLE statements. + * + * @param string|Type $doctrineType + * + * @return void + */ + public function markDoctrineTypeCommented($doctrineType) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5058', + '%s is deprecated and will be removed in Doctrine DBAL 4.0. Use Type::requiresSQLCommentHint() instead.', + __METHOD__, + ); + + if ($this->doctrineTypeComments === null) { + $this->initializeCommentedDoctrineTypes(); + } + + assert(is_array($this->doctrineTypeComments)); + + $this->doctrineTypeComments[] = $doctrineType instanceof Type ? $doctrineType->getName() : $doctrineType; + } + + /** + * Gets the comment to append to a column comment that helps parsing this type in reverse engineering. + * + * @deprecated This method will be removed without replacement. + * + * @return string + */ + public function getDoctrineTypeComment(Type $doctrineType) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5107', + '%s is deprecated and will be removed in Doctrine DBAL 4.0.', + __METHOD__, + ); + + return '(DC2Type:' . $doctrineType->getName() . ')'; + } + + /** + * Gets the comment of a passed column modified by potential doctrine type comment hints. + * + * @deprecated This method will be removed without replacement. + * + * @return string|null + */ + protected function getColumnComment(Column $column) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5107', + '%s is deprecated and will be removed in Doctrine DBAL 4.0.', + __METHOD__, + ); + + $comment = $column->getComment(); + + if ($column->getType()->requiresSQLCommentHint($this)) { + $comment .= $this->getDoctrineTypeComment($column->getType()); + } + + return $comment; + } + + /** + * Gets the character used for identifier quoting. + * + * @deprecated Use {@see quoteIdentifier()} to quote identifiers instead. + * + * @return string + */ + public function getIdentifierQuoteCharacter() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5388', + 'AbstractPlatform::getIdentifierQuoteCharacter() is deprecated. Use quoteIdentifier() instead.', + ); + + return '"'; + } + + /** + * Gets the string portion that starts an SQL comment. + * + * @deprecated + * + * @return string + */ + public function getSqlCommentStartString() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getSqlCommentStartString() is deprecated.', + ); + + return '--'; + } + + /** + * Gets the string portion that ends an SQL comment. + * + * @deprecated + * + * @return string + */ + public function getSqlCommentEndString() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getSqlCommentEndString() is deprecated.', + ); + + return "\n"; + } + + /** + * Gets the maximum length of a char column. + * + * @deprecated + */ + public function getCharMaxLength(): int + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3263', + 'AbstractPlatform::getCharMaxLength() is deprecated.', + ); + + return $this->getVarcharMaxLength(); + } + + /** + * Gets the maximum length of a varchar column. + * + * @deprecated + * + * @return int + */ + public function getVarcharMaxLength() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3263', + 'AbstractPlatform::getVarcharMaxLength() is deprecated.', + ); + + return 4000; + } + + /** + * Gets the default length of a varchar column. + * + * @deprecated + * + * @return int + */ + public function getVarcharDefaultLength() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3263', + 'Relying on the default varchar column length is deprecated, specify the length explicitly.', + ); + + return 255; + } + + /** + * Gets the maximum length of a binary column. + * + * @deprecated + * + * @return int + */ + public function getBinaryMaxLength() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3263', + 'AbstractPlatform::getBinaryMaxLength() is deprecated.', + ); + + return 4000; + } + + /** + * Gets the default length of a binary column. + * + * @deprecated + * + * @return int + */ + public function getBinaryDefaultLength() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3263', + 'Relying on the default binary column length is deprecated, specify the length explicitly.', + ); + + return 255; + } + + /** + * Gets all SQL wildcard characters of the platform. + * + * @deprecated Use {@see AbstractPlatform::getLikeWildcardCharacters()} instead. + * + * @return string[] + */ + public function getWildcards() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getWildcards() is deprecated.' + . ' Use AbstractPlatform::getLikeWildcardCharacters() instead.', + ); + + return ['%', '_']; + } + + /** + * Returns the regular expression operator. + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getRegexpExpression() + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Returns the SQL snippet to get the average value of a column. + * + * @deprecated Use AVG() in SQL instead. + * + * @param string $column The column to use. + * + * @return string Generated SQL including an AVG aggregate function. + */ + public function getAvgExpression($column) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getAvgExpression() is deprecated. Use AVG() in SQL instead.', + ); + + return 'AVG(' . $column . ')'; + } + + /** + * Returns the SQL snippet to get the number of rows (without a NULL value) of a column. + * + * If a '*' is used instead of a column the number of selected rows is returned. + * + * @deprecated Use COUNT() in SQL instead. + * + * @param string|int $column The column to use. + * + * @return string Generated SQL including a COUNT aggregate function. + */ + public function getCountExpression($column) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getCountExpression() is deprecated. Use COUNT() in SQL instead.', + ); + + return 'COUNT(' . $column . ')'; + } + + /** + * Returns the SQL snippet to get the highest value of a column. + * + * @deprecated Use MAX() in SQL instead. + * + * @param string $column The column to use. + * + * @return string Generated SQL including a MAX aggregate function. + */ + public function getMaxExpression($column) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getMaxExpression() is deprecated. Use MAX() in SQL instead.', + ); + + return 'MAX(' . $column . ')'; + } + + /** + * Returns the SQL snippet to get the lowest value of a column. + * + * @deprecated Use MIN() in SQL instead. + * + * @param string $column The column to use. + * + * @return string Generated SQL including a MIN aggregate function. + */ + public function getMinExpression($column) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getMinExpression() is deprecated. Use MIN() in SQL instead.', + ); + + return 'MIN(' . $column . ')'; + } + + /** + * Returns the SQL snippet to get the total sum of a column. + * + * @deprecated Use SUM() in SQL instead. + * + * @param string $column The column to use. + * + * @return string Generated SQL including a SUM aggregate function. + */ + public function getSumExpression($column) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getSumExpression() is deprecated. Use SUM() in SQL instead.', + ); + + return 'SUM(' . $column . ')'; + } + + // scalar functions + + /** + * Returns the SQL snippet to get the md5 sum of a column. + * + * Note: Not SQL92, but common functionality. + * + * @deprecated + * + * @param string $column + * + * @return string + */ + public function getMd5Expression($column) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getMd5Expression() is deprecated.', + ); + + return 'MD5(' . $column . ')'; + } + + /** + * Returns the SQL snippet to get the length of a text column in characters. + * + * @param string $column + * + * @return string + */ + public function getLengthExpression($column) + { + return 'LENGTH(' . $column . ')'; + } + + /** + * Returns the SQL snippet to get the squared value of a column. + * + * @deprecated Use SQRT() in SQL instead. + * + * @param string $column The column to use. + * + * @return string Generated SQL including an SQRT aggregate function. + */ + public function getSqrtExpression($column) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getSqrtExpression() is deprecated. Use SQRT() in SQL instead.', + ); + + return 'SQRT(' . $column . ')'; + } + + /** + * Returns the SQL snippet to round a numeric column to the number of decimals specified. + * + * @deprecated Use ROUND() in SQL instead. + * + * @param string $column + * @param string|int $decimals + * + * @return string + */ + public function getRoundExpression($column, $decimals = 0) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getRoundExpression() is deprecated. Use ROUND() in SQL instead.', + ); + + return 'ROUND(' . $column . ', ' . $decimals . ')'; + } + + /** + * Returns the SQL snippet to get the remainder of the division operation $expression1 / $expression2. + * + * @param string $expression1 + * @param string $expression2 + * + * @return string + */ + public function getModExpression($expression1, $expression2) + { + return 'MOD(' . $expression1 . ', ' . $expression2 . ')'; + } + + /** + * Returns the SQL snippet to trim a string. + * + * @param string $str The expression to apply the trim to. + * @param int $mode The position of the trim (leading/trailing/both). + * @param string|bool $char The char to trim, has to be quoted already. Defaults to space. + * + * @return string + */ + public function getTrimExpression($str, $mode = TrimMode::UNSPECIFIED, $char = false) + { + $expression = ''; + + switch ($mode) { + case TrimMode::LEADING: + $expression = 'LEADING '; + break; + + case TrimMode::TRAILING: + $expression = 'TRAILING '; + break; + + case TrimMode::BOTH: + $expression = 'BOTH '; + break; + } + + if ($char !== false) { + $expression .= $char . ' '; + } + + if ($mode !== TrimMode::UNSPECIFIED || $char !== false) { + $expression .= 'FROM '; + } + + return 'TRIM(' . $expression . $str . ')'; + } + + /** + * Returns the SQL snippet to trim trailing space characters from the expression. + * + * @deprecated Use RTRIM() in SQL instead. + * + * @param string $str Literal string or column name. + * + * @return string + */ + public function getRtrimExpression($str) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getRtrimExpression() is deprecated. Use RTRIM() in SQL instead.', + ); + + return 'RTRIM(' . $str . ')'; + } + + /** + * Returns the SQL snippet to trim leading space characters from the expression. + * + * @deprecated Use LTRIM() in SQL instead. + * + * @param string $str Literal string or column name. + * + * @return string + */ + public function getLtrimExpression($str) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getLtrimExpression() is deprecated. Use LTRIM() in SQL instead.', + ); + + return 'LTRIM(' . $str . ')'; + } + + /** + * Returns the SQL snippet to change all characters from the expression to uppercase, + * according to the current character set mapping. + * + * @deprecated Use UPPER() in SQL instead. + * + * @param string $str Literal string or column name. + * + * @return string + */ + public function getUpperExpression($str) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getUpperExpression() is deprecated. Use UPPER() in SQL instead.', + ); + + return 'UPPER(' . $str . ')'; + } + + /** + * Returns the SQL snippet to change all characters from the expression to lowercase, + * according to the current character set mapping. + * + * @deprecated Use LOWER() in SQL instead. + * + * @param string $str Literal string or column name. + * + * @return string + */ + public function getLowerExpression($str) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getLowerExpression() is deprecated. Use LOWER() in SQL instead.', + ); + + return 'LOWER(' . $str . ')'; + } + + /** + * Returns the SQL snippet to get the position of the first occurrence of substring $substr in string $str. + * + * @param string $str Literal string. + * @param string $substr Literal string to find. + * @param string|int|false $startPos Position to start at, beginning of string by default. + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getLocateExpression($str, $substr, $startPos = false) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Returns the SQL snippet to get the current system date. + * + * @deprecated Generate dates within the application. + * + * @return string + */ + public function getNowExpression() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4753', + 'AbstractPlatform::getNowExpression() is deprecated. Generate dates within the application.', + ); + + return 'NOW()'; + } + + /** + * Returns a SQL snippet to get a substring inside an SQL statement. + * + * Note: Not SQL92, but common functionality. + * + * SQLite only supports the 2 parameter variant of this function. + * + * @param string $string An sql string literal or column name/alias. + * @param string|int $start Where to start the substring portion. + * @param string|int|null $length The substring portion length. + * + * @return string + */ + public function getSubstringExpression($string, $start, $length = null) + { + if ($length === null) { + return 'SUBSTRING(' . $string . ' FROM ' . $start . ')'; + } + + return 'SUBSTRING(' . $string . ' FROM ' . $start . ' FOR ' . $length . ')'; + } + + /** + * Returns a SQL snippet to concatenate the given expressions. + * + * Accepts an arbitrary number of string parameters. Each parameter must contain an expression. + * + * @return string + */ + public function getConcatExpression() + { + return implode(' || ', func_get_args()); + } + + /** + * Returns the SQL for a logical not. + * + * Example: + * + * $q = new Doctrine_Query(); + * $e = $q->expr; + * $q->select('*')->from('table') + * ->where($e->eq('id', $e->not('null')); + * + * + * @deprecated Use NOT() in SQL instead. + * + * @param string $expression + * + * @return string The logical expression. + */ + public function getNotExpression($expression) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getNotExpression() is deprecated. Use NOT() in SQL instead.', + ); + + return 'NOT(' . $expression . ')'; + } + + /** + * Returns the SQL that checks if an expression is null. + * + * @deprecated Use IS NULL in SQL instead. + * + * @param string $expression The expression that should be compared to null. + * + * @return string The logical expression. + */ + public function getIsNullExpression($expression) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getIsNullExpression() is deprecated. Use IS NULL in SQL instead.', + ); + + return $expression . ' IS NULL'; + } + + /** + * Returns the SQL that checks if an expression is not null. + * + * @deprecated Use IS NOT NULL in SQL instead. + * + * @param string $expression The expression that should be compared to null. + * + * @return string The logical expression. + */ + public function getIsNotNullExpression($expression) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getIsNotNullExpression() is deprecated. Use IS NOT NULL in SQL instead.', + ); + + return $expression . ' IS NOT NULL'; + } + + /** + * Returns the SQL that checks if an expression evaluates to a value between two values. + * + * The parameter $expression is checked if it is between $value1 and $value2. + * + * Note: There is a slight difference in the way BETWEEN works on some databases. + * http://www.w3schools.com/sql/sql_between.asp. If you want complete database + * independence you should avoid using between(). + * + * @deprecated Use BETWEEN in SQL instead. + * + * @param string $expression The value to compare to. + * @param string $value1 The lower value to compare with. + * @param string $value2 The higher value to compare with. + * + * @return string The logical expression. + */ + public function getBetweenExpression($expression, $value1, $value2) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getBetweenExpression() is deprecated. Use BETWEEN in SQL instead.', + ); + + return $expression . ' BETWEEN ' . $value1 . ' AND ' . $value2; + } + + /** + * Returns the SQL to get the arccosine of a value. + * + * @deprecated Use ACOS() in SQL instead. + * + * @param string $value + * + * @return string + */ + public function getAcosExpression($value) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getAcosExpression() is deprecated. Use ACOS() in SQL instead.', + ); + + return 'ACOS(' . $value . ')'; + } + + /** + * Returns the SQL to get the sine of a value. + * + * @deprecated Use SIN() in SQL instead. + * + * @param string $value + * + * @return string + */ + public function getSinExpression($value) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getSinExpression() is deprecated. Use SIN() in SQL instead.', + ); + + return 'SIN(' . $value . ')'; + } + + /** + * Returns the SQL to get the PI value. + * + * @deprecated Use PI() in SQL instead. + * + * @return string + */ + public function getPiExpression() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getPiExpression() is deprecated. Use PI() in SQL instead.', + ); + + return 'PI()'; + } + + /** + * Returns the SQL to get the cosine of a value. + * + * @deprecated Use COS() in SQL instead. + * + * @param string $value + * + * @return string + */ + public function getCosExpression($value) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getCosExpression() is deprecated. Use COS() in SQL instead.', + ); + + return 'COS(' . $value . ')'; + } + + /** + * Returns the SQL to calculate the difference in days between the two passed dates. + * + * Computes diff = date1 - date2. + * + * @param string $date1 + * @param string $date2 + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateDiffExpression($date1, $date2) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Returns the SQL to add the number of given seconds to a date. + * + * @param string $date + * @param int|numeric-string $seconds + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateAddSecondsExpression($date, $seconds) + { + if (is_int($seconds)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/3498', + 'Passing $seconds as an integer is deprecated. Pass it as a numeric string instead.', + ); + } + + return $this->getDateArithmeticIntervalExpression($date, '+', $seconds, DateIntervalUnit::SECOND); + } + + /** + * Returns the SQL to subtract the number of given seconds from a date. + * + * @param string $date + * @param int|numeric-string $seconds + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateSubSecondsExpression($date, $seconds) + { + if (is_int($seconds)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/3498', + 'Passing $seconds as an integer is deprecated. Pass it as a numeric string instead.', + ); + } + + return $this->getDateArithmeticIntervalExpression($date, '-', $seconds, DateIntervalUnit::SECOND); + } + + /** + * Returns the SQL to add the number of given minutes to a date. + * + * @param string $date + * @param int|numeric-string $minutes + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateAddMinutesExpression($date, $minutes) + { + if (is_int($minutes)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/3498', + 'Passing $minutes as an integer is deprecated. Pass it as a numeric string instead.', + ); + } + + return $this->getDateArithmeticIntervalExpression($date, '+', $minutes, DateIntervalUnit::MINUTE); + } + + /** + * Returns the SQL to subtract the number of given minutes from a date. + * + * @param string $date + * @param int|numeric-string $minutes + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateSubMinutesExpression($date, $minutes) + { + if (is_int($minutes)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/3498', + 'Passing $minutes as an integer is deprecated. Pass it as a numeric string instead.', + ); + } + + return $this->getDateArithmeticIntervalExpression($date, '-', $minutes, DateIntervalUnit::MINUTE); + } + + /** + * Returns the SQL to add the number of given hours to a date. + * + * @param string $date + * @param int|numeric-string $hours + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateAddHourExpression($date, $hours) + { + if (is_int($hours)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/3498', + 'Passing $hours as an integer is deprecated. Pass it as a numeric string instead.', + ); + } + + return $this->getDateArithmeticIntervalExpression($date, '+', $hours, DateIntervalUnit::HOUR); + } + + /** + * Returns the SQL to subtract the number of given hours to a date. + * + * @param string $date + * @param int|numeric-string $hours + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateSubHourExpression($date, $hours) + { + if (is_int($hours)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/3498', + 'Passing $hours as an integer is deprecated. Pass it as a numeric string instead.', + ); + } + + return $this->getDateArithmeticIntervalExpression($date, '-', $hours, DateIntervalUnit::HOUR); + } + + /** + * Returns the SQL to add the number of given days to a date. + * + * @param string $date + * @param int|numeric-string $days + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateAddDaysExpression($date, $days) + { + if (is_int($days)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/3498', + 'Passing $days as an integer is deprecated. Pass it as a numeric string instead.', + ); + } + + return $this->getDateArithmeticIntervalExpression($date, '+', $days, DateIntervalUnit::DAY); + } + + /** + * Returns the SQL to subtract the number of given days to a date. + * + * @param string $date + * @param int|numeric-string $days + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateSubDaysExpression($date, $days) + { + if (is_int($days)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/3498', + 'Passing $days as an integer is deprecated. Pass it as a numeric string instead.', + ); + } + + return $this->getDateArithmeticIntervalExpression($date, '-', $days, DateIntervalUnit::DAY); + } + + /** + * Returns the SQL to add the number of given weeks to a date. + * + * @param string $date + * @param int|numeric-string $weeks + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateAddWeeksExpression($date, $weeks) + { + if (is_int($weeks)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/3498', + 'Passing $weeks as an integer is deprecated. Pass it as a numeric string instead.', + ); + } + + return $this->getDateArithmeticIntervalExpression($date, '+', $weeks, DateIntervalUnit::WEEK); + } + + /** + * Returns the SQL to subtract the number of given weeks from a date. + * + * @param string $date + * @param int|numeric-string $weeks + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateSubWeeksExpression($date, $weeks) + { + if (is_int($weeks)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/3498', + 'Passing $weeks as an integer is deprecated. Pass it as a numeric string instead.', + ); + } + + return $this->getDateArithmeticIntervalExpression($date, '-', $weeks, DateIntervalUnit::WEEK); + } + + /** + * Returns the SQL to add the number of given months to a date. + * + * @param string $date + * @param int|numeric-string $months + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateAddMonthExpression($date, $months) + { + if (is_int($months)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/3498', + 'Passing $months as an integer is deprecated. Pass it as a numeric string instead.', + ); + } + + return $this->getDateArithmeticIntervalExpression($date, '+', $months, DateIntervalUnit::MONTH); + } + + /** + * Returns the SQL to subtract the number of given months to a date. + * + * @param string $date + * @param int|numeric-string $months + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateSubMonthExpression($date, $months) + { + if (is_int($months)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/3498', + 'Passing $months as an integer is deprecated. Pass it as a numeric string instead.', + ); + } + + return $this->getDateArithmeticIntervalExpression($date, '-', $months, DateIntervalUnit::MONTH); + } + + /** + * Returns the SQL to add the number of given quarters to a date. + * + * @param string $date + * @param int|numeric-string $quarters + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateAddQuartersExpression($date, $quarters) + { + if (is_int($quarters)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/3498', + 'Passing $quarters as an integer is deprecated. Pass it as a numeric string instead.', + ); + } + + return $this->getDateArithmeticIntervalExpression($date, '+', $quarters, DateIntervalUnit::QUARTER); + } + + /** + * Returns the SQL to subtract the number of given quarters from a date. + * + * @param string $date + * @param int|numeric-string $quarters + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateSubQuartersExpression($date, $quarters) + { + if (is_int($quarters)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/3498', + 'Passing $quarters as an integer is deprecated. Pass it as a numeric string instead.', + ); + } + + return $this->getDateArithmeticIntervalExpression($date, '-', $quarters, DateIntervalUnit::QUARTER); + } + + /** + * Returns the SQL to add the number of given years to a date. + * + * @param string $date + * @param int|numeric-string $years + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateAddYearsExpression($date, $years) + { + if (is_int($years)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/3498', + 'Passing $years as an integer is deprecated. Pass it as a numeric string instead.', + ); + } + + return $this->getDateArithmeticIntervalExpression($date, '+', $years, DateIntervalUnit::YEAR); + } + + /** + * Returns the SQL to subtract the number of given years from a date. + * + * @param string $date + * @param int|numeric-string $years + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateSubYearsExpression($date, $years) + { + if (is_int($years)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/3498', + 'Passing $years as an integer is deprecated. Pass it as a numeric string instead.', + ); + } + + return $this->getDateArithmeticIntervalExpression($date, '-', $years, DateIntervalUnit::YEAR); + } + + /** + * Returns the SQL for a date arithmetic expression. + * + * @param string $date The column or literal representing a date + * to perform the arithmetic operation on. + * @param string $operator The arithmetic operator (+ or -). + * @param int|numeric-string $interval The interval that shall be calculated into the date. + * @param string $unit The unit of the interval that shall be calculated into the date. + * One of the DATE_INTERVAL_UNIT_* constants. + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + protected function getDateArithmeticIntervalExpression($date, $operator, $interval, $unit) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Returns the SQL bit AND comparison expression. + * + * @param string $value1 + * @param string $value2 + * + * @return string + */ + public function getBitAndComparisonExpression($value1, $value2) + { + return '(' . $value1 . ' & ' . $value2 . ')'; + } + + /** + * Returns the SQL bit OR comparison expression. + * + * @param string $value1 + * @param string $value2 + * + * @return string + */ + public function getBitOrComparisonExpression($value1, $value2) + { + return '(' . $value1 . ' | ' . $value2 . ')'; + } + + /** + * Returns the SQL expression which represents the currently selected database. + */ + abstract public function getCurrentDatabaseExpression(): string; + + /** + * Returns the FOR UPDATE expression. + * + * @return string + */ + public function getForUpdateSQL() + { + return 'FOR UPDATE'; + } + + /** + * Honors that some SQL vendors such as MsSql use table hints for locking instead of the + * ANSI SQL FOR UPDATE specification. + * + * @param string $fromClause The FROM clause to append the hint for the given lock mode to + * @param int $lockMode One of the Doctrine\DBAL\LockMode::* constants + * @psalm-param LockMode::* $lockMode + */ + public function appendLockHint(string $fromClause, int $lockMode): string + { + switch ($lockMode) { + case LockMode::NONE: + case LockMode::OPTIMISTIC: + case LockMode::PESSIMISTIC_READ: + case LockMode::PESSIMISTIC_WRITE: + return $fromClause; + + default: + throw InvalidLockMode::fromLockMode($lockMode); + } + } + + /** + * Returns the SQL snippet to append to any SELECT statement which locks rows in shared read lock. + * + * This defaults to the ANSI SQL "FOR UPDATE", which is an exclusive lock (Write). Some database + * vendors allow to lighten this constraint up to be a real read lock. + * + * @return string + */ + public function getReadLockSQL() + { + return $this->getForUpdateSQL(); + } + + /** + * Returns the SQL snippet to append to any SELECT statement which obtains an exclusive lock on the rows. + * + * The semantics of this lock mode should equal the SELECT .. FOR UPDATE of the ANSI SQL standard. + * + * @return string + */ + public function getWriteLockSQL() + { + return $this->getForUpdateSQL(); + } + + /** + * Returns the SQL snippet to drop an existing table. + * + * @param Table|string $table + * + * @return string + * + * @throws InvalidArgumentException + */ + public function getDropTableSQL($table) + { + $tableArg = $table; + + if ($table instanceof Table) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $table as a Table object to %s is deprecated. Pass it as a quoted name instead.', + __METHOD__, + ); + + $table = $table->getQuotedName($this); + } + + if (! is_string($table)) { + throw new InvalidArgumentException( + __METHOD__ . '() expects $table parameter to be string or ' . Table::class . '.', + ); + } + + if ($this->_eventManager !== null && $this->_eventManager->hasListeners(Events::onSchemaDropTable)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/5784', + 'Subscribing to %s events is deprecated.', + Events::onSchemaDropTable, + ); + + $eventArgs = new SchemaDropTableEventArgs($tableArg, $this); + $this->_eventManager->dispatchEvent(Events::onSchemaDropTable, $eventArgs); + + if ($eventArgs->isDefaultPrevented()) { + $sql = $eventArgs->getSql(); + + if ($sql === null) { + throw new UnexpectedValueException('Default implementation of DROP TABLE was overridden with NULL'); + } + + return $sql; + } + } + + return 'DROP TABLE ' . $table; + } + + /** + * Returns the SQL to safely drop a temporary table WITHOUT implicitly committing an open transaction. + * + * @param Table|string $table + * + * @return string + */ + public function getDropTemporaryTableSQL($table) + { + if ($table instanceof Table) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $table as a Table object to %s is deprecated. Pass it as a quoted name instead.', + __METHOD__, + ); + + $table = $table->getQuotedName($this); + } + + return $this->getDropTableSQL($table); + } + + /** + * Returns the SQL to drop an index from a table. + * + * @param Index|string $index + * @param Table|string|null $table + * + * @return string + * + * @throws InvalidArgumentException + */ + public function getDropIndexSQL($index, $table = null) + { + if ($index instanceof Index) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $index as an Index object to %s is deprecated. Pass it as a quoted name instead.', + __METHOD__, + ); + + $index = $index->getQuotedName($this); + } elseif (! is_string($index)) { + throw new InvalidArgumentException( + __METHOD__ . '() expects $index parameter to be string or ' . Index::class . '.', + ); + } + + return 'DROP INDEX ' . $index; + } + + /** + * Returns the SQL to drop a constraint. + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + * + * @param Constraint|string $constraint + * @param Table|string $table + * + * @return string + */ + public function getDropConstraintSQL($constraint, $table) + { + if ($constraint instanceof Constraint) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $constraint as a Constraint object to %s is deprecated. Pass it as a quoted name instead.', + __METHOD__, + ); + } else { + $constraint = new Identifier($constraint); + } + + if ($table instanceof Table) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $table as a Table object to %s is deprecated. Pass it as a quoted name instead.', + __METHOD__, + ); + } else { + $table = new Identifier($table); + } + + $constraint = $constraint->getQuotedName($this); + $table = $table->getQuotedName($this); + + return 'ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $constraint; + } + + /** + * Returns the SQL to drop a foreign key. + * + * @param ForeignKeyConstraint|string $foreignKey + * @param Table|string $table + * + * @return string + */ + public function getDropForeignKeySQL($foreignKey, $table) + { + if ($foreignKey instanceof ForeignKeyConstraint) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $foreignKey as a ForeignKeyConstraint object to %s is deprecated.' + . ' Pass it as a quoted name instead.', + __METHOD__, + ); + } else { + $foreignKey = new Identifier($foreignKey); + } + + if ($table instanceof Table) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $table as a Table object to %s is deprecated. Pass it as a quoted name instead.', + __METHOD__, + ); + } else { + $table = new Identifier($table); + } + + $foreignKey = $foreignKey->getQuotedName($this); + $table = $table->getQuotedName($this); + + return 'ALTER TABLE ' . $table . ' DROP FOREIGN KEY ' . $foreignKey; + } + + /** + * Returns the SQL to drop a unique constraint. + */ + public function getDropUniqueConstraintSQL(string $name, string $tableName): string + { + return $this->getDropConstraintSQL($name, $tableName); + } + + /** + * Returns the SQL statement(s) to create a table with the specified name, columns and constraints + * on this platform. + * + * @param int $createFlags + * @psalm-param int-mask-of $createFlags + * + * @return list The list of SQL statements. + * + * @throws Exception + * @throws InvalidArgumentException + */ + public function getCreateTableSQL(Table $table, $createFlags = self::CREATE_INDEXES) + { + if (! is_int($createFlags)) { + throw new InvalidArgumentException( + 'Second argument of AbstractPlatform::getCreateTableSQL() has to be integer.', + ); + } + + if (($createFlags & self::CREATE_INDEXES) === 0) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5416', + 'Unsetting the CREATE_INDEXES flag in AbstractPlatform::getCreateTableSQL() is deprecated.', + ); + } + + if (($createFlags & self::CREATE_FOREIGNKEYS) === 0) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5416', + 'Not setting the CREATE_FOREIGNKEYS flag in AbstractPlatform::getCreateTableSQL()' + . ' is deprecated. In order to build the statements that create multiple tables' + . ' referencing each other via foreign keys, use AbstractPlatform::getCreateTablesSQL().', + ); + } + + return $this->buildCreateTableSQL( + $table, + ($createFlags & self::CREATE_INDEXES) > 0, + ($createFlags & self::CREATE_FOREIGNKEYS) > 0, + ); + } + + /** + * @internal + * + * @return list + * + * @throws Exception + */ + final protected function getCreateTableWithoutForeignKeysSQL(Table $table): array + { + return $this->buildCreateTableSQL($table, true, false); + } + + /** + * @return list + * + * @throws Exception + */ + private function buildCreateTableSQL(Table $table, bool $createIndexes, bool $createForeignKeys): array + { + if (count($table->getColumns()) === 0) { + throw Exception::noColumnsSpecifiedForTable($table->getName()); + } + + $tableName = $table->getQuotedName($this); + $options = $table->getOptions(); + $options['uniqueConstraints'] = []; + $options['indexes'] = []; + $options['primary'] = []; + + if ($createIndexes) { + foreach ($table->getIndexes() as $index) { + if (! $index->isPrimary()) { + $options['indexes'][$index->getQuotedName($this)] = $index; + + continue; + } + + $options['primary'] = $index->getQuotedColumns($this); + $options['primary_index'] = $index; + } + + foreach ($table->getUniqueConstraints() as $uniqueConstraint) { + $options['uniqueConstraints'][$uniqueConstraint->getQuotedName($this)] = $uniqueConstraint; + } + } + + if ($createForeignKeys) { + $options['foreignKeys'] = []; + + foreach ($table->getForeignKeys() as $fkConstraint) { + $options['foreignKeys'][] = $fkConstraint; + } + } + + $columnSql = []; + $columns = []; + + foreach ($table->getColumns() as $column) { + if ( + $this->_eventManager !== null + && $this->_eventManager->hasListeners(Events::onSchemaCreateTableColumn) + ) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/5784', + 'Subscribing to %s events is deprecated.', + Events::onSchemaCreateTableColumn, + ); + + $eventArgs = new SchemaCreateTableColumnEventArgs($column, $table, $this); + + $this->_eventManager->dispatchEvent(Events::onSchemaCreateTableColumn, $eventArgs); + + $columnSql = array_merge($columnSql, $eventArgs->getSql()); + + if ($eventArgs->isDefaultPrevented()) { + continue; + } + } + + $columnData = $this->columnToArray($column); + + if (in_array($column->getName(), $options['primary'], true)) { + $columnData['primary'] = true; + } + + $columns[$columnData['name']] = $columnData; + } + + if ($this->_eventManager !== null && $this->_eventManager->hasListeners(Events::onSchemaCreateTable)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/5784', + 'Subscribing to %s events is deprecated.', + Events::onSchemaCreateTable, + ); + + $eventArgs = new SchemaCreateTableEventArgs($table, $columns, $options, $this); + + $this->_eventManager->dispatchEvent(Events::onSchemaCreateTable, $eventArgs); + + if ($eventArgs->isDefaultPrevented()) { + return array_merge($eventArgs->getSql(), $columnSql); + } + } + + $sql = $this->_getCreateTableSQL($tableName, $columns, $options); + + if ($this->supportsCommentOnStatement()) { + if ($table->hasOption('comment')) { + $sql[] = $this->getCommentOnTableSQL($tableName, $table->getOption('comment')); + } + + foreach ($table->getColumns() as $column) { + $comment = $this->getColumnComment($column); + + if ($comment === null || $comment === '') { + continue; + } + + $sql[] = $this->getCommentOnColumnSQL($tableName, $column->getQuotedName($this), $comment); + } + } + + return array_merge($sql, $columnSql); + } + + /** + * @param list $tables + * + * @return list + * + * @throws Exception + */ + public function getCreateTablesSQL(array $tables): array + { + $sql = []; + + foreach ($tables as $table) { + $sql = array_merge($sql, $this->getCreateTableWithoutForeignKeysSQL($table)); + } + + foreach ($tables as $table) { + foreach ($table->getForeignKeys() as $foreignKey) { + $sql[] = $this->getCreateForeignKeySQL( + $foreignKey, + $table->getQuotedName($this), + ); + } + } + + return $sql; + } + + /** + * @param list
$tables + * + * @return list + */ + public function getDropTablesSQL(array $tables): array + { + $sql = []; + + foreach ($tables as $table) { + foreach ($table->getForeignKeys() as $foreignKey) { + $sql[] = $this->getDropForeignKeySQL( + $foreignKey->getQuotedName($this), + $table->getQuotedName($this), + ); + } + } + + foreach ($tables as $table) { + $sql[] = $this->getDropTableSQL($table->getQuotedName($this)); + } + + return $sql; + } + + protected function getCommentOnTableSQL(string $tableName, ?string $comment): string + { + $tableName = new Identifier($tableName); + + return sprintf( + 'COMMENT ON TABLE %s IS %s', + $tableName->getQuotedName($this), + $this->quoteStringLiteral((string) $comment), + ); + } + + /** + * @param string $tableName + * @param string $columnName + * @param string|null $comment + * + * @return string + */ + public function getCommentOnColumnSQL($tableName, $columnName, $comment) + { + $tableName = new Identifier($tableName); + $columnName = new Identifier($columnName); + + return sprintf( + 'COMMENT ON COLUMN %s.%s IS %s', + $tableName->getQuotedName($this), + $columnName->getQuotedName($this), + $this->quoteStringLiteral((string) $comment), + ); + } + + /** + * Returns the SQL to create inline comment on a column. + * + * @param string $comment + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getInlineColumnCommentSQL($comment) + { + if (! $this->supportsInlineColumnComments()) { + throw Exception::notSupported(__METHOD__); + } + + return 'COMMENT ' . $this->quoteStringLiteral($comment); + } + + /** + * Returns the SQL used to create a table. + * + * @param string $name + * @param mixed[][] $columns + * @param mixed[] $options + * + * @return string[] + */ + protected function _getCreateTableSQL($name, array $columns, array $options = []) + { + $columnListSql = $this->getColumnDeclarationListSQL($columns); + + if (isset($options['uniqueConstraints']) && ! empty($options['uniqueConstraints'])) { + foreach ($options['uniqueConstraints'] as $index => $definition) { + $columnListSql .= ', ' . $this->getUniqueConstraintDeclarationSQL($index, $definition); + } + } + + if (isset($options['primary']) && ! empty($options['primary'])) { + $columnListSql .= ', PRIMARY KEY(' . implode(', ', array_unique(array_values($options['primary']))) . ')'; + } + + if (isset($options['indexes']) && ! empty($options['indexes'])) { + foreach ($options['indexes'] as $index => $definition) { + $columnListSql .= ', ' . $this->getIndexDeclarationSQL($index, $definition); + } + } + + $query = 'CREATE TABLE ' . $name . ' (' . $columnListSql; + $check = $this->getCheckDeclarationSQL($columns); + + if (! empty($check)) { + $query .= ', ' . $check; + } + + $query .= ')'; + + $sql = [$query]; + + if (isset($options['foreignKeys'])) { + foreach ($options['foreignKeys'] as $definition) { + $sql[] = $this->getCreateForeignKeySQL($definition, $name); + } + } + + return $sql; + } + + /** @return string */ + public function getCreateTemporaryTableSnippetSQL() + { + return 'CREATE TEMPORARY TABLE'; + } + + /** + * Generates SQL statements that can be used to apply the diff. + * + * @return list + */ + public function getAlterSchemaSQL(SchemaDiff $diff): array + { + return $diff->toSql($this); + } + + /** + * Returns the SQL to create a sequence on this platform. + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getCreateSequenceSQL(Sequence $sequence) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Returns the SQL to change a sequence on this platform. + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getAlterSequenceSQL(Sequence $sequence) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Returns the SQL snippet to drop an existing sequence. + * + * @param Sequence|string $sequence + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDropSequenceSQL($sequence) + { + if (! $this->supportsSequences()) { + throw Exception::notSupported(__METHOD__); + } + + if ($sequence instanceof Sequence) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $sequence as a Sequence object to %s is deprecated. Pass it as a quoted name instead.', + __METHOD__, + ); + + $sequence = $sequence->getQuotedName($this); + } + + return 'DROP SEQUENCE ' . $sequence; + } + + /** + * Returns the SQL to create a constraint on a table on this platform. + * + * @deprecated Use {@see getCreateIndexSQL()}, {@see getCreateForeignKeySQL()} + * or {@see getCreateUniqueConstraintSQL()} instead. + * + * @param Table|string $table + * + * @return string + * + * @throws InvalidArgumentException + */ + public function getCreateConstraintSQL(Constraint $constraint, $table) + { + if ($table instanceof Table) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $table as a Table object to %s is deprecated. Pass it as a quoted name instead.', + __METHOD__, + ); + + $table = $table->getQuotedName($this); + } + + $query = 'ALTER TABLE ' . $table . ' ADD CONSTRAINT ' . $constraint->getQuotedName($this); + + $columnList = '(' . implode(', ', $constraint->getQuotedColumns($this)) . ')'; + + $referencesClause = ''; + if ($constraint instanceof Index) { + if ($constraint->isPrimary()) { + $query .= ' PRIMARY KEY'; + } elseif ($constraint->isUnique()) { + $query .= ' UNIQUE'; + } else { + throw new InvalidArgumentException( + 'Can only create primary or unique constraints, no common indexes with getCreateConstraintSQL().', + ); + } + } elseif ($constraint instanceof UniqueConstraint) { + $query .= ' UNIQUE'; + } elseif ($constraint instanceof ForeignKeyConstraint) { + $query .= ' FOREIGN KEY'; + + $referencesClause = ' REFERENCES ' . $constraint->getQuotedForeignTableName($this) . + ' (' . implode(', ', $constraint->getQuotedForeignColumns($this)) . ')'; + } + + $query .= ' ' . $columnList . $referencesClause; + + return $query; + } + + /** + * Returns the SQL to create an index on a table on this platform. + * + * @param Table|string $table The name of the table on which the index is to be created. + * + * @return string + * + * @throws InvalidArgumentException + */ + public function getCreateIndexSQL(Index $index, $table) + { + if ($table instanceof Table) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $table as a Table object to %s is deprecated. Pass it as a quoted name instead.', + __METHOD__, + ); + + $table = $table->getQuotedName($this); + } + + $name = $index->getQuotedName($this); + $columns = $index->getColumns(); + + if (count($columns) === 0) { + throw new InvalidArgumentException(sprintf( + 'Incomplete or invalid index definition %s on table %s', + $name, + $table, + )); + } + + if ($index->isPrimary()) { + return $this->getCreatePrimaryKeySQL($index, $table); + } + + $query = 'CREATE ' . $this->getCreateIndexSQLFlags($index) . 'INDEX ' . $name . ' ON ' . $table; + $query .= ' (' . $this->getIndexFieldDeclarationListSQL($index) . ')' . $this->getPartialIndexSQL($index); + + return $query; + } + + /** + * Adds condition for partial index. + * + * @return string + */ + protected function getPartialIndexSQL(Index $index) + { + if ($this->supportsPartialIndexes() && $index->hasOption('where')) { + return ' WHERE ' . $index->getOption('where'); + } + + return ''; + } + + /** + * Adds additional flags for index generation. + * + * @return string + */ + protected function getCreateIndexSQLFlags(Index $index) + { + return $index->isUnique() ? 'UNIQUE ' : ''; + } + + /** + * Returns the SQL to create an unnamed primary key constraint. + * + * @param Table|string $table + * + * @return string + */ + public function getCreatePrimaryKeySQL(Index $index, $table) + { + if ($table instanceof Table) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $table as a Table object to %s is deprecated. Pass it as a quoted name instead.', + __METHOD__, + ); + + $table = $table->getQuotedName($this); + } + + return 'ALTER TABLE ' . $table . ' ADD PRIMARY KEY (' . $this->getIndexFieldDeclarationListSQL($index) . ')'; + } + + /** + * Returns the SQL to create a named schema. + * + * @param string $schemaName + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getCreateSchemaSQL($schemaName) + { + if (! $this->supportsSchemas()) { + throw Exception::notSupported(__METHOD__); + } + + return 'CREATE SCHEMA ' . $schemaName; + } + + /** + * Returns the SQL to create a unique constraint on a table on this platform. + */ + public function getCreateUniqueConstraintSQL(UniqueConstraint $constraint, string $tableName): string + { + return $this->getCreateConstraintSQL($constraint, $tableName); + } + + /** + * Returns the SQL snippet to drop a schema. + * + * @throws Exception If not supported on this platform. + */ + public function getDropSchemaSQL(string $schemaName): string + { + if (! $this->supportsSchemas()) { + throw Exception::notSupported(__METHOD__); + } + + return 'DROP SCHEMA ' . $schemaName; + } + + /** + * Quotes a string so that it can be safely used as a table or column name, + * even if it is a reserved word of the platform. This also detects identifier + * chains separated by dot and quotes them independently. + * + * NOTE: Just because you CAN use quoted identifiers doesn't mean + * you SHOULD use them. In general, they end up causing way more + * problems than they solve. + * + * @param string $str The identifier name to be quoted. + * + * @return string The quoted identifier string. + */ + public function quoteIdentifier($str) + { + if (strpos($str, '.') !== false) { + $parts = array_map([$this, 'quoteSingleIdentifier'], explode('.', $str)); + + return implode('.', $parts); + } + + return $this->quoteSingleIdentifier($str); + } + + /** + * Quotes a single identifier (no dot chain separation). + * + * @param string $str The identifier name to be quoted. + * + * @return string The quoted identifier string. + */ + public function quoteSingleIdentifier($str) + { + $c = $this->getIdentifierQuoteCharacter(); + + return $c . str_replace($c, $c . $c, $str) . $c; + } + + /** + * Returns the SQL to create a new foreign key. + * + * @param ForeignKeyConstraint $foreignKey The foreign key constraint. + * @param Table|string $table The name of the table on which the foreign key is to be created. + * + * @return string + */ + public function getCreateForeignKeySQL(ForeignKeyConstraint $foreignKey, $table) + { + if ($table instanceof Table) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $table as a Table object to %s is deprecated. Pass it as a quoted name instead.', + __METHOD__, + ); + + $table = $table->getQuotedName($this); + } + + return 'ALTER TABLE ' . $table . ' ADD ' . $this->getForeignKeyDeclarationSQL($foreignKey); + } + + /** + * Gets the SQL statements for altering an existing table. + * + * This method returns an array of SQL statements, since some platforms need several statements. + * + * @return list + * + * @throws Exception If not supported on this platform. + */ + public function getAlterTableSQL(TableDiff $diff) + { + throw Exception::notSupported(__METHOD__); + } + + /** @return list */ + public function getRenameTableSQL(string $oldName, string $newName): array + { + return [ + sprintf('ALTER TABLE %s RENAME TO %s', $oldName, $newName), + ]; + } + + /** + * @param mixed[] $columnSql + * + * @return bool + */ + protected function onSchemaAlterTableAddColumn(Column $column, TableDiff $diff, &$columnSql) + { + if ($this->_eventManager === null) { + return false; + } + + if (! $this->_eventManager->hasListeners(Events::onSchemaAlterTableAddColumn)) { + return false; + } + + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/5784', + 'Subscribing to %s events is deprecated.', + Events::onSchemaAlterTableAddColumn, + ); + + $eventArgs = new SchemaAlterTableAddColumnEventArgs($column, $diff, $this); + $this->_eventManager->dispatchEvent(Events::onSchemaAlterTableAddColumn, $eventArgs); + + $columnSql = array_merge($columnSql, $eventArgs->getSql()); + + return $eventArgs->isDefaultPrevented(); + } + + /** + * @param string[] $columnSql + * + * @return bool + */ + protected function onSchemaAlterTableRemoveColumn(Column $column, TableDiff $diff, &$columnSql) + { + if ($this->_eventManager === null) { + return false; + } + + if (! $this->_eventManager->hasListeners(Events::onSchemaAlterTableRemoveColumn)) { + return false; + } + + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/5784', + 'Subscribing to %s events is deprecated.', + Events::onSchemaAlterTableRemoveColumn, + ); + + $eventArgs = new SchemaAlterTableRemoveColumnEventArgs($column, $diff, $this); + $this->_eventManager->dispatchEvent(Events::onSchemaAlterTableRemoveColumn, $eventArgs); + + $columnSql = array_merge($columnSql, $eventArgs->getSql()); + + return $eventArgs->isDefaultPrevented(); + } + + /** + * @param string[] $columnSql + * + * @return bool + */ + protected function onSchemaAlterTableChangeColumn(ColumnDiff $columnDiff, TableDiff $diff, &$columnSql) + { + if ($this->_eventManager === null) { + return false; + } + + if (! $this->_eventManager->hasListeners(Events::onSchemaAlterTableChangeColumn)) { + return false; + } + + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/5784', + 'Subscribing to %s events is deprecated.', + Events::onSchemaAlterTableChangeColumn, + ); + + $eventArgs = new SchemaAlterTableChangeColumnEventArgs($columnDiff, $diff, $this); + $this->_eventManager->dispatchEvent(Events::onSchemaAlterTableChangeColumn, $eventArgs); + + $columnSql = array_merge($columnSql, $eventArgs->getSql()); + + return $eventArgs->isDefaultPrevented(); + } + + /** + * @param string $oldColumnName + * @param string[] $columnSql + * + * @return bool + */ + protected function onSchemaAlterTableRenameColumn($oldColumnName, Column $column, TableDiff $diff, &$columnSql) + { + if ($this->_eventManager === null) { + return false; + } + + if (! $this->_eventManager->hasListeners(Events::onSchemaAlterTableRenameColumn)) { + return false; + } + + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/5784', + 'Subscribing to %s events is deprecated.', + Events::onSchemaAlterTableRenameColumn, + ); + + $eventArgs = new SchemaAlterTableRenameColumnEventArgs($oldColumnName, $column, $diff, $this); + $this->_eventManager->dispatchEvent(Events::onSchemaAlterTableRenameColumn, $eventArgs); + + $columnSql = array_merge($columnSql, $eventArgs->getSql()); + + return $eventArgs->isDefaultPrevented(); + } + + /** + * @param string[] $sql + * + * @return bool + */ + protected function onSchemaAlterTable(TableDiff $diff, &$sql) + { + if ($this->_eventManager === null) { + return false; + } + + if (! $this->_eventManager->hasListeners(Events::onSchemaAlterTable)) { + return false; + } + + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/5784', + 'Subscribing to %s events is deprecated.', + Events::onSchemaAlterTable, + ); + + $eventArgs = new SchemaAlterTableEventArgs($diff, $this); + $this->_eventManager->dispatchEvent(Events::onSchemaAlterTable, $eventArgs); + + $sql = array_merge($sql, $eventArgs->getSql()); + + return $eventArgs->isDefaultPrevented(); + } + + /** @return string[] */ + protected function getPreAlterTableIndexForeignKeySQL(TableDiff $diff) + { + $tableNameSQL = ($diff->getOldTable() ?? $diff->getName($this))->getQuotedName($this); + + $sql = []; + if ($this->supportsForeignKeyConstraints()) { + foreach ($diff->getDroppedForeignKeys() as $foreignKey) { + if ($foreignKey instanceof ForeignKeyConstraint) { + $foreignKey = $foreignKey->getQuotedName($this); + } + + $sql[] = $this->getDropForeignKeySQL($foreignKey, $tableNameSQL); + } + + foreach ($diff->getModifiedForeignKeys() as $foreignKey) { + $sql[] = $this->getDropForeignKeySQL($foreignKey->getQuotedName($this), $tableNameSQL); + } + } + + foreach ($diff->getDroppedIndexes() as $index) { + $sql[] = $this->getDropIndexSQL($index->getQuotedName($this), $tableNameSQL); + } + + foreach ($diff->getModifiedIndexes() as $index) { + $sql[] = $this->getDropIndexSQL($index->getQuotedName($this), $tableNameSQL); + } + + return $sql; + } + + /** @return string[] */ + protected function getPostAlterTableIndexForeignKeySQL(TableDiff $diff) + { + $sql = []; + $newName = $diff->getNewName(); + + if ($newName !== false) { + $tableNameSQL = $newName->getQuotedName($this); + } else { + $tableNameSQL = ($diff->getOldTable() ?? $diff->getName($this))->getQuotedName($this); + } + + if ($this->supportsForeignKeyConstraints()) { + foreach ($diff->getAddedForeignKeys() as $foreignKey) { + $sql[] = $this->getCreateForeignKeySQL($foreignKey, $tableNameSQL); + } + + foreach ($diff->getModifiedForeignKeys() as $foreignKey) { + $sql[] = $this->getCreateForeignKeySQL($foreignKey, $tableNameSQL); + } + } + + foreach ($diff->getAddedIndexes() as $index) { + $sql[] = $this->getCreateIndexSQL($index, $tableNameSQL); + } + + foreach ($diff->getModifiedIndexes() as $index) { + $sql[] = $this->getCreateIndexSQL($index, $tableNameSQL); + } + + foreach ($diff->getRenamedIndexes() as $oldIndexName => $index) { + $oldIndexName = new Identifier($oldIndexName); + $sql = array_merge( + $sql, + $this->getRenameIndexSQL($oldIndexName->getQuotedName($this), $index, $tableNameSQL), + ); + } + + return $sql; + } + + /** + * Returns the SQL for renaming an index on a table. + * + * @param string $oldIndexName The name of the index to rename from. + * @param Index $index The definition of the index to rename to. + * @param string $tableName The table to rename the given index on. + * + * @return string[] The sequence of SQL statements for renaming the given index. + */ + protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName) + { + return [ + $this->getDropIndexSQL($oldIndexName, $tableName), + $this->getCreateIndexSQL($index, $tableName), + ]; + } + + /** + * Gets declaration of a number of columns in bulk. + * + * @param mixed[][] $columns A multidimensional associative array. + * The first dimension determines the column name, while the second + * dimension is keyed with the name of the properties + * of the column being declared as array indexes. Currently, the types + * of supported column properties are as follows: + * + * length + * Integer value that determines the maximum length of the text + * column. If this argument is missing the column should be + * declared to have the longest length allowed by the DBMS. + * + * default + * Text value to be used as default for this column. + * + * notnull + * Boolean flag that indicates whether this column is constrained + * to not be set to null. + * charset + * Text value with the default CHARACTER SET for this column. + * collation + * Text value with the default COLLATION for this column. + * unique + * unique constraint + * + * @return string + */ + public function getColumnDeclarationListSQL(array $columns) + { + $declarations = []; + + foreach ($columns as $name => $column) { + $declarations[] = $this->getColumnDeclarationSQL($name, $column); + } + + return implode(', ', $declarations); + } + + /** + * Obtains DBMS specific SQL code portion needed to declare a generic type + * column to be used in statements like CREATE TABLE. + * + * @param string $name The name the column to be declared. + * @param mixed[] $column An associative array with the name of the properties + * of the column being declared as array indexes. Currently, the types + * of supported column properties are as follows: + * + * length + * Integer value that determines the maximum length of the text + * column. If this argument is missing the column should be + * declared to have the longest length allowed by the DBMS. + * + * default + * Text value to be used as default for this column. + * + * notnull + * Boolean flag that indicates whether this column is constrained + * to not be set to null. + * charset + * Text value with the default CHARACTER SET for this column. + * collation + * Text value with the default COLLATION for this column. + * unique + * unique constraint + * check + * column check constraint + * columnDefinition + * a string that defines the complete column + * + * @return string DBMS specific SQL code portion that should be used to declare the column. + * + * @throws Exception + */ + public function getColumnDeclarationSQL($name, array $column) + { + if (isset($column['columnDefinition'])) { + $declaration = $this->getCustomTypeDeclarationSQL($column); + } else { + $default = $this->getDefaultValueDeclarationSQL($column); + + $charset = ! empty($column['charset']) ? + ' ' . $this->getColumnCharsetDeclarationSQL($column['charset']) : ''; + + $collation = ! empty($column['collation']) ? + ' ' . $this->getColumnCollationDeclarationSQL($column['collation']) : ''; + + $notnull = ! empty($column['notnull']) ? ' NOT NULL' : ''; + + if (! empty($column['unique'])) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5656', + 'The usage of the "unique" column property is deprecated. Use unique constraints instead.', + ); + + $unique = ' ' . $this->getUniqueFieldDeclarationSQL(); + } else { + $unique = ''; + } + + if (! empty($column['check'])) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5656', + 'The usage of the "check" column property is deprecated.', + ); + + $check = ' ' . $column['check']; + } else { + $check = ''; + } + + $typeDecl = $column['type']->getSQLDeclaration($column, $this); + $declaration = $typeDecl . $charset . $default . $notnull . $unique . $check . $collation; + + if ($this->supportsInlineColumnComments() && isset($column['comment']) && $column['comment'] !== '') { + $declaration .= ' ' . $this->getInlineColumnCommentSQL($column['comment']); + } + } + + return $name . ' ' . $declaration; + } + + /** + * Returns the SQL snippet that declares a floating point column of arbitrary precision. + * + * @param mixed[] $column + * + * @return string + */ + public function getDecimalTypeDeclarationSQL(array $column) + { + if (empty($column['precision'])) { + if (! isset($column['precision'])) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5637', + 'Relying on the default decimal column precision is deprecated' + . ', specify the precision explicitly.', + ); + } + + $precision = 10; + } else { + $precision = $column['precision']; + } + + if (empty($column['scale'])) { + if (! isset($column['scale'])) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5637', + 'Relying on the default decimal column scale is deprecated' + . ', specify the scale explicitly.', + ); + } + + $scale = 0; + } else { + $scale = $column['scale']; + } + + return 'NUMERIC(' . $precision . ', ' . $scale . ')'; + } + + /** + * Obtains DBMS specific SQL code portion needed to set a default value + * declaration to be used in statements like CREATE TABLE. + * + * @param mixed[] $column The column definition array. + * + * @return string DBMS specific SQL code portion needed to set a default value. + */ + public function getDefaultValueDeclarationSQL($column) + { + if (! isset($column['default'])) { + return empty($column['notnull']) ? ' DEFAULT NULL' : ''; + } + + $default = $column['default']; + + if (! isset($column['type'])) { + return " DEFAULT '" . $default . "'"; + } + + $type = $column['type']; + + if ($type instanceof Types\PhpIntegerMappingType) { + return ' DEFAULT ' . $default; + } + + if ($type instanceof Types\PhpDateTimeMappingType && $default === $this->getCurrentTimestampSQL()) { + return ' DEFAULT ' . $this->getCurrentTimestampSQL(); + } + + if ($type instanceof Types\TimeType && $default === $this->getCurrentTimeSQL()) { + return ' DEFAULT ' . $this->getCurrentTimeSQL(); + } + + if ($type instanceof Types\DateType && $default === $this->getCurrentDateSQL()) { + return ' DEFAULT ' . $this->getCurrentDateSQL(); + } + + if ($type instanceof Types\BooleanType) { + return ' DEFAULT ' . $this->convertBooleans($default); + } + + return ' DEFAULT ' . $this->quoteStringLiteral($default); + } + + /** + * Obtains DBMS specific SQL code portion needed to set a CHECK constraint + * declaration to be used in statements like CREATE TABLE. + * + * @param string[]|mixed[][] $definition The check definition. + * + * @return string DBMS specific SQL code portion needed to set a CHECK constraint. + */ + public function getCheckDeclarationSQL(array $definition) + { + $constraints = []; + foreach ($definition as $column => $def) { + if (is_string($def)) { + $constraints[] = 'CHECK (' . $def . ')'; + } else { + if (isset($def['min'])) { + $constraints[] = 'CHECK (' . $column . ' >= ' . $def['min'] . ')'; + } + + if (isset($def['max'])) { + $constraints[] = 'CHECK (' . $column . ' <= ' . $def['max'] . ')'; + } + } + } + + return implode(', ', $constraints); + } + + /** + * Obtains DBMS specific SQL code portion needed to set a unique + * constraint declaration to be used in statements like CREATE TABLE. + * + * @param string $name The name of the unique constraint. + * @param UniqueConstraint $constraint The unique constraint definition. + * + * @return string DBMS specific SQL code portion needed to set a constraint. + * + * @throws InvalidArgumentException + */ + public function getUniqueConstraintDeclarationSQL($name, UniqueConstraint $constraint) + { + $columns = $constraint->getQuotedColumns($this); + $name = new Identifier($name); + + if (count($columns) === 0) { + throw new InvalidArgumentException("Incomplete definition. 'columns' required."); + } + + $constraintFlags = array_merge(['UNIQUE'], array_map('strtoupper', $constraint->getFlags())); + $constraintName = $name->getQuotedName($this); + $columnListNames = $this->getColumnsFieldDeclarationListSQL($columns); + + return sprintf('CONSTRAINT %s %s (%s)', $constraintName, implode(' ', $constraintFlags), $columnListNames); + } + + /** + * Obtains DBMS specific SQL code portion needed to set an index + * declaration to be used in statements like CREATE TABLE. + * + * @param string $name The name of the index. + * @param Index $index The index definition. + * + * @return string DBMS specific SQL code portion needed to set an index. + * + * @throws InvalidArgumentException + */ + public function getIndexDeclarationSQL($name, Index $index) + { + $columns = $index->getColumns(); + $name = new Identifier($name); + + if (count($columns) === 0) { + throw new InvalidArgumentException("Incomplete definition. 'columns' required."); + } + + return $this->getCreateIndexSQLFlags($index) . 'INDEX ' . $name->getQuotedName($this) + . ' (' . $this->getIndexFieldDeclarationListSQL($index) . ')' . $this->getPartialIndexSQL($index); + } + + /** + * Obtains SQL code portion needed to create a custom column, + * e.g. when a column has the "columnDefinition" keyword. + * Only "AUTOINCREMENT" and "PRIMARY KEY" are added if appropriate. + * + * @deprecated + * + * @param mixed[] $column + * + * @return string + */ + public function getCustomTypeDeclarationSQL(array $column) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5527', + '%s is deprecated.', + __METHOD__, + ); + + return $column['columnDefinition']; + } + + /** + * Obtains DBMS specific SQL code portion needed to set an index + * declaration to be used in statements like CREATE TABLE. + * + * @deprecated + */ + public function getIndexFieldDeclarationListSQL(Index $index): string + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5527', + '%s is deprecated.', + __METHOD__, + ); + + return implode(', ', $index->getQuotedColumns($this)); + } + + /** + * Obtains DBMS specific SQL code portion needed to set an index + * declaration to be used in statements like CREATE TABLE. + * + * @deprecated + * + * @param mixed[] $columns + */ + public function getColumnsFieldDeclarationListSQL(array $columns): string + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5527', + '%s is deprecated.', + __METHOD__, + ); + + $ret = []; + + foreach ($columns as $column => $definition) { + if (is_array($definition)) { + $ret[] = $column; + } else { + $ret[] = $definition; + } + } + + return implode(', ', $ret); + } + + /** + * Returns the required SQL string that fits between CREATE ... TABLE + * to create the table as a temporary table. + * + * Should be overridden in driver classes to return the correct string for the + * specific database type. + * + * The default is to return the string "TEMPORARY" - this will result in a + * SQL error for any database that does not support temporary tables, or that + * requires a different SQL command from "CREATE TEMPORARY TABLE". + * + * @deprecated + * + * @return string The string required to be placed between "CREATE" and "TABLE" + * to generate a temporary table, if possible. + */ + public function getTemporaryTableSQL() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getTemporaryTableSQL() is deprecated.', + ); + + return 'TEMPORARY'; + } + + /** + * Some vendors require temporary table names to be qualified specially. + * + * @param string $tableName + * + * @return string + */ + public function getTemporaryTableName($tableName) + { + return $tableName; + } + + /** + * Obtain DBMS specific SQL code portion needed to set the FOREIGN KEY constraint + * of a column declaration to be used in statements like CREATE TABLE. + * + * @return string DBMS specific SQL code portion needed to set the FOREIGN KEY constraint + * of a column declaration. + */ + public function getForeignKeyDeclarationSQL(ForeignKeyConstraint $foreignKey) + { + $sql = $this->getForeignKeyBaseDeclarationSQL($foreignKey); + $sql .= $this->getAdvancedForeignKeyOptionsSQL($foreignKey); + + return $sql; + } + + /** + * Returns the FOREIGN KEY query section dealing with non-standard options + * as MATCH, INITIALLY DEFERRED, ON UPDATE, ... + * + * @param ForeignKeyConstraint $foreignKey The foreign key definition. + * + * @return string + */ + public function getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint $foreignKey) + { + $query = ''; + if ($foreignKey->hasOption('onUpdate')) { + $query .= ' ON UPDATE ' . $this->getForeignKeyReferentialActionSQL($foreignKey->getOption('onUpdate')); + } + + if ($foreignKey->hasOption('onDelete')) { + $query .= ' ON DELETE ' . $this->getForeignKeyReferentialActionSQL($foreignKey->getOption('onDelete')); + } + + return $query; + } + + /** + * Returns the given referential action in uppercase if valid, otherwise throws an exception. + * + * @param string $action The foreign key referential action. + * + * @return string + * + * @throws InvalidArgumentException If unknown referential action given. + */ + public function getForeignKeyReferentialActionSQL($action) + { + $upper = strtoupper($action); + switch ($upper) { + case 'CASCADE': + case 'SET NULL': + case 'NO ACTION': + case 'RESTRICT': + case 'SET DEFAULT': + return $upper; + + default: + throw new InvalidArgumentException('Invalid foreign key action: ' . $upper); + } + } + + /** + * Obtains DBMS specific SQL code portion needed to set the FOREIGN KEY constraint + * of a column declaration to be used in statements like CREATE TABLE. + * + * @return string + * + * @throws InvalidArgumentException + */ + public function getForeignKeyBaseDeclarationSQL(ForeignKeyConstraint $foreignKey) + { + $sql = ''; + if (strlen($foreignKey->getName()) > 0) { + $sql .= 'CONSTRAINT ' . $foreignKey->getQuotedName($this) . ' '; + } + + $sql .= 'FOREIGN KEY ('; + + if (count($foreignKey->getLocalColumns()) === 0) { + throw new InvalidArgumentException("Incomplete definition. 'local' required."); + } + + if (count($foreignKey->getForeignColumns()) === 0) { + throw new InvalidArgumentException("Incomplete definition. 'foreign' required."); + } + + if (strlen($foreignKey->getForeignTableName()) === 0) { + throw new InvalidArgumentException("Incomplete definition. 'foreignTable' required."); + } + + return $sql . implode(', ', $foreignKey->getQuotedLocalColumns($this)) + . ') REFERENCES ' + . $foreignKey->getQuotedForeignTableName($this) . ' (' + . implode(', ', $foreignKey->getQuotedForeignColumns($this)) . ')'; + } + + /** + * Obtains DBMS specific SQL code portion needed to set the UNIQUE constraint + * of a column declaration to be used in statements like CREATE TABLE. + * + * @deprecated Use UNIQUE in SQL instead. + * + * @return string DBMS specific SQL code portion needed to set the UNIQUE constraint + * of a column declaration. + */ + public function getUniqueFieldDeclarationSQL() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getUniqueFieldDeclarationSQL() is deprecated. Use UNIQUE in SQL instead.', + ); + + return 'UNIQUE'; + } + + /** + * Obtains DBMS specific SQL code portion needed to set the CHARACTER SET + * of a column declaration to be used in statements like CREATE TABLE. + * + * @param string $charset The name of the charset. + * + * @return string DBMS specific SQL code portion needed to set the CHARACTER SET + * of a column declaration. + */ + public function getColumnCharsetDeclarationSQL($charset) + { + return ''; + } + + /** + * Obtains DBMS specific SQL code portion needed to set the COLLATION + * of a column declaration to be used in statements like CREATE TABLE. + * + * @param string $collation The name of the collation. + * + * @return string DBMS specific SQL code portion needed to set the COLLATION + * of a column declaration. + */ + public function getColumnCollationDeclarationSQL($collation) + { + return $this->supportsColumnCollation() ? 'COLLATE ' . $this->quoteSingleIdentifier($collation) : ''; + } + + /** + * Whether the platform prefers identity columns (eg. autoincrement) for ID generation. + * Subclasses should override this method to return TRUE if they prefer identity columns. + * + * @deprecated + * + * @return bool + */ + public function prefersIdentityColumns() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/1519', + 'AbstractPlatform::prefersIdentityColumns() is deprecated.', + ); + + return false; + } + + /** + * Some platforms need the boolean values to be converted. + * + * The default conversion in this implementation converts to integers (false => 0, true => 1). + * + * Note: if the input is not a boolean the original input might be returned. + * + * There are two contexts when converting booleans: Literals and Prepared Statements. + * This method should handle the literal case + * + * @param mixed $item A boolean or an array of them. + * + * @return mixed A boolean database value or an array of them. + */ + public function convertBooleans($item) + { + if (is_array($item)) { + foreach ($item as $k => $value) { + if (! is_bool($value)) { + continue; + } + + $item[$k] = (int) $value; + } + } elseif (is_bool($item)) { + $item = (int) $item; + } + + return $item; + } + + /** + * Some platforms have boolean literals that needs to be correctly converted + * + * The default conversion tries to convert value into bool "(bool)$item" + * + * @param mixed $item + * + * @return bool|null + */ + public function convertFromBoolean($item) + { + return $item === null ? null : (bool) $item; + } + + /** + * This method should handle the prepared statements case. When there is no + * distinction, it's OK to use the same method. + * + * Note: if the input is not a boolean the original input might be returned. + * + * @param mixed $item A boolean or an array of them. + * + * @return mixed A boolean database value or an array of them. + */ + public function convertBooleansToDatabaseValue($item) + { + return $this->convertBooleans($item); + } + + /** + * Returns the SQL specific for the platform to get the current date. + * + * @return string + */ + public function getCurrentDateSQL() + { + return 'CURRENT_DATE'; + } + + /** + * Returns the SQL specific for the platform to get the current time. + * + * @return string + */ + public function getCurrentTimeSQL() + { + return 'CURRENT_TIME'; + } + + /** + * Returns the SQL specific for the platform to get the current timestamp + * + * @return string + */ + public function getCurrentTimestampSQL() + { + return 'CURRENT_TIMESTAMP'; + } + + /** + * Returns the SQL for a given transaction isolation level Connection constant. + * + * @param int $level + * + * @return string + * + * @throws InvalidArgumentException + */ + protected function _getTransactionIsolationLevelSQL($level) + { + switch ($level) { + case TransactionIsolationLevel::READ_UNCOMMITTED: + return 'READ UNCOMMITTED'; + + case TransactionIsolationLevel::READ_COMMITTED: + return 'READ COMMITTED'; + + case TransactionIsolationLevel::REPEATABLE_READ: + return 'REPEATABLE READ'; + + case TransactionIsolationLevel::SERIALIZABLE: + return 'SERIALIZABLE'; + + default: + throw new InvalidArgumentException('Invalid isolation level:' . $level); + } + } + + /** + * @internal The method should be only used from within the {@see AbstractSchemaManager} class hierarchy. + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getListDatabasesSQL() + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Returns the SQL statement for retrieving the namespaces defined in the database. + * + * @deprecated Use {@see AbstractSchemaManager::listSchemaNames()} instead. + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getListNamespacesSQL() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4503', + 'AbstractPlatform::getListNamespacesSQL() is deprecated,' + . ' use AbstractSchemaManager::listSchemaNames() instead.', + ); + + throw Exception::notSupported(__METHOD__); + } + + /** + * @internal The method should be only used from within the {@see AbstractSchemaManager} class hierarchy. + * + * @param string $database + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getListSequencesSQL($database) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * @deprecated + * + * @param string $table + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getListTableConstraintsSQL($table) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * @param string $table + * @param string $database + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getListTableColumnsSQL($table, $database = null) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getListTablesSQL() + { + throw Exception::notSupported(__METHOD__); + } + + /** + * @deprecated + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getListUsersSQL() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::getListUsersSQL() is deprecated.', + ); + + throw Exception::notSupported(__METHOD__); + } + + /** + * Returns the SQL to list all views of a database or user. + * + * @internal The method should be only used from within the {@see AbstractSchemaManager} class hierarchy. + * + * @param string $database + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getListViewsSQL($database) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * Returns the list of indexes for the current database. + * + * The current database parameter is optional but will always be passed + * when using the SchemaManager API and is the database the given table is in. + * + * Attention: Some platforms only support currentDatabase when they + * are connected with that database. Cross-database information schema + * requests may be impossible. + * + * @param string $table + * @param string $database + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getListTableIndexesSQL($table, $database = null) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * @param string $table + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getListTableForeignKeysSQL($table) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * @param string $name + * @param string $sql + * + * @return string + */ + public function getCreateViewSQL($name, $sql) + { + return 'CREATE VIEW ' . $name . ' AS ' . $sql; + } + + /** + * @param string $name + * + * @return string + */ + public function getDropViewSQL($name) + { + return 'DROP VIEW ' . $name; + } + + /** + * @param string $sequence + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getSequenceNextValSQL($sequence) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Returns the SQL to create a new database. + * + * @param string $name The name of the database that should be created. + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getCreateDatabaseSQL($name) + { + if (! $this->supportsCreateDropDatabase()) { + throw Exception::notSupported(__METHOD__); + } + + return 'CREATE DATABASE ' . $name; + } + + /** + * Returns the SQL snippet to drop an existing database. + * + * @param string $name The name of the database that should be dropped. + * + * @return string + */ + public function getDropDatabaseSQL($name) + { + if (! $this->supportsCreateDropDatabase()) { + throw Exception::notSupported(__METHOD__); + } + + return 'DROP DATABASE ' . $name; + } + + /** + * Returns the SQL to set the transaction isolation level. + * + * @param int $level + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getSetTransactionIsolationSQL($level) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Obtains DBMS specific SQL to be used to create datetime columns in + * statements like CREATE TABLE. + * + * @param mixed[] $column + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateTimeTypeDeclarationSQL(array $column) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Obtains DBMS specific SQL to be used to create datetime with timezone offset columns. + * + * @param mixed[] $column + * + * @return string + */ + public function getDateTimeTzTypeDeclarationSQL(array $column) + { + return $this->getDateTimeTypeDeclarationSQL($column); + } + + /** + * Obtains DBMS specific SQL to be used to create date columns in statements + * like CREATE TABLE. + * + * @param mixed[] $column + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateTypeDeclarationSQL(array $column) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Obtains DBMS specific SQL to be used to create time columns in statements + * like CREATE TABLE. + * + * @param mixed[] $column + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getTimeTypeDeclarationSQL(array $column) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * @param mixed[] $column + * + * @return string + */ + public function getFloatDeclarationSQL(array $column) + { + return 'DOUBLE PRECISION'; + } + + /** + * Gets the default transaction isolation level of the platform. + * + * @see TransactionIsolationLevel + * + * @return TransactionIsolationLevel::* The default isolation level. + */ + public function getDefaultTransactionIsolationLevel() + { + return TransactionIsolationLevel::READ_COMMITTED; + } + + /* supports*() methods */ + + /** + * Whether the platform supports sequences. + * + * @return bool + */ + public function supportsSequences() + { + return false; + } + + /** + * Whether the platform supports identity columns. + * + * Identity columns are columns that receive an auto-generated value from the + * database on insert of a row. + * + * @return bool + */ + public function supportsIdentityColumns() + { + return false; + } + + /** + * Whether the platform emulates identity columns through sequences. + * + * Some platforms that do not support identity columns natively + * but support sequences can emulate identity columns by using + * sequences. + * + * @deprecated + * + * @return bool + */ + public function usesSequenceEmulatedIdentityColumns() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5513', + '%s is deprecated.', + __METHOD__, + ); + + return false; + } + + /** + * Returns the name of the sequence for a particular identity column in a particular table. + * + * @deprecated + * + * @see usesSequenceEmulatedIdentityColumns + * + * @param string $tableName The name of the table to return the sequence name for. + * @param string $columnName The name of the identity column in the table to return the sequence name for. + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getIdentitySequenceName($tableName, $columnName) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Whether the platform supports indexes. + * + * @deprecated + * + * @return bool + */ + public function supportsIndexes() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::supportsIndexes() is deprecated.', + ); + + return true; + } + + /** + * Whether the platform supports partial indexes. + * + * @return bool + */ + public function supportsPartialIndexes() + { + return false; + } + + /** + * Whether the platform supports indexes with column length definitions. + */ + public function supportsColumnLengthIndexes(): bool + { + return false; + } + + /** + * Whether the platform supports altering tables. + * + * @deprecated All platforms must implement altering tables. + * + * @return bool + */ + public function supportsAlterTable() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::supportsAlterTable() is deprecated. All platforms must implement altering tables.', + ); + + return true; + } + + /** + * Whether the platform supports transactions. + * + * @deprecated + * + * @return bool + */ + public function supportsTransactions() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::supportsTransactions() is deprecated.', + ); + + return true; + } + + /** + * Whether the platform supports savepoints. + * + * @return bool + */ + public function supportsSavepoints() + { + return true; + } + + /** + * Whether the platform supports releasing savepoints. + * + * @return bool + */ + public function supportsReleaseSavepoints() + { + return $this->supportsSavepoints(); + } + + /** + * Whether the platform supports primary key constraints. + * + * @deprecated + * + * @return bool + */ + public function supportsPrimaryConstraints() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::supportsPrimaryConstraints() is deprecated.', + ); + + return true; + } + + /** + * Whether the platform supports foreign key constraints. + * + * @deprecated All platforms should support foreign key constraints. + * + * @return bool + */ + public function supportsForeignKeyConstraints() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5409', + 'AbstractPlatform::supportsForeignKeyConstraints() is deprecated.', + ); + + return true; + } + + /** + * Whether the platform supports database schemas. + * + * @return bool + */ + public function supportsSchemas() + { + return false; + } + + /** + * Whether this platform can emulate schemas. + * + * @deprecated + * + * Platforms that either support or emulate schemas don't automatically + * filter a schema for the namespaced elements in {@see AbstractManager::introspectSchema()}. + * + * @return bool + */ + public function canEmulateSchemas() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4805', + 'AbstractPlatform::canEmulateSchemas() is deprecated.', + ); + + return false; + } + + /** + * Returns the default schema name. + * + * @deprecated + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDefaultSchemaName() + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Whether this platform supports create database. + * + * Some databases don't allow to create and drop databases at all or only with certain tools. + * + * @deprecated + * + * @return bool + */ + public function supportsCreateDropDatabase() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5513', + '%s is deprecated.', + __METHOD__, + ); + + return true; + } + + /** + * Whether the platform supports getting the affected rows of a recent update/delete type query. + * + * @deprecated + * + * @return bool + */ + public function supportsGettingAffectedRows() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::supportsGettingAffectedRows() is deprecated.', + ); + + return true; + } + + /** + * Whether this platform support to add inline column comments as postfix. + * + * @return bool + */ + public function supportsInlineColumnComments() + { + return false; + } + + /** + * Whether this platform support the proprietary syntax "COMMENT ON asset". + * + * @return bool + */ + public function supportsCommentOnStatement() + { + return false; + } + + /** + * Does this platform have native guid type. + * + * @deprecated + * + * @return bool + */ + public function hasNativeGuidType() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5509', + '%s is deprecated.', + __METHOD__, + ); + + return false; + } + + /** + * Does this platform have native JSON type. + * + * @deprecated + * + * @return bool + */ + public function hasNativeJsonType() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5509', + '%s is deprecated.', + __METHOD__, + ); + + return false; + } + + /** + * Whether this platform supports views. + * + * @deprecated All platforms must implement support for views. + * + * @return bool + */ + public function supportsViews() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::supportsViews() is deprecated. All platforms must implement support for views.', + ); + + return true; + } + + /** + * Does this platform support column collation? + * + * @return bool + */ + public function supportsColumnCollation() + { + return false; + } + + /** + * Gets the format string, as accepted by the date() function, that describes + * the format of a stored datetime value of this platform. + * + * @return string The format string. + */ + public function getDateTimeFormatString() + { + return 'Y-m-d H:i:s'; + } + + /** + * Gets the format string, as accepted by the date() function, that describes + * the format of a stored datetime with timezone value of this platform. + * + * @return string The format string. + */ + public function getDateTimeTzFormatString() + { + return 'Y-m-d H:i:s'; + } + + /** + * Gets the format string, as accepted by the date() function, that describes + * the format of a stored date value of this platform. + * + * @return string The format string. + */ + public function getDateFormatString() + { + return 'Y-m-d'; + } + + /** + * Gets the format string, as accepted by the date() function, that describes + * the format of a stored time value of this platform. + * + * @return string The format string. + */ + public function getTimeFormatString() + { + return 'H:i:s'; + } + + /** + * Adds an driver-specific LIMIT clause to the query. + * + * @param string $query + * @param int|null $limit + * @param int $offset + * + * @throws Exception + */ + final public function modifyLimitQuery($query, $limit, $offset = 0): string + { + if ($offset < 0) { + throw new Exception(sprintf( + 'Offset must be a positive integer or zero, %d given', + $offset, + )); + } + + if ($offset > 0 && ! $this->supportsLimitOffset()) { + throw new Exception(sprintf( + 'Platform %s does not support offset values in limit queries.', + $this->getName(), + )); + } + + if ($limit !== null) { + $limit = (int) $limit; + } + + return $this->doModifyLimitQuery($query, $limit, (int) $offset); + } + + /** + * Adds an platform-specific LIMIT clause to the query. + * + * @param string $query + * @param int|null $limit + * @param int $offset + * + * @return string + */ + protected function doModifyLimitQuery($query, $limit, $offset) + { + if ($limit !== null) { + $query .= sprintf(' LIMIT %d', $limit); + } + + if ($offset > 0) { + $query .= sprintf(' OFFSET %d', $offset); + } + + return $query; + } + + /** + * Whether the database platform support offsets in modify limit clauses. + * + * @deprecated All platforms must implement support for offsets in modify limit clauses. + * + * @return bool + */ + public function supportsLimitOffset() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4724', + 'AbstractPlatform::supportsViews() is deprecated.' + . ' All platforms must implement support for offsets in modify limit clauses.', + ); + + return true; + } + + /** + * Maximum length of any given database identifier, like tables or column names. + * + * @return int + */ + public function getMaxIdentifierLength() + { + return 63; + } + + /** + * Returns the insert SQL for an empty insert statement. + * + * @param string $quotedTableName + * @param string $quotedIdentifierColumnName + * + * @return string + */ + public function getEmptyIdentityInsertSQL($quotedTableName, $quotedIdentifierColumnName) + { + return 'INSERT INTO ' . $quotedTableName . ' (' . $quotedIdentifierColumnName . ') VALUES (null)'; + } + + /** + * Generates a Truncate Table SQL statement for a given table. + * + * Cascade is not supported on many platforms but would optionally cascade the truncate by + * following the foreign keys. + * + * @param string $tableName + * @param bool $cascade + * + * @return string + */ + public function getTruncateTableSQL($tableName, $cascade = false) + { + $tableIdentifier = new Identifier($tableName); + + return 'TRUNCATE ' . $tableIdentifier->getQuotedName($this); + } + + /** + * This is for test reasons, many vendors have special requirements for dummy statements. + * + * @return string + */ + public function getDummySelectSQL() + { + $expression = func_num_args() > 0 ? func_get_arg(0) : '1'; + + return sprintf('SELECT %s', $expression); + } + + /** + * Returns the SQL to create a new savepoint. + * + * @param string $savepoint + * + * @return string + */ + public function createSavePoint($savepoint) + { + return 'SAVEPOINT ' . $savepoint; + } + + /** + * Returns the SQL to release a savepoint. + * + * @param string $savepoint + * + * @return string + */ + public function releaseSavePoint($savepoint) + { + return 'RELEASE SAVEPOINT ' . $savepoint; + } + + /** + * Returns the SQL to rollback a savepoint. + * + * @param string $savepoint + * + * @return string + */ + public function rollbackSavePoint($savepoint) + { + return 'ROLLBACK TO SAVEPOINT ' . $savepoint; + } + + /** + * Returns the keyword list instance of this platform. + * + * @throws Exception If no keyword list is specified. + */ + final public function getReservedKeywordsList(): KeywordList + { + // Store the instance so it doesn't need to be generated on every request. + return $this->_keywords ??= $this->createReservedKeywordsList(); + } + + /** + * Creates an instance of the reserved keyword list of this platform. + * + * This method will become @abstract in DBAL 4.0.0. + * + * @throws Exception + */ + protected function createReservedKeywordsList(): KeywordList + { + $class = $this->getReservedKeywordsClass(); + $keywords = new $class(); + if (! $keywords instanceof KeywordList) { + throw Exception::notSupported(__METHOD__); + } + + return $keywords; + } + + /** + * Returns the class name of the reserved keywords list. + * + * @deprecated Implement {@see createReservedKeywordsList()} instead. + * + * @return string + * @psalm-return class-string + * + * @throws Exception If not supported on this platform. + */ + protected function getReservedKeywordsClass() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4510', + 'AbstractPlatform::getReservedKeywordsClass() is deprecated,' + . ' use AbstractPlatform::createReservedKeywordsList() instead.', + ); + + throw Exception::notSupported(__METHOD__); + } + + /** + * Quotes a literal string. + * This method is NOT meant to fix SQL injections! + * It is only meant to escape this platform's string literal + * quote character inside the given literal string. + * + * @param string $str The literal string to be quoted. + * + * @return string The quoted literal string. + */ + public function quoteStringLiteral($str) + { + $c = $this->getStringLiteralQuoteCharacter(); + + return $c . str_replace($c, $c . $c, $str) . $c; + } + + /** + * Gets the character used for string literal quoting. + * + * @deprecated Use {@see quoteStringLiteral()} to quote string literals instead. + * + * @return string + */ + public function getStringLiteralQuoteCharacter() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5388', + 'AbstractPlatform::getStringLiteralQuoteCharacter() is deprecated.' + . ' Use quoteStringLiteral() instead.', + ); + + return "'"; + } + + /** + * Escapes metacharacters in a string intended to be used with a LIKE + * operator. + * + * @param string $inputString a literal, unquoted string + * @param string $escapeChar should be reused by the caller in the LIKE + * expression. + */ + final public function escapeStringForLike(string $inputString, string $escapeChar): string + { + return preg_replace( + '~([' . preg_quote($this->getLikeWildcardCharacters() . $escapeChar, '~') . '])~u', + addcslashes($escapeChar, '\\') . '$1', + $inputString, + ); + } + + /** + * @return array An associative array with the name of the properties + * of the column being declared as array indexes. + */ + private function columnToArray(Column $column): array + { + $name = $column->getQuotedName($this); + + return array_merge($column->toArray(), [ + 'name' => $name, + 'version' => $column->hasPlatformOption('version') ? $column->getPlatformOption('version') : false, + 'comment' => $this->getColumnComment($column), + ]); + } + + /** @internal */ + public function createSQLParser(): Parser + { + return new Parser(false); + } + + protected function getLikeWildcardCharacters(): string + { + return '%_'; + } + + /** + * Compares the definitions of the given columns in the context of this platform. + * + * @throws Exception + */ + public function columnsEqual(Column $column1, Column $column2): bool + { + $column1Array = $this->columnToArray($column1); + $column2Array = $this->columnToArray($column2); + + // ignore explicit columnDefinition since it's not set on the Column generated by the SchemaManager + unset($column1Array['columnDefinition']); + unset($column2Array['columnDefinition']); + + if ( + $this->getColumnDeclarationSQL('', $column1Array) + !== $this->getColumnDeclarationSQL('', $column2Array) + ) { + return false; + } + + // If the platform supports inline comments, all comparison is already done above + if ($this->supportsInlineColumnComments()) { + return true; + } + + if ($column1->getComment() !== $column2->getComment()) { + return false; + } + + return $column1->getType() === $column2->getType(); + } + + /** + * Creates the schema manager that can be used to inspect and change the underlying + * database schema according to the dialect of the platform. + * + * @throws Exception + * + * @abstract + */ + public function createSchemaManager(Connection $connection): AbstractSchemaManager + { + throw Exception::notSupported(__METHOD__); + } +} diff --git a/vendor/doctrine/dbal/src/Platforms/DB2Platform.php b/vendor/doctrine/dbal/src/Platforms/DB2Platform.php new file mode 100644 index 00000000..c40a03e6 --- /dev/null +++ b/vendor/doctrine/dbal/src/Platforms/DB2Platform.php @@ -0,0 +1,1013 @@ +getCharMaxLength(); + } + + return parent::getVarcharTypeDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + public function getBlobTypeDeclarationSQL(array $column) + { + // todo blob(n) with $column['length']; + return 'BLOB(1M)'; + } + + /** + * {@inheritDoc} + */ + protected function initializeDoctrineTypeMappings() + { + $this->doctrineTypeMapping = [ + 'bigint' => 'bigint', + 'binary' => 'binary', + 'blob' => 'blob', + 'character' => 'string', + 'clob' => 'text', + 'date' => 'date', + 'decimal' => 'decimal', + 'double' => 'float', + 'integer' => 'integer', + 'real' => 'float', + 'smallint' => 'smallint', + 'time' => 'time', + 'timestamp' => 'datetime', + 'varbinary' => 'binary', + 'varchar' => 'string', + ]; + } + + /** + * {@inheritdoc} + */ + public function isCommentedDoctrineType(Type $doctrineType) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5058', + '%s is deprecated and will be removed in Doctrine DBAL 4.0. Use Type::requiresSQLCommentHint() instead.', + __METHOD__, + ); + + if ($doctrineType->getName() === Types::BOOLEAN) { + // We require a commented boolean type in order to distinguish between boolean and smallint + // as both (have to) map to the same native type. + return true; + } + + return parent::isCommentedDoctrineType($doctrineType); + } + + /** + * {@inheritDoc} + */ + protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed/*, $lengthOmitted = false*/) + { + if ($length <= 0 || (func_num_args() > 2 && func_get_arg(2))) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3263', + 'Relying on the default string column length on IBM DB2 is deprecated' + . ', specify the length explicitly.', + ); + } + + return $fixed ? ($length > 0 ? 'CHAR(' . $length . ')' : 'CHAR(254)') + : ($length > 0 ? 'VARCHAR(' . $length . ')' : 'VARCHAR(255)'); + } + + /** + * {@inheritdoc} + */ + protected function getBinaryTypeDeclarationSQLSnippet($length, $fixed/*, $lengthOmitted = false*/) + { + if ($length <= 0 || (func_num_args() > 2 && func_get_arg(2))) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3263', + 'Relying on the default binary column length on IBM DB2 is deprecated' + . ', specify the length explicitly.', + ); + } + + return $this->getVarcharTypeDeclarationSQLSnippet($length, $fixed) . ' FOR BIT DATA'; + } + + /** + * {@inheritDoc} + */ + public function getClobTypeDeclarationSQL(array $column) + { + // todo clob(n) with $column['length']; + return 'CLOB(1M)'; + } + + /** + * {@inheritDoc} + */ + public function getName() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4749', + 'DB2Platform::getName() is deprecated. Identify platforms by their class.', + ); + + return 'db2'; + } + + /** + * {@inheritDoc} + */ + public function getBooleanTypeDeclarationSQL(array $column) + { + return 'SMALLINT'; + } + + /** + * {@inheritDoc} + */ + public function getIntegerTypeDeclarationSQL(array $column) + { + return 'INTEGER' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + public function getBigIntTypeDeclarationSQL(array $column) + { + return 'BIGINT' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + public function getSmallIntTypeDeclarationSQL(array $column) + { + return 'SMALLINT' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + protected function _getCommonIntegerTypeDeclarationSQL(array $column) + { + $autoinc = ''; + if (! empty($column['autoincrement'])) { + $autoinc = ' GENERATED BY DEFAULT AS IDENTITY'; + } + + return $autoinc; + } + + /** + * {@inheritdoc} + */ + public function getBitAndComparisonExpression($value1, $value2) + { + return 'BITAND(' . $value1 . ', ' . $value2 . ')'; + } + + /** + * {@inheritdoc} + */ + public function getBitOrComparisonExpression($value1, $value2) + { + return 'BITOR(' . $value1 . ', ' . $value2 . ')'; + } + + /** + * {@inheritdoc} + */ + protected function getDateArithmeticIntervalExpression($date, $operator, $interval, $unit) + { + switch ($unit) { + case DateIntervalUnit::WEEK: + $interval *= 7; + $unit = DateIntervalUnit::DAY; + break; + + case DateIntervalUnit::QUARTER: + $interval *= 3; + $unit = DateIntervalUnit::MONTH; + break; + } + + return $date . ' ' . $operator . ' ' . $interval . ' ' . $unit; + } + + /** + * {@inheritdoc} + */ + public function getDateDiffExpression($date1, $date2) + { + return 'DAYS(' . $date1 . ') - DAYS(' . $date2 . ')'; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeTypeDeclarationSQL(array $column) + { + if (isset($column['version']) && $column['version'] === true) { + return 'TIMESTAMP(0) WITH DEFAULT'; + } + + return 'TIMESTAMP(0)'; + } + + /** + * {@inheritDoc} + */ + public function getDateTypeDeclarationSQL(array $column) + { + return 'DATE'; + } + + /** + * {@inheritDoc} + */ + public function getTimeTypeDeclarationSQL(array $column) + { + return 'TIME'; + } + + /** + * {@inheritdoc} + */ + public function getTruncateTableSQL($tableName, $cascade = false) + { + $tableIdentifier = new Identifier($tableName); + + return 'TRUNCATE ' . $tableIdentifier->getQuotedName($this) . ' IMMEDIATE'; + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * This code fragment is originally from the Zend_Db_Adapter_Db2 class, but has been edited. + * + * @param string $table + * @param string $database + * + * @return string + */ + public function getListTableColumnsSQL($table, $database = null) + { + $table = $this->quoteStringLiteral($table); + + // We do the funky subquery and join syscat.columns.default this crazy way because + // as of db2 v10, the column is CLOB(64k) and the distinct operator won't allow a CLOB, + // it wants shorter stuff like a varchar. + return " + SELECT + cols.default, + subq.* + FROM ( + SELECT DISTINCT + c.tabschema, + c.tabname, + c.colname, + c.colno, + c.typename, + c.codepage, + c.nulls, + c.length, + c.scale, + c.identity, + tc.type AS tabconsttype, + c.remarks AS comment, + k.colseq, + CASE + WHEN c.generated = 'D' THEN 1 + ELSE 0 + END AS autoincrement + FROM syscat.columns c + LEFT JOIN (syscat.keycoluse k JOIN syscat.tabconst tc + ON (k.tabschema = tc.tabschema + AND k.tabname = tc.tabname + AND tc.type = 'P')) + ON (c.tabschema = k.tabschema + AND c.tabname = k.tabname + AND c.colname = k.colname) + WHERE UPPER(c.tabname) = UPPER(" . $table . ') + ORDER BY c.colno + ) subq + JOIN syscat.columns cols + ON subq.tabschema = cols.tabschema + AND subq.tabname = cols.tabname + AND subq.colno = cols.colno + ORDER BY subq.colno + '; + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * {@inheritDoc} + */ + public function getListTablesSQL() + { + return "SELECT NAME FROM SYSIBM.SYSTABLES WHERE TYPE = 'T' AND CREATOR = CURRENT_USER"; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractSchemaManager} class hierarchy. + */ + public function getListViewsSQL($database) + { + return 'SELECT NAME, TEXT FROM SYSIBM.SYSVIEWS'; + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * {@inheritDoc} + */ + public function getListTableIndexesSQL($table, $database = null) + { + $table = $this->quoteStringLiteral($table); + + return "SELECT idx.INDNAME AS key_name, + idxcol.COLNAME AS column_name, + CASE + WHEN idx.UNIQUERULE = 'P' THEN 1 + ELSE 0 + END AS primary, + CASE + WHEN idx.UNIQUERULE = 'D' THEN 1 + ELSE 0 + END AS non_unique + FROM SYSCAT.INDEXES AS idx + JOIN SYSCAT.INDEXCOLUSE AS idxcol + ON idx.INDSCHEMA = idxcol.INDSCHEMA AND idx.INDNAME = idxcol.INDNAME + WHERE idx.TABNAME = UPPER(" . $table . ') + ORDER BY idxcol.COLSEQ ASC'; + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * {@inheritDoc} + */ + public function getListTableForeignKeysSQL($table) + { + $table = $this->quoteStringLiteral($table); + + return "SELECT fkcol.COLNAME AS local_column, + fk.REFTABNAME AS foreign_table, + pkcol.COLNAME AS foreign_column, + fk.CONSTNAME AS index_name, + CASE + WHEN fk.UPDATERULE = 'R' THEN 'RESTRICT' + ELSE NULL + END AS on_update, + CASE + WHEN fk.DELETERULE = 'C' THEN 'CASCADE' + WHEN fk.DELETERULE = 'N' THEN 'SET NULL' + WHEN fk.DELETERULE = 'R' THEN 'RESTRICT' + ELSE NULL + END AS on_delete + FROM SYSCAT.REFERENCES AS fk + JOIN SYSCAT.KEYCOLUSE AS fkcol + ON fk.CONSTNAME = fkcol.CONSTNAME + AND fk.TABSCHEMA = fkcol.TABSCHEMA + AND fk.TABNAME = fkcol.TABNAME + JOIN SYSCAT.KEYCOLUSE AS pkcol + ON fk.REFKEYNAME = pkcol.CONSTNAME + AND fk.REFTABSCHEMA = pkcol.TABSCHEMA + AND fk.REFTABNAME = pkcol.TABNAME + WHERE fk.TABNAME = UPPER(" . $table . ') + ORDER BY fkcol.COLSEQ ASC'; + } + + /** + * {@inheritDoc} + * + * @deprecated + */ + public function supportsCreateDropDatabase() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5513', + '%s is deprecated.', + __METHOD__, + ); + + return false; + } + + /** + * {@inheritdoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function supportsCommentOnStatement() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function getCurrentDateSQL() + { + return 'CURRENT DATE'; + } + + /** + * {@inheritDoc} + */ + public function getCurrentTimeSQL() + { + return 'CURRENT TIME'; + } + + /** + * {@inheritDoc} + */ + public function getCurrentTimestampSQL() + { + return 'CURRENT TIMESTAMP'; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function getIndexDeclarationSQL($name, Index $index) + { + // Index declaration in statements like CREATE TABLE is not supported. + throw Exception::notSupported(__METHOD__); + } + + /** + * {@inheritDoc} + */ + protected function _getCreateTableSQL($name, array $columns, array $options = []) + { + $indexes = []; + if (isset($options['indexes'])) { + $indexes = $options['indexes']; + } + + $options['indexes'] = []; + + $sqls = parent::_getCreateTableSQL($name, $columns, $options); + + foreach ($indexes as $definition) { + $sqls[] = $this->getCreateIndexSQL($definition, $name); + } + + return $sqls; + } + + /** + * {@inheritDoc} + */ + public function getAlterTableSQL(TableDiff $diff) + { + $sql = []; + $columnSql = []; + $commentsSQL = []; + + $tableNameSQL = ($diff->getOldTable() ?? $diff->getName($this))->getQuotedName($this); + + $queryParts = []; + foreach ($diff->getAddedColumns() as $column) { + if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { + continue; + } + + $columnDef = $column->toArray(); + $queryPart = 'ADD COLUMN ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnDef); + + // Adding non-nullable columns to a table requires a default value to be specified. + if ( + ! empty($columnDef['notnull']) && + ! isset($columnDef['default']) && + empty($columnDef['autoincrement']) + ) { + $queryPart .= ' WITH DEFAULT'; + } + + $queryParts[] = $queryPart; + + $comment = $this->getColumnComment($column); + + if ($comment === null || $comment === '') { + continue; + } + + $commentsSQL[] = $this->getCommentOnColumnSQL( + $tableNameSQL, + $column->getQuotedName($this), + $comment, + ); + } + + foreach ($diff->getDroppedColumns() as $column) { + if ($this->onSchemaAlterTableRemoveColumn($column, $diff, $columnSql)) { + continue; + } + + $queryParts[] = 'DROP COLUMN ' . $column->getQuotedName($this); + } + + foreach ($diff->getModifiedColumns() as $columnDiff) { + if ($this->onSchemaAlterTableChangeColumn($columnDiff, $diff, $columnSql)) { + continue; + } + + if ($columnDiff->hasCommentChanged()) { + $commentsSQL[] = $this->getCommentOnColumnSQL( + $tableNameSQL, + $columnDiff->getNewColumn()->getQuotedName($this), + $this->getColumnComment($columnDiff->getNewColumn()), + ); + } + + $this->gatherAlterColumnSQL( + $tableNameSQL, + $columnDiff, + $sql, + $queryParts, + ); + } + + foreach ($diff->getRenamedColumns() as $oldColumnName => $column) { + if ($this->onSchemaAlterTableRenameColumn($oldColumnName, $column, $diff, $columnSql)) { + continue; + } + + $oldColumnName = new Identifier($oldColumnName); + + $queryParts[] = 'RENAME COLUMN ' . $oldColumnName->getQuotedName($this) . + ' TO ' . $column->getQuotedName($this); + } + + $tableSql = []; + + if (! $this->onSchemaAlterTable($diff, $tableSql)) { + if (count($queryParts) > 0) { + $sql[] = 'ALTER TABLE ' . $tableNameSQL . ' ' . implode(' ', $queryParts); + } + + // Some table alteration operations require a table reorganization. + if (count($diff->getDroppedColumns()) > 0 || count($diff->getModifiedColumns()) > 0) { + $sql[] = "CALL SYSPROC.ADMIN_CMD ('REORG TABLE " . $tableNameSQL . "')"; + } + + $sql = array_merge($sql, $commentsSQL); + + $newName = $diff->getNewName(); + + if ($newName !== false) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5663', + 'Generation of "rename table" SQL using %s is deprecated. Use getRenameTableSQL() instead.', + __METHOD__, + ); + + $sql[] = sprintf( + 'RENAME TABLE %s TO %s', + $tableNameSQL, + $newName->getQuotedName($this), + ); + } + + $sql = array_merge( + $this->getPreAlterTableIndexForeignKeySQL($diff), + $sql, + $this->getPostAlterTableIndexForeignKeySQL($diff), + ); + } + + return array_merge($sql, $tableSql, $columnSql); + } + + /** + * {@inheritDoc} + */ + public function getRenameTableSQL(string $oldName, string $newName): array + { + return [ + sprintf('RENAME TABLE %s TO %s', $oldName, $newName), + ]; + } + + /** + * Gathers the table alteration SQL for a given column diff. + * + * @param string $table The table to gather the SQL for. + * @param ColumnDiff $columnDiff The column diff to evaluate. + * @param string[] $sql The sequence of table alteration statements to fill. + * @param mixed[] $queryParts The sequence of column alteration clauses to fill. + */ + private function gatherAlterColumnSQL( + string $table, + ColumnDiff $columnDiff, + array &$sql, + array &$queryParts + ): void { + $alterColumnClauses = $this->getAlterColumnClausesSQL($columnDiff); + + if (empty($alterColumnClauses)) { + return; + } + + // If we have a single column alteration, we can append the clause to the main query. + if (count($alterColumnClauses) === 1) { + $queryParts[] = current($alterColumnClauses); + + return; + } + + // We have multiple alterations for the same column, + // so we need to trigger a complete ALTER TABLE statement + // for each ALTER COLUMN clause. + foreach ($alterColumnClauses as $alterColumnClause) { + $sql[] = 'ALTER TABLE ' . $table . ' ' . $alterColumnClause; + } + } + + /** + * Returns the ALTER COLUMN SQL clauses for altering a column described by the given column diff. + * + * @return string[] + */ + private function getAlterColumnClausesSQL(ColumnDiff $columnDiff): array + { + $newColumn = $columnDiff->getNewColumn()->toArray(); + + $alterClause = 'ALTER COLUMN ' . $columnDiff->getNewColumn()->getQuotedName($this); + + if ($newColumn['columnDefinition'] !== null) { + return [$alterClause . ' ' . $newColumn['columnDefinition']]; + } + + $clauses = []; + + if ( + $columnDiff->hasTypeChanged() || + $columnDiff->hasLengthChanged() || + $columnDiff->hasPrecisionChanged() || + $columnDiff->hasScaleChanged() || + $columnDiff->hasFixedChanged() + ) { + $clauses[] = $alterClause . ' SET DATA TYPE ' . $newColumn['type']->getSQLDeclaration($newColumn, $this); + } + + if ($columnDiff->hasNotNullChanged()) { + $clauses[] = $newColumn['notnull'] ? $alterClause . ' SET NOT NULL' : $alterClause . ' DROP NOT NULL'; + } + + if ($columnDiff->hasDefaultChanged()) { + if (isset($newColumn['default'])) { + $defaultClause = $this->getDefaultValueDeclarationSQL($newColumn); + + if ($defaultClause !== '') { + $clauses[] = $alterClause . ' SET' . $defaultClause; + } + } else { + $clauses[] = $alterClause . ' DROP DEFAULT'; + } + } + + return $clauses; + } + + /** + * {@inheritDoc} + */ + protected function getPreAlterTableIndexForeignKeySQL(TableDiff $diff) + { + $sql = []; + + $tableNameSQL = ($diff->getOldTable() ?? $diff->getName($this))->getQuotedName($this); + + foreach ($diff->getDroppedIndexes() as $droppedIndex) { + foreach ($diff->getAddedIndexes() as $addedIndex) { + if ($droppedIndex->getColumns() !== $addedIndex->getColumns()) { + continue; + } + + if ($droppedIndex->isPrimary()) { + $sql[] = 'ALTER TABLE ' . $tableNameSQL . ' DROP PRIMARY KEY'; + } elseif ($droppedIndex->isUnique()) { + $sql[] = 'ALTER TABLE ' . $tableNameSQL . ' DROP UNIQUE ' . $droppedIndex->getQuotedName($this); + } else { + $sql[] = $this->getDropIndexSQL($droppedIndex, $tableNameSQL); + } + + $sql[] = $this->getCreateIndexSQL($addedIndex, $tableNameSQL); + + $diff->unsetAddedIndex($addedIndex); + $diff->unsetDroppedIndex($droppedIndex); + + break; + } + } + + return array_merge($sql, parent::getPreAlterTableIndexForeignKeySQL($diff)); + } + + /** + * {@inheritdoc} + */ + protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName) + { + if (strpos($tableName, '.') !== false) { + [$schema] = explode('.', $tableName); + $oldIndexName = $schema . '.' . $oldIndexName; + } + + return ['RENAME INDEX ' . $oldIndexName . ' TO ' . $index->getQuotedName($this)]; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function getDefaultValueDeclarationSQL($column) + { + if (! empty($column['autoincrement'])) { + return ''; + } + + if (! empty($column['version'])) { + if ((string) $column['type'] !== 'DateTime') { + $column['default'] = '1'; + } + } + + return parent::getDefaultValueDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + public function getEmptyIdentityInsertSQL($quotedTableName, $quotedIdentifierColumnName) + { + return 'INSERT INTO ' . $quotedTableName . ' (' . $quotedIdentifierColumnName . ') VALUES (DEFAULT)'; + } + + /** + * {@inheritDoc} + */ + public function getCreateTemporaryTableSnippetSQL() + { + return 'DECLARE GLOBAL TEMPORARY TABLE'; + } + + /** + * {@inheritDoc} + */ + public function getTemporaryTableName($tableName) + { + return 'SESSION.' . $tableName; + } + + /** + * {@inheritDoc} + */ + protected function doModifyLimitQuery($query, $limit, $offset) + { + $where = []; + + if ($offset > 0) { + $where[] = sprintf('db22.DC_ROWNUM >= %d', $offset + 1); + } + + if ($limit !== null) { + $where[] = sprintf('db22.DC_ROWNUM <= %d', $offset + $limit); + } + + if (empty($where)) { + return $query; + } + + // Todo OVER() needs ORDER BY data! + return sprintf( + 'SELECT db22.* FROM (SELECT db21.*, ROW_NUMBER() OVER() AS DC_ROWNUM FROM (%s) db21) db22 WHERE %s', + $query, + implode(' AND ', $where), + ); + } + + /** + * {@inheritDoc} + */ + public function getLocateExpression($str, $substr, $startPos = false) + { + if ($startPos === false) { + return 'LOCATE(' . $substr . ', ' . $str . ')'; + } + + return 'LOCATE(' . $substr . ', ' . $str . ', ' . $startPos . ')'; + } + + /** + * {@inheritDoc} + */ + public function getSubstringExpression($string, $start, $length = null) + { + if ($length === null) { + return 'SUBSTR(' . $string . ', ' . $start . ')'; + } + + return 'SUBSTR(' . $string . ', ' . $start . ', ' . $length . ')'; + } + + /** + * {@inheritDoc} + */ + public function getLengthExpression($column) + { + return 'LENGTH(' . $column . ', CODEUNITS32)'; + } + + public function getCurrentDatabaseExpression(): string + { + return 'CURRENT_USER'; + } + + /** + * {@inheritDoc} + */ + public function supportsIdentityColumns() + { + return true; + } + + /** + * {@inheritDoc} + * + * @deprecated + */ + public function prefersIdentityColumns() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/1519', + 'DB2Platform::prefersIdentityColumns() is deprecated.', + ); + + return true; + } + + /** + * {@inheritDoc} + */ + public function getForUpdateSQL() + { + return ' WITH RR USE AND KEEP UPDATE LOCKS'; + } + + /** + * {@inheritDoc} + */ + public function getDummySelectSQL() + { + $expression = func_num_args() > 0 ? func_get_arg(0) : '1'; + + return sprintf('SELECT %s FROM sysibm.sysdummy1', $expression); + } + + /** + * {@inheritDoc} + * + * DB2 supports savepoints, but they work semantically different than on other vendor platforms. + * + * TODO: We have to investigate how to get DB2 up and running with savepoints. + */ + public function supportsSavepoints() + { + return false; + } + + /** + * {@inheritDoc} + * + * @deprecated Implement {@see createReservedKeywordsList()} instead. + */ + protected function getReservedKeywordsClass() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4510', + 'DB2Platform::getReservedKeywordsClass() is deprecated,' + . ' use DB2Platform::createReservedKeywordsList() instead.', + ); + + return Keywords\DB2Keywords::class; + } + + /** @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. */ + public function getListTableCommentsSQL(string $table): string + { + return sprintf( + <<<'SQL' +SELECT REMARKS + FROM SYSIBM.SYSTABLES + WHERE NAME = UPPER( %s ) +SQL + , + $this->quoteStringLiteral($table), + ); + } + + public function createSchemaManager(Connection $connection): DB2SchemaManager + { + return new DB2SchemaManager($connection, $this); + } +} diff --git a/vendor/doctrine/dbal/src/Platforms/DateIntervalUnit.php b/vendor/doctrine/dbal/src/Platforms/DateIntervalUnit.php new file mode 100644 index 00000000..a95c4e28 --- /dev/null +++ b/vendor/doctrine/dbal/src/Platforms/DateIntervalUnit.php @@ -0,0 +1,29 @@ +keywords === null) { + $this->initializeKeywords(); + } + + return isset($this->keywords[strtoupper($word)]); + } + + /** @return void */ + protected function initializeKeywords() + { + $this->keywords = array_flip(array_map('strtoupper', $this->getKeywords())); + } + + /** + * Returns the list of keywords. + * + * @return string[] + */ + abstract protected function getKeywords(); + + /** + * Returns the name of this keyword list. + * + * @deprecated + * + * @return string + */ + abstract public function getName(); +} diff --git a/vendor/doctrine/dbal/src/Platforms/Keywords/MariaDBKeywords.php b/vendor/doctrine/dbal/src/Platforms/Keywords/MariaDBKeywords.php new file mode 100644 index 00000000..06c56125 --- /dev/null +++ b/vendor/doctrine/dbal/src/Platforms/Keywords/MariaDBKeywords.php @@ -0,0 +1,276 @@ +keywordLists = $keywordLists; + } + + /** @return string[] */ + public function getViolations() + { + return $this->violations; + } + + /** + * @param string $word + * + * @return string[] + */ + private function isReservedWord($word): array + { + if ($word[0] === '`') { + $word = str_replace('`', '', $word); + } + + $keywordLists = []; + foreach ($this->keywordLists as $keywordList) { + if (! $keywordList->isKeyword($word)) { + continue; + } + + $keywordLists[] = $keywordList->getName(); + } + + return $keywordLists; + } + + /** + * @param string $asset + * @param string[] $violatedPlatforms + */ + private function addViolation($asset, $violatedPlatforms): void + { + if (count($violatedPlatforms) === 0) { + return; + } + + $this->violations[] = $asset . ' keyword violations: ' . implode(', ', $violatedPlatforms); + } + + /** + * {@inheritdoc} + */ + public function acceptColumn(Table $table, Column $column) + { + $this->addViolation( + 'Table ' . $table->getName() . ' column ' . $column->getName(), + $this->isReservedWord($column->getName()), + ); + } + + /** + * {@inheritdoc} + */ + public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) + { + } + + /** + * {@inheritdoc} + */ + public function acceptIndex(Table $table, Index $index) + { + } + + /** + * {@inheritdoc} + */ + public function acceptSchema(Schema $schema) + { + } + + /** + * {@inheritdoc} + */ + public function acceptSequence(Sequence $sequence) + { + } + + /** + * {@inheritdoc} + */ + public function acceptTable(Table $table) + { + $this->addViolation( + 'Table ' . $table->getName(), + $this->isReservedWord($table->getName()), + ); + } +} diff --git a/vendor/doctrine/dbal/src/Platforms/Keywords/SQLServer2012Keywords.php b/vendor/doctrine/dbal/src/Platforms/Keywords/SQLServer2012Keywords.php new file mode 100644 index 00000000..ebc45c40 --- /dev/null +++ b/vendor/doctrine/dbal/src/Platforms/Keywords/SQLServer2012Keywords.php @@ -0,0 +1,12 @@ +doctrineTypeMapping['json'] = Types::JSON; + } +} diff --git a/vendor/doctrine/dbal/src/Platforms/MariaDb1027Platform.php b/vendor/doctrine/dbal/src/Platforms/MariaDb1027Platform.php new file mode 100644 index 00000000..93c7d348 --- /dev/null +++ b/vendor/doctrine/dbal/src/Platforms/MariaDb1027Platform.php @@ -0,0 +1,15 @@ + */ + private $cache = []; + + public function __construct(CollationMetadataProvider $collationMetadataProvider) + { + $this->collationMetadataProvider = $collationMetadataProvider; + } + + public function getCollationCharset(string $collation): ?string + { + if (array_key_exists($collation, $this->cache)) { + return $this->cache[$collation]; + } + + return $this->cache[$collation] = $this->collationMetadataProvider->getCollationCharset($collation); + } +} diff --git a/vendor/doctrine/dbal/src/Platforms/MySQL/CollationMetadataProvider/ConnectionCollationMetadataProvider.php b/vendor/doctrine/dbal/src/Platforms/MySQL/CollationMetadataProvider/ConnectionCollationMetadataProvider.php new file mode 100644 index 00000000..8dc2421a --- /dev/null +++ b/vendor/doctrine/dbal/src/Platforms/MySQL/CollationMetadataProvider/ConnectionCollationMetadataProvider.php @@ -0,0 +1,41 @@ +connection = $connection; + } + + /** @throws Exception */ + public function getCollationCharset(string $collation): ?string + { + $charset = $this->connection->fetchOne( + <<<'SQL' +SELECT CHARACTER_SET_NAME +FROM information_schema.COLLATIONS +WHERE COLLATION_NAME = ?; +SQL + , + [$collation], + ); + + if ($charset !== false) { + return $charset; + } + + return null; + } +} diff --git a/vendor/doctrine/dbal/src/Platforms/MySQL/Comparator.php b/vendor/doctrine/dbal/src/Platforms/MySQL/Comparator.php new file mode 100644 index 00000000..5951a574 --- /dev/null +++ b/vendor/doctrine/dbal/src/Platforms/MySQL/Comparator.php @@ -0,0 +1,85 @@ +collationMetadataProvider = $collationMetadataProvider; + } + + /** + * {@inheritDoc} + */ + public function diffTable(Table $fromTable, Table $toTable) + { + return parent::diffTable( + $this->normalizeColumns($fromTable), + $this->normalizeColumns($toTable), + ); + } + + private function normalizeColumns(Table $table): Table + { + $tableOptions = array_intersect_key($table->getOptions(), [ + 'charset' => null, + 'collation' => null, + ]); + + $table = clone $table; + + foreach ($table->getColumns() as $column) { + $originalOptions = $column->getPlatformOptions(); + $normalizedOptions = $this->normalizeOptions($originalOptions); + + $overrideOptions = array_diff_assoc($normalizedOptions, $tableOptions); + + if ($overrideOptions === $originalOptions) { + continue; + } + + $column->setPlatformOptions($overrideOptions); + } + + return $table; + } + + /** + * @param array $options + * + * @return array + */ + private function normalizeOptions(array $options): array + { + if (isset($options['collation']) && ! isset($options['charset'])) { + $charset = $this->collationMetadataProvider->getCollationCharset($options['collation']); + + if ($charset !== null) { + $options['charset'] = $charset; + } + } + + return $options; + } +} diff --git a/vendor/doctrine/dbal/src/Platforms/MySQL57Platform.php b/vendor/doctrine/dbal/src/Platforms/MySQL57Platform.php new file mode 100644 index 00000000..ea11ee63 --- /dev/null +++ b/vendor/doctrine/dbal/src/Platforms/MySQL57Platform.php @@ -0,0 +1,99 @@ +getQuotedName($this)]; + } + + /** + * {@inheritdoc} + * + * @deprecated Implement {@see createReservedKeywordsList()} instead. + */ + protected function getReservedKeywordsClass() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4510', + 'MySQL57Platform::getReservedKeywordsClass() is deprecated,' + . ' use MySQL57Platform::createReservedKeywordsList() instead.', + ); + + return Keywords\MySQL57Keywords::class; + } + + /** + * {@inheritdoc} + */ + protected function initializeDoctrineTypeMappings() + { + parent::initializeDoctrineTypeMappings(); + + $this->doctrineTypeMapping['json'] = Types::JSON; + } +} diff --git a/vendor/doctrine/dbal/src/Platforms/MySQL80Platform.php b/vendor/doctrine/dbal/src/Platforms/MySQL80Platform.php new file mode 100644 index 00000000..dd6599de --- /dev/null +++ b/vendor/doctrine/dbal/src/Platforms/MySQL80Platform.php @@ -0,0 +1,28 @@ +getBitAndComparisonExpression($value1, $value2) + . '+' . $value2 . ')'; + } + + /** + * {@inheritDoc} + */ + public function getCreatePrimaryKeySQL(Index $index, $table): string + { + if ($table instanceof Table) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $table as a Table object to %s is deprecated. Pass it as a quoted name instead.', + __METHOD__, + ); + + $table = $table->getQuotedName($this); + } + + return 'ALTER TABLE ' . $table . ' ADD CONSTRAINT ' . $index->getQuotedName($this) + . ' PRIMARY KEY (' . $this->getIndexFieldDeclarationListSQL($index) . ')'; + } + + /** + * {@inheritDoc} + * + * Need to specifiy minvalue, since start with is hidden in the system and MINVALUE <= START WITH. + * Therefore we can use MINVALUE to be able to get a hint what START WITH was for later introspection + * in {@see listSequences()} + */ + public function getCreateSequenceSQL(Sequence $sequence) + { + return 'CREATE SEQUENCE ' . $sequence->getQuotedName($this) . + ' START WITH ' . $sequence->getInitialValue() . + ' MINVALUE ' . $sequence->getInitialValue() . + ' INCREMENT BY ' . $sequence->getAllocationSize() . + $this->getSequenceCacheSQL($sequence); + } + + /** + * {@inheritDoc} + */ + public function getAlterSequenceSQL(Sequence $sequence) + { + return 'ALTER SEQUENCE ' . $sequence->getQuotedName($this) . + ' INCREMENT BY ' . $sequence->getAllocationSize() + . $this->getSequenceCacheSQL($sequence); + } + + /** + * Cache definition for sequences + */ + private function getSequenceCacheSQL(Sequence $sequence): string + { + if ($sequence->getCache() === 0) { + return ' NOCACHE'; + } + + if ($sequence->getCache() === 1) { + return ' NOCACHE'; + } + + if ($sequence->getCache() > 1) { + return ' CACHE ' . $sequence->getCache(); + } + + return ''; + } + + /** + * {@inheritDoc} + */ + public function getSequenceNextValSQL($sequence) + { + return 'SELECT ' . $sequence . '.nextval FROM DUAL'; + } + + /** + * {@inheritDoc} + */ + public function getSetTransactionIsolationSQL($level) + { + return 'SET TRANSACTION ISOLATION LEVEL ' . $this->_getTransactionIsolationLevelSQL($level); + } + + /** + * {@inheritDoc} + */ + protected function _getTransactionIsolationLevelSQL($level) + { + switch ($level) { + case TransactionIsolationLevel::READ_UNCOMMITTED: + return 'READ UNCOMMITTED'; + + case TransactionIsolationLevel::READ_COMMITTED: + return 'READ COMMITTED'; + + case TransactionIsolationLevel::REPEATABLE_READ: + case TransactionIsolationLevel::SERIALIZABLE: + return 'SERIALIZABLE'; + + default: + return parent::_getTransactionIsolationLevelSQL($level); + } + } + + /** + * {@inheritDoc} + */ + public function getBooleanTypeDeclarationSQL(array $column) + { + return 'NUMBER(1)'; + } + + /** + * {@inheritDoc} + */ + public function getIntegerTypeDeclarationSQL(array $column) + { + return 'NUMBER(10)'; + } + + /** + * {@inheritDoc} + */ + public function getBigIntTypeDeclarationSQL(array $column) + { + return 'NUMBER(20)'; + } + + /** + * {@inheritDoc} + */ + public function getSmallIntTypeDeclarationSQL(array $column) + { + return 'NUMBER(5)'; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeTypeDeclarationSQL(array $column) + { + return 'TIMESTAMP(0)'; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeTzTypeDeclarationSQL(array $column) + { + return 'TIMESTAMP(0) WITH TIME ZONE'; + } + + /** + * {@inheritDoc} + */ + public function getDateTypeDeclarationSQL(array $column) + { + return 'DATE'; + } + + /** + * {@inheritDoc} + */ + public function getTimeTypeDeclarationSQL(array $column) + { + return 'DATE'; + } + + /** + * {@inheritDoc} + */ + protected function _getCommonIntegerTypeDeclarationSQL(array $column) + { + return ''; + } + + /** + * {@inheritDoc} + */ + protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed/*, $lengthOmitted = false*/) + { + if ($length <= 0 || (func_num_args() > 2 && func_get_arg(2))) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3263', + 'Relying on the default string column length on Oracle is deprecated' + . ', specify the length explicitly.', + ); + } + + return $fixed ? ($length > 0 ? 'CHAR(' . $length . ')' : 'CHAR(2000)') + : ($length > 0 ? 'VARCHAR2(' . $length . ')' : 'VARCHAR2(4000)'); + } + + /** + * {@inheritdoc} + */ + protected function getBinaryTypeDeclarationSQLSnippet($length, $fixed/*, $lengthOmitted = false*/) + { + if ($length <= 0 || (func_num_args() > 2 && func_get_arg(2))) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3263', + 'Relying on the default binary column length on Oracle is deprecated' + . ', specify the length explicitly.', + ); + } + + return 'RAW(' . ($length > 0 ? $length : $this->getBinaryMaxLength()) . ')'; + } + + /** + * {@inheritdoc} + * + * @deprecated + */ + public function getBinaryMaxLength() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3263', + 'OraclePlatform::getBinaryMaxLength() is deprecated.', + ); + + return 2000; + } + + /** + * {@inheritDoc} + */ + public function getClobTypeDeclarationSQL(array $column) + { + return 'CLOB'; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractSchemaManager} class hierarchy. + */ + public function getListDatabasesSQL() + { + return 'SELECT username FROM all_users'; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractSchemaManager} class hierarchy. + */ + public function getListSequencesSQL($database) + { + $database = $this->normalizeIdentifier($database); + $database = $this->quoteStringLiteral($database->getName()); + + return 'SELECT sequence_name, min_value, increment_by FROM sys.all_sequences ' . + 'WHERE SEQUENCE_OWNER = ' . $database; + } + + /** + * {@inheritDoc} + */ + protected function _getCreateTableSQL($name, array $columns, array $options = []) + { + $indexes = $options['indexes'] ?? []; + $options['indexes'] = []; + $sql = parent::_getCreateTableSQL($name, $columns, $options); + + foreach ($columns as $columnName => $column) { + if (isset($column['sequence'])) { + $sql[] = $this->getCreateSequenceSQL($column['sequence']); + } + + if ( + ! isset($column['autoincrement']) || ! $column['autoincrement'] && + (! isset($column['autoinc']) || ! $column['autoinc']) + ) { + continue; + } + + $sql = array_merge($sql, $this->getCreateAutoincrementSql($columnName, $name)); + } + + foreach ($indexes as $index) { + $sql[] = $this->getCreateIndexSQL($index, $name); + } + + return $sql; + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * {@inheritDoc} + * + * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaOracleReader.html + */ + public function getListTableIndexesSQL($table, $database = null) + { + $table = $this->normalizeIdentifier($table); + $table = $this->quoteStringLiteral($table->getName()); + + return "SELECT uind_col.index_name AS name, + ( + SELECT uind.index_type + FROM user_indexes uind + WHERE uind.index_name = uind_col.index_name + ) AS type, + decode( + ( + SELECT uind.uniqueness + FROM user_indexes uind + WHERE uind.index_name = uind_col.index_name + ), + 'NONUNIQUE', + 0, + 'UNIQUE', + 1 + ) AS is_unique, + uind_col.column_name AS column_name, + uind_col.column_position AS column_pos, + ( + SELECT ucon.constraint_type + FROM user_constraints ucon + WHERE ucon.index_name = uind_col.index_name + AND ucon.table_name = uind_col.table_name + ) AS is_primary + FROM user_ind_columns uind_col + WHERE uind_col.table_name = " . $table . ' + ORDER BY uind_col.column_position ASC'; + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * {@inheritDoc} + */ + public function getListTablesSQL() + { + return 'SELECT * FROM sys.user_tables'; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractSchemaManager} class hierarchy. + */ + public function getListViewsSQL($database) + { + return 'SELECT view_name, text FROM sys.user_views'; + } + + /** + * @internal The method should be only used from within the OraclePlatform class hierarchy. + * + * @param string $name + * @param string $table + * @param int $start + * + * @return string[] + */ + public function getCreateAutoincrementSql($name, $table, $start = 1) + { + $tableIdentifier = $this->normalizeIdentifier($table); + $quotedTableName = $tableIdentifier->getQuotedName($this); + $unquotedTableName = $tableIdentifier->getName(); + + $nameIdentifier = $this->normalizeIdentifier($name); + $quotedName = $nameIdentifier->getQuotedName($this); + $unquotedName = $nameIdentifier->getName(); + + $sql = []; + + $autoincrementIdentifierName = $this->getAutoincrementIdentifierName($tableIdentifier); + + $idx = new Index($autoincrementIdentifierName, [$quotedName], true, true); + + $sql[] = "DECLARE + constraints_Count NUMBER; +BEGIN + SELECT COUNT(CONSTRAINT_NAME) INTO constraints_Count + FROM USER_CONSTRAINTS + WHERE TABLE_NAME = '" . $unquotedTableName . "' + AND CONSTRAINT_TYPE = 'P'; + IF constraints_Count = 0 OR constraints_Count = '' THEN + EXECUTE IMMEDIATE '" . $this->getCreateConstraintSQL($idx, $quotedTableName) . "'; + END IF; +END;"; + + $sequenceName = $this->getIdentitySequenceName( + $tableIdentifier->isQuoted() ? $quotedTableName : $unquotedTableName, + $nameIdentifier->isQuoted() ? $quotedName : $unquotedName, + ); + $sequence = new Sequence($sequenceName, $start); + $sql[] = $this->getCreateSequenceSQL($sequence); + + $sql[] = 'CREATE TRIGGER ' . $autoincrementIdentifierName . ' + BEFORE INSERT + ON ' . $quotedTableName . ' + FOR EACH ROW +DECLARE + last_Sequence NUMBER; + last_InsertID NUMBER; +BEGIN + IF (:NEW.' . $quotedName . ' IS NULL OR :NEW.' . $quotedName . ' = 0) THEN + SELECT ' . $sequenceName . '.NEXTVAL INTO :NEW.' . $quotedName . ' FROM DUAL; + ELSE + SELECT NVL(Last_Number, 0) INTO last_Sequence + FROM User_Sequences + WHERE Sequence_Name = \'' . $sequence->getName() . '\'; + SELECT :NEW.' . $quotedName . ' INTO last_InsertID FROM DUAL; + WHILE (last_InsertID > last_Sequence) LOOP + SELECT ' . $sequenceName . '.NEXTVAL INTO last_Sequence FROM DUAL; + END LOOP; + SELECT ' . $sequenceName . '.NEXTVAL INTO last_Sequence FROM DUAL; + END IF; +END;'; + + return $sql; + } + + /** + * @internal The method should be only used from within the OracleSchemaManager class hierarchy. + * + * Returns the SQL statements to drop the autoincrement for the given table name. + * + * @param string $table The table name to drop the autoincrement for. + * + * @return string[] + */ + public function getDropAutoincrementSql($table) + { + $table = $this->normalizeIdentifier($table); + $autoincrementIdentifierName = $this->getAutoincrementIdentifierName($table); + $identitySequenceName = $this->getIdentitySequenceName( + $table->isQuoted() ? $table->getQuotedName($this) : $table->getName(), + '', + ); + + return [ + 'DROP TRIGGER ' . $autoincrementIdentifierName, + $this->getDropSequenceSQL($identitySequenceName), + $this->getDropConstraintSQL($autoincrementIdentifierName, $table->getQuotedName($this)), + ]; + } + + /** + * Normalizes the given identifier. + * + * Uppercases the given identifier if it is not quoted by intention + * to reflect Oracle's internal auto uppercasing strategy of unquoted identifiers. + * + * @param string $name The identifier to normalize. + */ + private function normalizeIdentifier($name): Identifier + { + $identifier = new Identifier($name); + + return $identifier->isQuoted() ? $identifier : new Identifier(strtoupper($name)); + } + + /** + * Adds suffix to identifier, + * + * if the new string exceeds max identifier length, + * keeps $suffix, cuts from $identifier as much as the part exceeding. + */ + private function addSuffix(string $identifier, string $suffix): string + { + $maxPossibleLengthWithoutSuffix = $this->getMaxIdentifierLength() - strlen($suffix); + if (strlen($identifier) > $maxPossibleLengthWithoutSuffix) { + $identifier = substr($identifier, 0, $maxPossibleLengthWithoutSuffix); + } + + return $identifier . $suffix; + } + + /** + * Returns the autoincrement primary key identifier name for the given table identifier. + * + * Quotes the autoincrement primary key identifier name + * if the given table name is quoted by intention. + */ + private function getAutoincrementIdentifierName(Identifier $table): string + { + $identifierName = $this->addSuffix($table->getName(), '_AI_PK'); + + return $table->isQuoted() + ? $this->quoteSingleIdentifier($identifierName) + : $identifierName; + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * {@inheritDoc} + */ + public function getListTableForeignKeysSQL($table) + { + $table = $this->normalizeIdentifier($table); + $table = $this->quoteStringLiteral($table->getName()); + + return "SELECT alc.constraint_name, + alc.DELETE_RULE, + cols.column_name \"local_column\", + cols.position, + ( + SELECT r_cols.table_name + FROM user_cons_columns r_cols + WHERE alc.r_constraint_name = r_cols.constraint_name + AND r_cols.position = cols.position + ) AS \"references_table\", + ( + SELECT r_cols.column_name + FROM user_cons_columns r_cols + WHERE alc.r_constraint_name = r_cols.constraint_name + AND r_cols.position = cols.position + ) AS \"foreign_column\" + FROM user_cons_columns cols + JOIN user_constraints alc + ON alc.constraint_name = cols.constraint_name + AND alc.constraint_type = 'R' + AND alc.table_name = " . $table . ' + ORDER BY cols.constraint_name ASC, cols.position ASC'; + } + + /** + * @deprecated + * + * {@inheritDoc} + */ + public function getListTableConstraintsSQL($table) + { + $table = $this->normalizeIdentifier($table); + $table = $this->quoteStringLiteral($table->getName()); + + return 'SELECT * FROM user_constraints WHERE table_name = ' . $table; + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * {@inheritDoc} + */ + public function getListTableColumnsSQL($table, $database = null) + { + $table = $this->normalizeIdentifier($table); + $table = $this->quoteStringLiteral($table->getName()); + + $tabColumnsTableName = 'user_tab_columns'; + $colCommentsTableName = 'user_col_comments'; + $tabColumnsOwnerCondition = ''; + $colCommentsOwnerCondition = ''; + + if ($database !== null && $database !== '/') { + $database = $this->normalizeIdentifier($database); + $database = $this->quoteStringLiteral($database->getName()); + $tabColumnsTableName = 'all_tab_columns'; + $colCommentsTableName = 'all_col_comments'; + $tabColumnsOwnerCondition = ' AND c.owner = ' . $database; + $colCommentsOwnerCondition = ' AND d.OWNER = c.OWNER'; + } + + return sprintf( + <<<'SQL' +SELECT c.*, + ( + SELECT d.comments + FROM %s d + WHERE d.TABLE_NAME = c.TABLE_NAME%s + AND d.COLUMN_NAME = c.COLUMN_NAME + ) AS comments +FROM %s c +WHERE c.table_name = %s%s +ORDER BY c.column_id +SQL + , + $colCommentsTableName, + $colCommentsOwnerCondition, + $tabColumnsTableName, + $table, + $tabColumnsOwnerCondition, + ); + } + + /** + * {@inheritDoc} + */ + public function getDropForeignKeySQL($foreignKey, $table) + { + if ($foreignKey instanceof ForeignKeyConstraint) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $foreignKey as a ForeignKeyConstraint object to %s is deprecated.' + . ' Pass it as a quoted name instead.', + __METHOD__, + ); + } else { + $foreignKey = new Identifier($foreignKey); + } + + if ($table instanceof Table) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $table as a Table object to %s is deprecated. Pass it as a quoted name instead.', + __METHOD__, + ); + } else { + $table = new Identifier($table); + } + + $foreignKey = $foreignKey->getQuotedName($this); + $table = $table->getQuotedName($this); + + return 'ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $foreignKey; + } + + /** + * {@inheritdoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint $foreignKey) + { + $referentialAction = ''; + + if ($foreignKey->hasOption('onDelete')) { + $referentialAction = $this->getForeignKeyReferentialActionSQL($foreignKey->getOption('onDelete')); + } + + if ($referentialAction !== '') { + return ' ON DELETE ' . $referentialAction; + } + + return ''; + } + + /** + * {@inheritdoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function getForeignKeyReferentialActionSQL($action) + { + $action = strtoupper($action); + + switch ($action) { + case 'RESTRICT': // RESTRICT is not supported, therefore falling back to NO ACTION. + case 'NO ACTION': + // NO ACTION cannot be declared explicitly, + // therefore returning empty string to indicate to OMIT the referential clause. + return ''; + + case 'CASCADE': + case 'SET NULL': + return $action; + + default: + // SET DEFAULT is not supported, throw exception instead. + throw new InvalidArgumentException('Invalid foreign key action: ' . $action); + } + } + + /** + * {@inheritDoc} + */ + public function getCreateDatabaseSQL($name) + { + return 'CREATE USER ' . $name; + } + + /** + * {@inheritDoc} + */ + public function getDropDatabaseSQL($name) + { + return 'DROP USER ' . $name . ' CASCADE'; + } + + /** + * {@inheritDoc} + */ + public function getAlterTableSQL(TableDiff $diff) + { + $sql = []; + $commentsSQL = []; + $columnSql = []; + + $fields = []; + + $tableNameSQL = ($diff->getOldTable() ?? $diff->getName($this))->getQuotedName($this); + + foreach ($diff->getAddedColumns() as $column) { + if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { + continue; + } + + $fields[] = $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray()); + $comment = $this->getColumnComment($column); + + if ($comment === null || $comment === '') { + continue; + } + + $commentsSQL[] = $this->getCommentOnColumnSQL( + $tableNameSQL, + $column->getQuotedName($this), + $comment, + ); + } + + if (count($fields) > 0) { + $sql[] = 'ALTER TABLE ' . $tableNameSQL . ' ADD (' . implode(', ', $fields) . ')'; + } + + $fields = []; + foreach ($diff->getModifiedColumns() as $columnDiff) { + if ($this->onSchemaAlterTableChangeColumn($columnDiff, $diff, $columnSql)) { + continue; + } + + $newColumn = $columnDiff->getNewColumn(); + + // Do not generate column alteration clause if type is binary and only fixed property has changed. + // Oracle only supports binary type columns with variable length. + // Avoids unnecessary table alteration statements. + if ( + $newColumn->getType() instanceof BinaryType && + $columnDiff->hasFixedChanged() && + count($columnDiff->changedProperties) === 1 + ) { + continue; + } + + $columnHasChangedComment = $columnDiff->hasCommentChanged(); + + /** + * Do not add query part if only comment has changed + */ + if (! ($columnHasChangedComment && count($columnDiff->changedProperties) === 1)) { + $newColumnProperties = $newColumn->toArray(); + + if (! $columnDiff->hasNotNullChanged()) { + unset($newColumnProperties['notnull']); + } + + $fields[] = $newColumn->getQuotedName($this) . $this->getColumnDeclarationSQL('', $newColumnProperties); + } + + if (! $columnHasChangedComment) { + continue; + } + + $commentsSQL[] = $this->getCommentOnColumnSQL( + $tableNameSQL, + $newColumn->getQuotedName($this), + $this->getColumnComment($newColumn), + ); + } + + if (count($fields) > 0) { + $sql[] = 'ALTER TABLE ' . $tableNameSQL . ' MODIFY (' . implode(', ', $fields) . ')'; + } + + foreach ($diff->getRenamedColumns() as $oldColumnName => $column) { + if ($this->onSchemaAlterTableRenameColumn($oldColumnName, $column, $diff, $columnSql)) { + continue; + } + + $oldColumnName = new Identifier($oldColumnName); + + $sql[] = 'ALTER TABLE ' . $tableNameSQL . ' RENAME COLUMN ' . $oldColumnName->getQuotedName($this) + . ' TO ' . $column->getQuotedName($this); + } + + $fields = []; + foreach ($diff->getDroppedColumns() as $column) { + if ($this->onSchemaAlterTableRemoveColumn($column, $diff, $columnSql)) { + continue; + } + + $fields[] = $column->getQuotedName($this); + } + + if (count($fields) > 0) { + $sql[] = 'ALTER TABLE ' . $tableNameSQL . ' DROP (' . implode(', ', $fields) . ')'; + } + + $tableSql = []; + + if (! $this->onSchemaAlterTable($diff, $tableSql)) { + $sql = array_merge($sql, $commentsSQL); + + $newName = $diff->getNewName(); + + if ($newName !== false) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5663', + 'Generation of "rename table" SQL using %s is deprecated. Use getRenameTableSQL() instead.', + __METHOD__, + ); + + $sql[] = sprintf( + 'ALTER TABLE %s RENAME TO %s', + $tableNameSQL, + $newName->getQuotedName($this), + ); + } + + $sql = array_merge( + $this->getPreAlterTableIndexForeignKeySQL($diff), + $sql, + $this->getPostAlterTableIndexForeignKeySQL($diff), + ); + } + + return array_merge($sql, $tableSql, $columnSql); + } + + /** + * {@inheritdoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function getColumnDeclarationSQL($name, array $column) + { + if (isset($column['columnDefinition'])) { + $columnDef = $this->getCustomTypeDeclarationSQL($column); + } else { + $default = $this->getDefaultValueDeclarationSQL($column); + + $notnull = ''; + + if (isset($column['notnull'])) { + $notnull = $column['notnull'] ? ' NOT NULL' : ' NULL'; + } + + if (! empty($column['unique'])) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5656', + 'The usage of the "unique" column property is deprecated. Use unique constraints instead.', + ); + + $unique = ' ' . $this->getUniqueFieldDeclarationSQL(); + } else { + $unique = ''; + } + + if (! empty($column['check'])) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5656', + 'The usage of the "check" column property is deprecated.', + ); + + $check = ' ' . $column['check']; + } else { + $check = ''; + } + + $typeDecl = $column['type']->getSQLDeclaration($column, $this); + $columnDef = $typeDecl . $default . $notnull . $unique . $check; + } + + return $name . ' ' . $columnDef; + } + + /** + * {@inheritdoc} + */ + protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName) + { + if (strpos($tableName, '.') !== false) { + [$schema] = explode('.', $tableName); + $oldIndexName = $schema . '.' . $oldIndexName; + } + + return ['ALTER INDEX ' . $oldIndexName . ' RENAME TO ' . $index->getQuotedName($this)]; + } + + /** + * {@inheritdoc} + * + * @deprecated + */ + public function usesSequenceEmulatedIdentityColumns() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5513', + '%s is deprecated.', + __METHOD__, + ); + + return true; + } + + /** + * {@inheritdoc} + * + * @internal The method should be only used from within the OraclePlatform class hierarchy. + */ + public function getIdentitySequenceName($tableName, $columnName) + { + $table = new Identifier($tableName); + + // No usage of column name to preserve BC compatibility with <2.5 + $identitySequenceName = $this->addSuffix($table->getName(), '_SEQ'); + + if ($table->isQuoted()) { + $identitySequenceName = '"' . $identitySequenceName . '"'; + } + + $identitySequenceIdentifier = $this->normalizeIdentifier($identitySequenceName); + + return $identitySequenceIdentifier->getQuotedName($this); + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function supportsCommentOnStatement() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function getName() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4749', + 'OraclePlatform::getName() is deprecated. Identify platforms by their class.', + ); + + return 'oracle'; + } + + /** + * {@inheritDoc} + */ + protected function doModifyLimitQuery($query, $limit, $offset) + { + if ($limit === null && $offset <= 0) { + return $query; + } + + if (preg_match('/^\s*SELECT/i', $query) === 1) { + if (preg_match('/\sFROM\s/i', $query) === 0) { + $query .= ' FROM dual'; + } + + $columns = ['a.*']; + + if ($offset > 0) { + $columns[] = 'ROWNUM AS doctrine_rownum'; + } + + $query = sprintf('SELECT %s FROM (%s) a', implode(', ', $columns), $query); + + if ($limit !== null) { + $query .= sprintf(' WHERE ROWNUM <= %d', $offset + $limit); + } + + if ($offset > 0) { + $query = sprintf('SELECT * FROM (%s) WHERE doctrine_rownum >= %d', $query, $offset + 1); + } + } + + return $query; + } + + /** + * {@inheritDoc} + */ + public function getCreateTemporaryTableSnippetSQL() + { + return 'CREATE GLOBAL TEMPORARY TABLE'; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeTzFormatString() + { + return 'Y-m-d H:i:sP'; + } + + /** + * {@inheritDoc} + */ + public function getDateFormatString() + { + return 'Y-m-d 00:00:00'; + } + + /** + * {@inheritDoc} + */ + public function getTimeFormatString() + { + return '1900-01-01 H:i:s'; + } + + /** + * {@inheritDoc} + */ + public function getMaxIdentifierLength() + { + return 30; + } + + /** + * {@inheritDoc} + */ + public function supportsSequences() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function supportsReleaseSavepoints() + { + return false; + } + + /** + * {@inheritDoc} + */ + public function getTruncateTableSQL($tableName, $cascade = false) + { + $tableIdentifier = new Identifier($tableName); + + return 'TRUNCATE TABLE ' . $tableIdentifier->getQuotedName($this); + } + + /** + * {@inheritDoc} + */ + public function getDummySelectSQL() + { + $expression = func_num_args() > 0 ? func_get_arg(0) : '1'; + + return sprintf('SELECT %s FROM DUAL', $expression); + } + + /** + * {@inheritDoc} + */ + protected function initializeDoctrineTypeMappings() + { + $this->doctrineTypeMapping = [ + 'binary_double' => 'float', + 'binary_float' => 'float', + 'binary_integer' => 'boolean', + 'blob' => 'blob', + 'char' => 'string', + 'clob' => 'text', + 'date' => 'date', + 'float' => 'float', + 'integer' => 'integer', + 'long' => 'string', + 'long raw' => 'blob', + 'nchar' => 'string', + 'nclob' => 'text', + 'number' => 'integer', + 'nvarchar2' => 'string', + 'pls_integer' => 'boolean', + 'raw' => 'binary', + 'rowid' => 'string', + 'timestamp' => 'datetime', + 'timestamptz' => 'datetimetz', + 'urowid' => 'string', + 'varchar' => 'string', + 'varchar2' => 'string', + ]; + } + + /** + * {@inheritDoc} + */ + public function releaseSavePoint($savepoint) + { + return ''; + } + + /** + * {@inheritDoc} + * + * @deprecated Implement {@see createReservedKeywordsList()} instead. + */ + protected function getReservedKeywordsClass() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4510', + 'OraclePlatform::getReservedKeywordsClass() is deprecated,' + . ' use OraclePlatform::createReservedKeywordsList() instead.', + ); + + return Keywords\OracleKeywords::class; + } + + /** + * {@inheritDoc} + */ + public function getBlobTypeDeclarationSQL(array $column) + { + return 'BLOB'; + } + + /** @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. */ + public function getListTableCommentsSQL(string $table, ?string $database = null): string + { + $tableCommentsName = 'user_tab_comments'; + $ownerCondition = ''; + + if ($database !== null && $database !== '/') { + $tableCommentsName = 'all_tab_comments'; + $ownerCondition = ' AND owner = ' . $this->quoteStringLiteral( + $this->normalizeIdentifier($database)->getName(), + ); + } + + return sprintf( + <<<'SQL' +SELECT comments FROM %s WHERE table_name = %s%s +SQL + , + $tableCommentsName, + $this->quoteStringLiteral($this->normalizeIdentifier($table)->getName()), + $ownerCondition, + ); + } + + public function createSchemaManager(Connection $connection): OracleSchemaManager + { + return new OracleSchemaManager($connection, $this); + } +} diff --git a/vendor/doctrine/dbal/src/Platforms/PostgreSQL100Platform.php b/vendor/doctrine/dbal/src/Platforms/PostgreSQL100Platform.php new file mode 100644 index 00000000..aa023ba7 --- /dev/null +++ b/vendor/doctrine/dbal/src/Platforms/PostgreSQL100Platform.php @@ -0,0 +1,30 @@ + [ + 't', + 'true', + 'y', + 'yes', + 'on', + '1', + ], + 'false' => [ + 'f', + 'false', + 'n', + 'no', + 'off', + '0', + ], + ]; + + /** + * PostgreSQL has different behavior with some drivers + * with regard to how booleans have to be handled. + * + * Enables use of 'true'/'false' or otherwise 1 and 0 instead. + * + * @param bool $flag + * + * @return void + */ + public function setUseBooleanTrueFalseStrings($flag) + { + $this->useBooleanTrueFalseStrings = (bool) $flag; + } + + /** + * {@inheritDoc} + */ + public function getSubstringExpression($string, $start, $length = null) + { + if ($length === null) { + return 'SUBSTRING(' . $string . ' FROM ' . $start . ')'; + } + + return 'SUBSTRING(' . $string . ' FROM ' . $start . ' FOR ' . $length . ')'; + } + + /** + * {@inheritDoc} + * + * @deprecated Generate dates within the application. + */ + public function getNowExpression() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4753', + 'PostgreSQLPlatform::getNowExpression() is deprecated. Generate dates within the application.', + ); + + return 'LOCALTIMESTAMP(0)'; + } + + /** + * {@inheritDoc} + */ + public function getRegexpExpression() + { + return 'SIMILAR TO'; + } + + /** + * {@inheritDoc} + */ + public function getLocateExpression($str, $substr, $startPos = false) + { + if ($startPos !== false) { + $str = $this->getSubstringExpression($str, $startPos); + + return 'CASE WHEN (POSITION(' . $substr . ' IN ' . $str . ') = 0) THEN 0' + . ' ELSE (POSITION(' . $substr . ' IN ' . $str . ') + ' . $startPos . ' - 1) END'; + } + + return 'POSITION(' . $substr . ' IN ' . $str . ')'; + } + + /** + * {@inheritdoc} + */ + protected function getDateArithmeticIntervalExpression($date, $operator, $interval, $unit) + { + if ($unit === DateIntervalUnit::QUARTER) { + $interval *= 3; + $unit = DateIntervalUnit::MONTH; + } + + return '(' . $date . ' ' . $operator . ' (' . $interval . " || ' " . $unit . "')::interval)"; + } + + /** + * {@inheritDoc} + */ + public function getDateDiffExpression($date1, $date2) + { + return '(DATE(' . $date1 . ')-DATE(' . $date2 . '))'; + } + + public function getCurrentDatabaseExpression(): string + { + return 'CURRENT_DATABASE()'; + } + + /** + * {@inheritDoc} + */ + public function supportsSequences() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function supportsSchemas() + { + return true; + } + + /** + * {@inheritdoc} + * + * @deprecated + */ + public function getDefaultSchemaName() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5513', + '%s is deprecated.', + __METHOD__, + ); + + return 'public'; + } + + /** + * {@inheritDoc} + */ + public function supportsIdentityColumns() + { + return true; + } + + /** + * {@inheritdoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function supportsPartialIndexes() + { + return true; + } + + /** + * {@inheritdoc} + * + * @deprecated + */ + public function usesSequenceEmulatedIdentityColumns() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5513', + '%s is deprecated.', + __METHOD__, + ); + + return true; + } + + /** + * {@inheritdoc} + * + * @deprecated + */ + public function getIdentitySequenceName($tableName, $columnName) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5513', + '%s is deprecated.', + __METHOD__, + ); + + return $tableName . '_' . $columnName . '_seq'; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function supportsCommentOnStatement() + { + return true; + } + + /** + * {@inheritDoc} + * + * @deprecated + */ + public function hasNativeGuidType() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5509', + '%s is deprecated.', + __METHOD__, + ); + + return true; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractSchemaManager} class hierarchy. + */ + public function getListDatabasesSQL() + { + return 'SELECT datname FROM pg_database'; + } + + /** + * {@inheritDoc} + * + * @deprecated Use {@see PostgreSQLSchemaManager::listSchemaNames()} instead. + */ + public function getListNamespacesSQL() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4503', + 'PostgreSQLPlatform::getListNamespacesSQL() is deprecated,' + . ' use PostgreSQLSchemaManager::listSchemaNames() instead.', + ); + + return "SELECT schema_name AS nspname + FROM information_schema.schemata + WHERE schema_name NOT LIKE 'pg\_%' + AND schema_name != 'information_schema'"; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractSchemaManager} class hierarchy. + */ + public function getListSequencesSQL($database) + { + return 'SELECT sequence_name AS relname, + sequence_schema AS schemaname, + minimum_value AS min_value, + increment AS increment_by + FROM information_schema.sequences + WHERE sequence_catalog = ' . $this->quoteStringLiteral($database) . " + AND sequence_schema NOT LIKE 'pg\_%' + AND sequence_schema != 'information_schema'"; + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * {@inheritDoc} + */ + public function getListTablesSQL() + { + return "SELECT quote_ident(table_name) AS table_name, + table_schema AS schema_name + FROM information_schema.tables + WHERE table_schema NOT LIKE 'pg\_%' + AND table_schema != 'information_schema' + AND table_name != 'geometry_columns' + AND table_name != 'spatial_ref_sys' + AND table_type != 'VIEW'"; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractSchemaManager} class hierarchy. + */ + public function getListViewsSQL($database) + { + return 'SELECT quote_ident(table_name) AS viewname, + table_schema AS schemaname, + view_definition AS definition + FROM information_schema.views + WHERE view_definition IS NOT NULL'; + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * @param string $table + * @param string|null $database + * + * @return string + */ + public function getListTableForeignKeysSQL($table, $database = null) + { + return 'SELECT quote_ident(r.conname) as conname, pg_catalog.pg_get_constraintdef(r.oid, true) as condef + FROM pg_catalog.pg_constraint r + WHERE r.conrelid = + ( + SELECT c.oid + FROM pg_catalog.pg_class c, pg_catalog.pg_namespace n + WHERE ' . $this->getTableWhereClause($table) . " AND n.oid = c.relnamespace + ) + AND r.contype = 'f'"; + } + + /** + * @deprecated + * + * {@inheritDoc} + */ + public function getListTableConstraintsSQL($table) + { + $table = new Identifier($table); + $table = $this->quoteStringLiteral($table->getName()); + + return sprintf( + <<<'SQL' +SELECT + quote_ident(relname) as relname +FROM + pg_class +WHERE oid IN ( + SELECT indexrelid + FROM pg_index, pg_class + WHERE pg_class.relname = %s + AND pg_class.oid = pg_index.indrelid + AND (indisunique = 't' OR indisprimary = 't') + ) +SQL + , + $table, + ); + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * {@inheritDoc} + * + * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaPgsqlReader.html + */ + public function getListTableIndexesSQL($table, $database = null) + { + return 'SELECT quote_ident(relname) as relname, pg_index.indisunique, pg_index.indisprimary, + pg_index.indkey, pg_index.indrelid, + pg_get_expr(indpred, indrelid) AS where + FROM pg_class, pg_index + WHERE oid IN ( + SELECT indexrelid + FROM pg_index si, pg_class sc, pg_namespace sn + WHERE ' . $this->getTableWhereClause($table, 'sc', 'sn') . ' + AND sc.oid=si.indrelid AND sc.relnamespace = sn.oid + ) AND pg_index.indexrelid = oid'; + } + + /** + * @param string $table + * @param string $classAlias + * @param string $namespaceAlias + */ + private function getTableWhereClause($table, $classAlias = 'c', $namespaceAlias = 'n'): string + { + $whereClause = $namespaceAlias . ".nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast') AND "; + if (strpos($table, '.') !== false) { + [$schema, $table] = explode('.', $table); + $schema = $this->quoteStringLiteral($schema); + } else { + $schema = 'ANY(current_schemas(false))'; + } + + $table = new Identifier($table); + $table = $this->quoteStringLiteral($table->getName()); + + return $whereClause . sprintf( + '%s.relname = %s AND %s.nspname = %s', + $classAlias, + $table, + $namespaceAlias, + $schema, + ); + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * {@inheritDoc} + */ + public function getListTableColumnsSQL($table, $database = null) + { + return "SELECT + a.attnum, + quote_ident(a.attname) AS field, + t.typname AS type, + format_type(a.atttypid, a.atttypmod) AS complete_type, + (SELECT tc.collcollate FROM pg_catalog.pg_collation tc WHERE tc.oid = a.attcollation) AS collation, + (SELECT t1.typname FROM pg_catalog.pg_type t1 WHERE t1.oid = t.typbasetype) AS domain_type, + (SELECT format_type(t2.typbasetype, t2.typtypmod) FROM + pg_catalog.pg_type t2 WHERE t2.typtype = 'd' AND t2.oid = a.atttypid) AS domain_complete_type, + a.attnotnull AS isnotnull, + (SELECT 't' + FROM pg_index + WHERE c.oid = pg_index.indrelid + AND pg_index.indkey[0] = a.attnum + AND pg_index.indisprimary = 't' + ) AS pri, + (SELECT pg_get_expr(adbin, adrelid) + FROM pg_attrdef + WHERE c.oid = pg_attrdef.adrelid + AND pg_attrdef.adnum=a.attnum + ) AS default, + (SELECT pg_description.description + FROM pg_description WHERE pg_description.objoid = c.oid AND a.attnum = pg_description.objsubid + ) AS comment + FROM pg_attribute a, pg_class c, pg_type t, pg_namespace n + WHERE " . $this->getTableWhereClause($table, 'c', 'n') . ' + AND a.attnum > 0 + AND a.attrelid = c.oid + AND a.atttypid = t.oid + AND n.oid = c.relnamespace + ORDER BY a.attnum'; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint $foreignKey) + { + $query = ''; + + if ($foreignKey->hasOption('match')) { + $query .= ' MATCH ' . $foreignKey->getOption('match'); + } + + $query .= parent::getAdvancedForeignKeyOptionsSQL($foreignKey); + + if ($foreignKey->hasOption('deferrable') && $foreignKey->getOption('deferrable') !== false) { + $query .= ' DEFERRABLE'; + } else { + $query .= ' NOT DEFERRABLE'; + } + + if ( + ($foreignKey->hasOption('feferred') && $foreignKey->getOption('feferred') !== false) + || ($foreignKey->hasOption('deferred') && $foreignKey->getOption('deferred') !== false) + ) { + $query .= ' INITIALLY DEFERRED'; + } else { + $query .= ' INITIALLY IMMEDIATE'; + } + + return $query; + } + + /** + * {@inheritDoc} + */ + public function getAlterTableSQL(TableDiff $diff) + { + $sql = []; + $commentsSQL = []; + $columnSql = []; + + $table = $diff->getOldTable() ?? $diff->getName($this); + + $tableNameSQL = $table->getQuotedName($this); + + foreach ($diff->getAddedColumns() as $addedColumn) { + if ($this->onSchemaAlterTableAddColumn($addedColumn, $diff, $columnSql)) { + continue; + } + + $query = 'ADD ' . $this->getColumnDeclarationSQL( + $addedColumn->getQuotedName($this), + $addedColumn->toArray(), + ); + + $sql[] = 'ALTER TABLE ' . $tableNameSQL . ' ' . $query; + + $comment = $this->getColumnComment($addedColumn); + + if ($comment === null || $comment === '') { + continue; + } + + $commentsSQL[] = $this->getCommentOnColumnSQL( + $tableNameSQL, + $addedColumn->getQuotedName($this), + $comment, + ); + } + + foreach ($diff->getDroppedColumns() as $droppedColumn) { + if ($this->onSchemaAlterTableRemoveColumn($droppedColumn, $diff, $columnSql)) { + continue; + } + + $query = 'DROP ' . $droppedColumn->getQuotedName($this); + $sql[] = 'ALTER TABLE ' . $tableNameSQL . ' ' . $query; + } + + foreach ($diff->getModifiedColumns() as $columnDiff) { + if ($this->onSchemaAlterTableChangeColumn($columnDiff, $diff, $columnSql)) { + continue; + } + + if ($this->isUnchangedBinaryColumn($columnDiff)) { + continue; + } + + $oldColumn = $columnDiff->getOldColumn() ?? $columnDiff->getOldColumnName(); + $newColumn = $columnDiff->getNewColumn(); + + $oldColumnName = $oldColumn->getQuotedName($this); + + if ( + $columnDiff->hasTypeChanged() + || $columnDiff->hasPrecisionChanged() + || $columnDiff->hasScaleChanged() + || $columnDiff->hasFixedChanged() + ) { + $type = $newColumn->getType(); + + // SERIAL/BIGSERIAL are not "real" types and we can't alter a column to that type + $columnDefinition = $newColumn->toArray(); + $columnDefinition['autoincrement'] = false; + + // here was a server version check before, but DBAL API does not support this anymore. + $query = 'ALTER ' . $oldColumnName . ' TYPE ' . $type->getSQLDeclaration($columnDefinition, $this); + $sql[] = 'ALTER TABLE ' . $tableNameSQL . ' ' . $query; + } + + if ($columnDiff->hasDefaultChanged()) { + $defaultClause = $newColumn->getDefault() === null + ? ' DROP DEFAULT' + : ' SET' . $this->getDefaultValueDeclarationSQL($newColumn->toArray()); + + $query = 'ALTER ' . $oldColumnName . $defaultClause; + $sql[] = 'ALTER TABLE ' . $tableNameSQL . ' ' . $query; + } + + if ($columnDiff->hasNotNullChanged()) { + $query = 'ALTER ' . $oldColumnName . ' ' . ($newColumn->getNotnull() ? 'SET' : 'DROP') . ' NOT NULL'; + $sql[] = 'ALTER TABLE ' . $tableNameSQL . ' ' . $query; + } + + if ($columnDiff->hasAutoIncrementChanged()) { + if ($newColumn->getAutoincrement()) { + // add autoincrement + $seqName = $this->getIdentitySequenceName( + $table->getName(), + $oldColumnName, + ); + + $sql[] = 'CREATE SEQUENCE ' . $seqName; + $sql[] = "SELECT setval('" . $seqName . "', (SELECT MAX(" . $oldColumnName . ') FROM ' + . $tableNameSQL . '))'; + $query = 'ALTER ' . $oldColumnName . " SET DEFAULT nextval('" . $seqName . "')"; + } else { + // Drop autoincrement, but do NOT drop the sequence. It might be re-used by other tables or have + $query = 'ALTER ' . $oldColumnName . ' DROP DEFAULT'; + } + + $sql[] = 'ALTER TABLE ' . $tableNameSQL . ' ' . $query; + } + + $oldComment = $this->getOldColumnComment($columnDiff); + $newComment = $this->getColumnComment($newColumn); + + if ( + $columnDiff->hasCommentChanged() + || ($columnDiff->getOldColumn() !== null && $oldComment !== $newComment) + ) { + $commentsSQL[] = $this->getCommentOnColumnSQL( + $tableNameSQL, + $newColumn->getQuotedName($this), + $newComment, + ); + } + + if (! $columnDiff->hasLengthChanged()) { + continue; + } + + $query = 'ALTER ' . $oldColumnName . ' TYPE ' + . $newColumn->getType()->getSQLDeclaration($newColumn->toArray(), $this); + $sql[] = 'ALTER TABLE ' . $tableNameSQL . ' ' . $query; + } + + foreach ($diff->getRenamedColumns() as $oldColumnName => $column) { + if ($this->onSchemaAlterTableRenameColumn($oldColumnName, $column, $diff, $columnSql)) { + continue; + } + + $oldColumnName = new Identifier($oldColumnName); + + $sql[] = 'ALTER TABLE ' . $tableNameSQL . ' RENAME COLUMN ' . $oldColumnName->getQuotedName($this) + . ' TO ' . $column->getQuotedName($this); + } + + $tableSql = []; + + if (! $this->onSchemaAlterTable($diff, $tableSql)) { + $sql = array_merge($sql, $commentsSQL); + + $newName = $diff->getNewName(); + + if ($newName !== false) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5663', + 'Generation of "rename table" SQL using %s is deprecated. Use getRenameTableSQL() instead.', + __METHOD__, + ); + + $sql[] = sprintf( + 'ALTER TABLE %s RENAME TO %s', + $tableNameSQL, + $newName->getQuotedName($this), + ); + } + + $sql = array_merge( + $this->getPreAlterTableIndexForeignKeySQL($diff), + $sql, + $this->getPostAlterTableIndexForeignKeySQL($diff), + ); + } + + return array_merge($sql, $tableSql, $columnSql); + } + + /** + * Checks whether a given column diff is a logically unchanged binary type column. + * + * Used to determine whether a column alteration for a binary type column can be skipped. + * Doctrine's {@see BinaryType} and {@see BlobType} are mapped to the same database column type on this platform + * as this platform does not have a native VARBINARY/BINARY column type. Therefore the comparator + * might detect differences for binary type columns which do not have to be propagated + * to database as there actually is no difference at database level. + */ + private function isUnchangedBinaryColumn(ColumnDiff $columnDiff): bool + { + $newColumnType = $columnDiff->getNewColumn()->getType(); + + if (! $newColumnType instanceof BinaryType && ! $newColumnType instanceof BlobType) { + return false; + } + + $oldColumn = $columnDiff->getOldColumn() instanceof Column ? $columnDiff->getOldColumn() : null; + + if ($oldColumn !== null) { + $oldColumnType = $oldColumn->getType(); + + if (! $oldColumnType instanceof BinaryType && ! $oldColumnType instanceof BlobType) { + return false; + } + + return count(array_diff($columnDiff->changedProperties, ['type', 'length', 'fixed'])) === 0; + } + + if ($columnDiff->hasTypeChanged()) { + return false; + } + + return count(array_diff($columnDiff->changedProperties, ['length', 'fixed'])) === 0; + } + + /** + * {@inheritdoc} + */ + protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName) + { + if (strpos($tableName, '.') !== false) { + [$schema] = explode('.', $tableName); + $oldIndexName = $schema . '.' . $oldIndexName; + } + + return ['ALTER INDEX ' . $oldIndexName . ' RENAME TO ' . $index->getQuotedName($this)]; + } + + /** + * {@inheritdoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function getCommentOnColumnSQL($tableName, $columnName, $comment) + { + $tableName = new Identifier($tableName); + $columnName = new Identifier($columnName); + $comment = $comment === null ? 'NULL' : $this->quoteStringLiteral($comment); + + return sprintf( + 'COMMENT ON COLUMN %s.%s IS %s', + $tableName->getQuotedName($this), + $columnName->getQuotedName($this), + $comment, + ); + } + + /** + * {@inheritDoc} + */ + public function getCreateSequenceSQL(Sequence $sequence) + { + return 'CREATE SEQUENCE ' . $sequence->getQuotedName($this) . + ' INCREMENT BY ' . $sequence->getAllocationSize() . + ' MINVALUE ' . $sequence->getInitialValue() . + ' START ' . $sequence->getInitialValue() . + $this->getSequenceCacheSQL($sequence); + } + + /** + * {@inheritDoc} + */ + public function getAlterSequenceSQL(Sequence $sequence) + { + return 'ALTER SEQUENCE ' . $sequence->getQuotedName($this) . + ' INCREMENT BY ' . $sequence->getAllocationSize() . + $this->getSequenceCacheSQL($sequence); + } + + /** + * Cache definition for sequences + */ + private function getSequenceCacheSQL(Sequence $sequence): string + { + if ($sequence->getCache() > 1) { + return ' CACHE ' . $sequence->getCache(); + } + + return ''; + } + + /** + * {@inheritDoc} + */ + public function getDropSequenceSQL($sequence) + { + return parent::getDropSequenceSQL($sequence) . ' CASCADE'; + } + + /** + * {@inheritDoc} + */ + public function getDropForeignKeySQL($foreignKey, $table) + { + return $this->getDropConstraintSQL($foreignKey, $table); + } + + /** + * {@inheritDoc} + */ + protected function _getCreateTableSQL($name, array $columns, array $options = []) + { + $queryFields = $this->getColumnDeclarationListSQL($columns); + + if (isset($options['primary']) && ! empty($options['primary'])) { + $keyColumns = array_unique(array_values($options['primary'])); + $queryFields .= ', PRIMARY KEY(' . implode(', ', $keyColumns) . ')'; + } + + $query = 'CREATE TABLE ' . $name . ' (' . $queryFields . ')'; + + $sql = [$query]; + + if (isset($options['indexes']) && ! empty($options['indexes'])) { + foreach ($options['indexes'] as $index) { + $sql[] = $this->getCreateIndexSQL($index, $name); + } + } + + if (isset($options['uniqueConstraints'])) { + foreach ($options['uniqueConstraints'] as $uniqueConstraint) { + $sql[] = $this->getCreateConstraintSQL($uniqueConstraint, $name); + } + } + + if (isset($options['foreignKeys'])) { + foreach ($options['foreignKeys'] as $definition) { + $sql[] = $this->getCreateForeignKeySQL($definition, $name); + } + } + + return $sql; + } + + /** + * Converts a single boolean value. + * + * First converts the value to its native PHP boolean type + * and passes it to the given callback function to be reconverted + * into any custom representation. + * + * @param mixed $value The value to convert. + * @param callable $callback The callback function to use for converting the real boolean value. + * + * @return mixed + * + * @throws UnexpectedValueException + */ + private function convertSingleBooleanValue($value, $callback) + { + if ($value === null) { + return $callback(null); + } + + if (is_bool($value) || is_numeric($value)) { + return $callback((bool) $value); + } + + if (! is_string($value)) { + return $callback(true); + } + + /** + * Better safe than sorry: http://php.net/in_array#106319 + */ + if (in_array(strtolower(trim($value)), $this->booleanLiterals['false'], true)) { + return $callback(false); + } + + if (in_array(strtolower(trim($value)), $this->booleanLiterals['true'], true)) { + return $callback(true); + } + + throw new UnexpectedValueException(sprintf("Unrecognized boolean literal '%s'", $value)); + } + + /** + * Converts one or multiple boolean values. + * + * First converts the value(s) to their native PHP boolean type + * and passes them to the given callback function to be reconverted + * into any custom representation. + * + * @param mixed $item The value(s) to convert. + * @param callable $callback The callback function to use for converting the real boolean value(s). + * + * @return mixed + */ + private function doConvertBooleans($item, $callback) + { + if (is_array($item)) { + foreach ($item as $key => $value) { + $item[$key] = $this->convertSingleBooleanValue($value, $callback); + } + + return $item; + } + + return $this->convertSingleBooleanValue($item, $callback); + } + + /** + * {@inheritDoc} + * + * Postgres wants boolean values converted to the strings 'true'/'false'. + */ + public function convertBooleans($item) + { + if (! $this->useBooleanTrueFalseStrings) { + return parent::convertBooleans($item); + } + + return $this->doConvertBooleans( + $item, + /** @param mixed $value */ + static function ($value) { + if ($value === null) { + return 'NULL'; + } + + return $value === true ? 'true' : 'false'; + }, + ); + } + + /** + * {@inheritDoc} + */ + public function convertBooleansToDatabaseValue($item) + { + if (! $this->useBooleanTrueFalseStrings) { + return parent::convertBooleansToDatabaseValue($item); + } + + return $this->doConvertBooleans( + $item, + /** @param mixed $value */ + static function ($value): ?int { + return $value === null ? null : (int) $value; + }, + ); + } + + /** + * {@inheritDoc} + */ + public function convertFromBoolean($item) + { + if ($item !== null && in_array(strtolower($item), $this->booleanLiterals['false'], true)) { + return false; + } + + return parent::convertFromBoolean($item); + } + + /** + * {@inheritDoc} + */ + public function getSequenceNextValSQL($sequence) + { + return "SELECT NEXTVAL('" . $sequence . "')"; + } + + /** + * {@inheritDoc} + */ + public function getSetTransactionIsolationSQL($level) + { + return 'SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL ' + . $this->_getTransactionIsolationLevelSQL($level); + } + + /** + * {@inheritDoc} + */ + public function getBooleanTypeDeclarationSQL(array $column) + { + return 'BOOLEAN'; + } + + /** + * {@inheritDoc} + */ + public function getIntegerTypeDeclarationSQL(array $column) + { + if (! empty($column['autoincrement'])) { + return 'SERIAL'; + } + + return 'INT'; + } + + /** + * {@inheritDoc} + */ + public function getBigIntTypeDeclarationSQL(array $column) + { + if (! empty($column['autoincrement'])) { + return 'BIGSERIAL'; + } + + return 'BIGINT'; + } + + /** + * {@inheritDoc} + */ + public function getSmallIntTypeDeclarationSQL(array $column) + { + if (! empty($column['autoincrement'])) { + return 'SMALLSERIAL'; + } + + return 'SMALLINT'; + } + + /** + * {@inheritDoc} + */ + public function getGuidTypeDeclarationSQL(array $column) + { + return 'UUID'; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeTypeDeclarationSQL(array $column) + { + return 'TIMESTAMP(0) WITHOUT TIME ZONE'; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeTzTypeDeclarationSQL(array $column) + { + return 'TIMESTAMP(0) WITH TIME ZONE'; + } + + /** + * {@inheritDoc} + */ + public function getDateTypeDeclarationSQL(array $column) + { + return 'DATE'; + } + + /** + * {@inheritDoc} + */ + public function getTimeTypeDeclarationSQL(array $column) + { + return 'TIME(0) WITHOUT TIME ZONE'; + } + + /** + * {@inheritDoc} + */ + protected function _getCommonIntegerTypeDeclarationSQL(array $column) + { + return ''; + } + + /** + * {@inheritDoc} + */ + protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed) + { + return $fixed ? ($length > 0 ? 'CHAR(' . $length . ')' : 'CHAR(255)') + : ($length > 0 ? 'VARCHAR(' . $length . ')' : 'VARCHAR(255)'); + } + + /** + * {@inheritdoc} + */ + protected function getBinaryTypeDeclarationSQLSnippet($length, $fixed) + { + return 'BYTEA'; + } + + /** + * {@inheritDoc} + */ + public function getClobTypeDeclarationSQL(array $column) + { + return 'TEXT'; + } + + /** + * {@inheritDoc} + */ + public function getName() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4749', + 'PostgreSQLPlatform::getName() is deprecated. Identify platforms by their class.', + ); + + return 'postgresql'; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeTzFormatString() + { + return 'Y-m-d H:i:sO'; + } + + /** + * {@inheritDoc} + */ + public function getEmptyIdentityInsertSQL($quotedTableName, $quotedIdentifierColumnName) + { + return 'INSERT INTO ' . $quotedTableName . ' (' . $quotedIdentifierColumnName . ') VALUES (DEFAULT)'; + } + + /** + * {@inheritDoc} + */ + public function getTruncateTableSQL($tableName, $cascade = false) + { + $tableIdentifier = new Identifier($tableName); + $sql = 'TRUNCATE ' . $tableIdentifier->getQuotedName($this); + + if ($cascade) { + $sql .= ' CASCADE'; + } + + return $sql; + } + + /** + * {@inheritDoc} + */ + public function getReadLockSQL() + { + return 'FOR SHARE'; + } + + /** + * {@inheritDoc} + */ + protected function initializeDoctrineTypeMappings() + { + $this->doctrineTypeMapping = [ + 'bigint' => 'bigint', + 'bigserial' => 'bigint', + 'bool' => 'boolean', + 'boolean' => 'boolean', + 'bpchar' => 'string', + 'bytea' => 'blob', + 'char' => 'string', + 'date' => 'date', + 'datetime' => 'datetime', + 'decimal' => 'decimal', + 'double' => 'float', + 'double precision' => 'float', + 'float' => 'float', + 'float4' => 'float', + 'float8' => 'float', + 'inet' => 'string', + 'int' => 'integer', + 'int2' => 'smallint', + 'int4' => 'integer', + 'int8' => 'bigint', + 'integer' => 'integer', + 'interval' => 'string', + 'json' => 'json', + 'jsonb' => 'json', + 'money' => 'decimal', + 'numeric' => 'decimal', + 'serial' => 'integer', + 'serial4' => 'integer', + 'serial8' => 'bigint', + 'real' => 'float', + 'smallint' => 'smallint', + 'text' => 'text', + 'time' => 'time', + 'timestamp' => 'datetime', + 'timestamptz' => 'datetimetz', + 'timetz' => 'time', + 'tsvector' => 'text', + 'uuid' => 'guid', + 'varchar' => 'string', + 'year' => 'date', + '_varchar' => 'string', + ]; + } + + /** + * {@inheritDoc} + * + * @deprecated + */ + public function getVarcharMaxLength() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3263', + 'PostgreSQLPlatform::getVarcharMaxLength() is deprecated.', + ); + + return 65535; + } + + /** + * {@inheritdoc} + */ + public function getBinaryMaxLength() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3263', + 'PostgreSQLPlatform::getBinaryMaxLength() is deprecated.', + ); + + return 0; + } + + /** + * {@inheritdoc} + * + * @deprecated + */ + public function getBinaryDefaultLength() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3263', + 'Relying on the default binary column length is deprecated, specify the length explicitly.', + ); + + return 0; + } + + /** + * {@inheritdoc} + * + * @deprecated + */ + public function hasNativeJsonType() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5509', + '%s is deprecated.', + __METHOD__, + ); + + return true; + } + + /** + * {@inheritDoc} + * + * @deprecated Implement {@see createReservedKeywordsList()} instead. + */ + protected function getReservedKeywordsClass() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4510', + 'PostgreSQLPlatform::getReservedKeywordsClass() is deprecated,' + . ' use PostgreSQLPlatform::createReservedKeywordsList() instead.', + ); + + return Keywords\PostgreSQL94Keywords::class; + } + + /** + * {@inheritDoc} + */ + public function getBlobTypeDeclarationSQL(array $column) + { + return 'BYTEA'; + } + + /** + * {@inheritdoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function getDefaultValueDeclarationSQL($column) + { + if (isset($column['autoincrement']) && $column['autoincrement'] === true) { + return ''; + } + + return parent::getDefaultValueDeclarationSQL($column); + } + + /** + * {@inheritdoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function supportsColumnCollation() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function getJsonTypeDeclarationSQL(array $column) + { + if (! empty($column['jsonb'])) { + return 'JSONB'; + } + + return 'JSON'; + } + + private function getOldColumnComment(ColumnDiff $columnDiff): ?string + { + $oldColumn = $columnDiff->getOldColumn(); + + if ($oldColumn !== null) { + return $this->getColumnComment($oldColumn); + } + + return null; + } + + /** @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. */ + public function getListTableMetadataSQL(string $table, ?string $schema = null): string + { + if ($schema !== null) { + $table = $schema . '.' . $table; + } + + return sprintf( + <<<'SQL' +SELECT obj_description(%s::regclass) AS table_comment; +SQL + , + $this->quoteStringLiteral($table), + ); + } + + public function createSchemaManager(Connection $connection): PostgreSQLSchemaManager + { + return new PostgreSQLSchemaManager($connection, $this); + } +} diff --git a/vendor/doctrine/dbal/src/Platforms/SQLServer/Comparator.php b/vendor/doctrine/dbal/src/Platforms/SQLServer/Comparator.php new file mode 100644 index 00000000..e231e808 --- /dev/null +++ b/vendor/doctrine/dbal/src/Platforms/SQLServer/Comparator.php @@ -0,0 +1,53 @@ +databaseCollation = $databaseCollation; + } + + /** + * {@inheritDoc} + */ + public function diffTable(Table $fromTable, Table $toTable) + { + $fromTable = clone $fromTable; + $toTable = clone $toTable; + + $this->normalizeColumns($fromTable); + $this->normalizeColumns($toTable); + + return parent::diffTable($fromTable, $toTable); + } + + private function normalizeColumns(Table $table): void + { + foreach ($table->getColumns() as $column) { + $options = $column->getPlatformOptions(); + + if (! isset($options['collation']) || $options['collation'] !== $this->databaseCollation) { + continue; + } + + unset($options['collation']); + $column->setPlatformOptions($options); + } + } +} diff --git a/vendor/doctrine/dbal/src/Platforms/SQLServer2012Platform.php b/vendor/doctrine/dbal/src/Platforms/SQLServer2012Platform.php new file mode 100644 index 00000000..a8ba2fa0 --- /dev/null +++ b/vendor/doctrine/dbal/src/Platforms/SQLServer2012Platform.php @@ -0,0 +1,13 @@ +getConvertExpression('date', 'GETDATE()'); + } + + /** + * {@inheritdoc} + */ + public function getCurrentTimeSQL() + { + return $this->getConvertExpression('time', 'GETDATE()'); + } + + /** + * Returns an expression that converts an expression of one data type to another. + * + * @param string $dataType The target native data type. Alias data types cannot be used. + * @param string $expression The SQL expression to convert. + */ + private function getConvertExpression($dataType, $expression): string + { + return sprintf('CONVERT(%s, %s)', $dataType, $expression); + } + + /** + * {@inheritdoc} + */ + protected function getDateArithmeticIntervalExpression($date, $operator, $interval, $unit) + { + $factorClause = ''; + + if ($operator === '-') { + $factorClause = '-1 * '; + } + + return 'DATEADD(' . $unit . ', ' . $factorClause . $interval . ', ' . $date . ')'; + } + + /** + * {@inheritDoc} + */ + public function getDateDiffExpression($date1, $date2) + { + return 'DATEDIFF(day, ' . $date2 . ',' . $date1 . ')'; + } + + /** + * {@inheritDoc} + * + * Microsoft SQL Server prefers "autoincrement" identity columns + * since sequences can only be emulated with a table. + * + * @deprecated + */ + public function prefersIdentityColumns() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/1519', + 'SQLServerPlatform::prefersIdentityColumns() is deprecated.', + ); + + return true; + } + + /** + * {@inheritDoc} + * + * Microsoft SQL Server supports this through AUTO_INCREMENT columns. + */ + public function supportsIdentityColumns() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function supportsReleaseSavepoints() + { + return false; + } + + /** + * {@inheritdoc} + */ + public function supportsSchemas() + { + return true; + } + + /** + * {@inheritdoc} + * + * @deprecated + */ + public function getDefaultSchemaName() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5513', + '%s is deprecated.', + __METHOD__, + ); + + return 'dbo'; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function supportsColumnCollation() + { + return true; + } + + public function supportsSequences(): bool + { + return true; + } + + public function getAlterSequenceSQL(Sequence $sequence): string + { + return 'ALTER SEQUENCE ' . $sequence->getQuotedName($this) . + ' INCREMENT BY ' . $sequence->getAllocationSize(); + } + + public function getCreateSequenceSQL(Sequence $sequence): string + { + return 'CREATE SEQUENCE ' . $sequence->getQuotedName($this) . + ' START WITH ' . $sequence->getInitialValue() . + ' INCREMENT BY ' . $sequence->getAllocationSize() . + ' MINVALUE ' . $sequence->getInitialValue(); + } + + /** + * {@inheritdoc} + * + * @internal The method should be only used from within the {@see AbstractSchemaManager} class hierarchy. + */ + public function getListSequencesSQL($database) + { + return 'SELECT seq.name, + CAST( + seq.increment AS VARCHAR(MAX) + ) AS increment, -- CAST avoids driver error for sql_variant type + CAST( + seq.start_value AS VARCHAR(MAX) + ) AS start_value -- CAST avoids driver error for sql_variant type + FROM sys.sequences AS seq'; + } + + /** + * {@inheritdoc} + */ + public function getSequenceNextValSQL($sequence) + { + return 'SELECT NEXT VALUE FOR ' . $sequence; + } + + /** + * {@inheritDoc} + * + * @deprecated + */ + public function hasNativeGuidType() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5509', + '%s is deprecated.', + __METHOD__, + ); + + return true; + } + + /** + * {@inheritDoc} + */ + public function getDropForeignKeySQL($foreignKey, $table) + { + if (! $foreignKey instanceof ForeignKeyConstraint) { + $foreignKey = new Identifier($foreignKey); + } + + if (! $table instanceof Table) { + $table = new Identifier($table); + } + + $foreignKey = $foreignKey->getQuotedName($this); + $table = $table->getQuotedName($this); + + return 'ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $foreignKey; + } + + /** + * {@inheritDoc} + */ + public function getDropIndexSQL($index, $table = null) + { + if ($index instanceof Index) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $index as an Index object to %s is deprecated. Pass it as a quoted name instead.', + __METHOD__, + ); + + $index = $index->getQuotedName($this); + } elseif (! is_string($index)) { + throw new InvalidArgumentException( + __METHOD__ . '() expects $index parameter to be string or ' . Index::class . '.', + ); + } + + if ($table instanceof Table) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $table as an Table object to %s is deprecated. Pass it as a quoted name instead.', + __METHOD__, + ); + + $table = $table->getQuotedName($this); + } elseif (! is_string($table)) { + throw new InvalidArgumentException( + __METHOD__ . '() expects $table parameter to be string or ' . Table::class . '.', + ); + } + + return 'DROP INDEX ' . $index . ' ON ' . $table; + } + + /** + * {@inheritDoc} + */ + protected function _getCreateTableSQL($name, array $columns, array $options = []) + { + $defaultConstraintsSql = []; + $commentsSql = []; + + $tableComment = $options['comment'] ?? null; + if ($tableComment !== null) { + $commentsSql[] = $this->getCommentOnTableSQL($name, $tableComment); + } + + // @todo does other code breaks because of this? + // force primary keys to be not null + foreach ($columns as &$column) { + if (! empty($column['primary'])) { + $column['notnull'] = true; + } + + // Build default constraints SQL statements. + if (isset($column['default'])) { + $defaultConstraintsSql[] = 'ALTER TABLE ' . $name . + ' ADD' . $this->getDefaultConstraintDeclarationSQL($name, $column); + } + + if (empty($column['comment']) && ! is_numeric($column['comment'])) { + continue; + } + + $commentsSql[] = $this->getCreateColumnCommentSQL($name, $column['name'], $column['comment']); + } + + $columnListSql = $this->getColumnDeclarationListSQL($columns); + + if (isset($options['uniqueConstraints']) && ! empty($options['uniqueConstraints'])) { + foreach ($options['uniqueConstraints'] as $constraintName => $definition) { + $columnListSql .= ', ' . $this->getUniqueConstraintDeclarationSQL($constraintName, $definition); + } + } + + if (isset($options['primary']) && ! empty($options['primary'])) { + $flags = ''; + if (isset($options['primary_index']) && $options['primary_index']->hasFlag('nonclustered')) { + $flags = ' NONCLUSTERED'; + } + + $columnListSql .= ', PRIMARY KEY' . $flags + . ' (' . implode(', ', array_unique(array_values($options['primary']))) . ')'; + } + + $query = 'CREATE TABLE ' . $name . ' (' . $columnListSql; + + $check = $this->getCheckDeclarationSQL($columns); + if (! empty($check)) { + $query .= ', ' . $check; + } + + $query .= ')'; + + $sql = [$query]; + + if (isset($options['indexes']) && ! empty($options['indexes'])) { + foreach ($options['indexes'] as $index) { + $sql[] = $this->getCreateIndexSQL($index, $name); + } + } + + if (isset($options['foreignKeys'])) { + foreach ($options['foreignKeys'] as $definition) { + $sql[] = $this->getCreateForeignKeySQL($definition, $name); + } + } + + return array_merge($sql, $commentsSql, $defaultConstraintsSql); + } + + /** + * {@inheritDoc} + */ + public function getCreatePrimaryKeySQL(Index $index, $table) + { + if ($table instanceof Table) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $table as a Table object to %s is deprecated. Pass it as a quoted name instead.', + __METHOD__, + ); + + $identifier = $table->getQuotedName($this); + } else { + $identifier = $table; + } + + $sql = 'ALTER TABLE ' . $identifier . ' ADD PRIMARY KEY'; + + if ($index->hasFlag('nonclustered')) { + $sql .= ' NONCLUSTERED'; + } + + return $sql . ' (' . $this->getIndexFieldDeclarationListSQL($index) . ')'; + } + + /** + * Returns the SQL statement for creating a column comment. + * + * SQL Server does not support native column comments, + * therefore the extended properties functionality is used + * as a workaround to store them. + * The property name used to store column comments is "MS_Description" + * which provides compatibility with SQL Server Management Studio, + * as column comments are stored in the same property there when + * specifying a column's "Description" attribute. + * + * @param string $tableName The quoted table name to which the column belongs. + * @param string $columnName The quoted column name to create the comment for. + * @param string|null $comment The column's comment. + * + * @return string + */ + protected function getCreateColumnCommentSQL($tableName, $columnName, $comment) + { + if (strpos($tableName, '.') !== false) { + [$schemaSQL, $tableSQL] = explode('.', $tableName); + $schemaSQL = $this->quoteStringLiteral($schemaSQL); + $tableSQL = $this->quoteStringLiteral($tableSQL); + } else { + $schemaSQL = "'dbo'"; + $tableSQL = $this->quoteStringLiteral($tableName); + } + + return $this->getAddExtendedPropertySQL( + 'MS_Description', + $comment, + 'SCHEMA', + $schemaSQL, + 'TABLE', + $tableSQL, + 'COLUMN', + $columnName, + ); + } + + /** + * Returns the SQL snippet for declaring a default constraint. + * + * @internal The method should be only used from within the SQLServerPlatform class hierarchy. + * + * @param string $table Name of the table to return the default constraint declaration for. + * @param mixed[] $column Column definition. + * + * @return string + * + * @throws InvalidArgumentException + */ + public function getDefaultConstraintDeclarationSQL($table, array $column) + { + if (! isset($column['default'])) { + throw new InvalidArgumentException("Incomplete column definition. 'default' required."); + } + + $columnName = new Identifier($column['name']); + + return ' CONSTRAINT ' . + $this->generateDefaultConstraintName($table, $column['name']) . + $this->getDefaultValueDeclarationSQL($column) . + ' FOR ' . $columnName->getQuotedName($this); + } + + /** + * {@inheritDoc} + */ + public function getCreateIndexSQL(Index $index, $table) + { + $constraint = parent::getCreateIndexSQL($index, $table); + + if ($index->isUnique() && ! $index->isPrimary()) { + $constraint = $this->_appendUniqueConstraintDefinition($constraint, $index); + } + + return $constraint; + } + + /** + * {@inheritDoc} + */ + protected function getCreateIndexSQLFlags(Index $index) + { + $type = ''; + if ($index->isUnique()) { + $type .= 'UNIQUE '; + } + + if ($index->hasFlag('clustered')) { + $type .= 'CLUSTERED '; + } elseif ($index->hasFlag('nonclustered')) { + $type .= 'NONCLUSTERED '; + } + + return $type; + } + + /** + * Extend unique key constraint with required filters + * + * @param string $sql + */ + private function _appendUniqueConstraintDefinition($sql, Index $index): string + { + $fields = []; + + foreach ($index->getQuotedColumns($this) as $field) { + $fields[] = $field . ' IS NOT NULL'; + } + + return $sql . ' WHERE ' . implode(' AND ', $fields); + } + + /** + * {@inheritDoc} + */ + public function getAlterTableSQL(TableDiff $diff) + { + $queryParts = []; + $sql = []; + $columnSql = []; + $commentsSql = []; + + $table = $diff->getOldTable() ?? $diff->getName($this); + + $tableName = $table->getName(); + + foreach ($diff->getAddedColumns() as $column) { + if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { + continue; + } + + $columnProperties = $column->toArray(); + + $addColumnSql = 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnProperties); + + if (isset($columnProperties['default'])) { + $addColumnSql .= ' CONSTRAINT ' . $this->generateDefaultConstraintName( + $tableName, + $column->getQuotedName($this), + ) . $this->getDefaultValueDeclarationSQL($columnProperties); + } + + $queryParts[] = $addColumnSql; + + $comment = $this->getColumnComment($column); + + if (empty($comment) && ! is_numeric($comment)) { + continue; + } + + $commentsSql[] = $this->getCreateColumnCommentSQL( + $tableName, + $column->getQuotedName($this), + $comment, + ); + } + + foreach ($diff->getDroppedColumns() as $column) { + if ($this->onSchemaAlterTableRemoveColumn($column, $diff, $columnSql)) { + continue; + } + + $queryParts[] = 'DROP COLUMN ' . $column->getQuotedName($this); + } + + foreach ($diff->getModifiedColumns() as $columnDiff) { + if ($this->onSchemaAlterTableChangeColumn($columnDiff, $diff, $columnSql)) { + continue; + } + + $newColumn = $columnDiff->getNewColumn(); + $newComment = $this->getColumnComment($newColumn); + $hasNewComment = ! empty($newComment) || is_numeric($newComment); + + $oldColumn = $columnDiff->getOldColumn(); + + if ($oldColumn instanceof Column) { + $oldComment = $this->getColumnComment($oldColumn); + $hasOldComment = ! empty($oldComment) || is_numeric($oldComment); + + if ($hasOldComment && $hasNewComment && $oldComment !== $newComment) { + $commentsSql[] = $this->getAlterColumnCommentSQL( + $tableName, + $newColumn->getQuotedName($this), + $newComment, + ); + } elseif ($hasOldComment && ! $hasNewComment) { + $commentsSql[] = $this->getDropColumnCommentSQL( + $tableName, + $newColumn->getQuotedName($this), + ); + } elseif (! $hasOldComment && $hasNewComment) { + $commentsSql[] = $this->getCreateColumnCommentSQL( + $tableName, + $newColumn->getQuotedName($this), + $newComment, + ); + } + } + + // Do not add query part if only comment has changed. + if ($columnDiff->hasCommentChanged() && count($columnDiff->changedProperties) === 1) { + continue; + } + + $requireDropDefaultConstraint = $this->alterColumnRequiresDropDefaultConstraint($columnDiff); + + if ($requireDropDefaultConstraint) { + $oldColumn = $columnDiff->getOldColumn(); + + if ($oldColumn !== null) { + $oldColumnName = $oldColumn->getName(); + } else { + $oldColumnName = $columnDiff->oldColumnName; + } + + $queryParts[] = $this->getAlterTableDropDefaultConstraintClause($tableName, $oldColumnName); + } + + $columnProperties = $newColumn->toArray(); + + $queryParts[] = 'ALTER COLUMN ' . + $this->getColumnDeclarationSQL($newColumn->getQuotedName($this), $columnProperties); + + if ( + ! isset($columnProperties['default']) + || (! $requireDropDefaultConstraint && ! $columnDiff->hasDefaultChanged()) + ) { + continue; + } + + $queryParts[] = $this->getAlterTableAddDefaultConstraintClause($tableName, $newColumn); + } + + $tableNameSQL = $table->getQuotedName($this); + + foreach ($diff->getRenamedColumns() as $oldColumnName => $newColumn) { + if ($this->onSchemaAlterTableRenameColumn($oldColumnName, $newColumn, $diff, $columnSql)) { + continue; + } + + $oldColumnName = new Identifier($oldColumnName); + + $sql[] = "sp_rename '" . $tableNameSQL . '.' . $oldColumnName->getQuotedName($this) . + "', '" . $newColumn->getQuotedName($this) . "', 'COLUMN'"; + + // Recreate default constraint with new column name if necessary (for future reference). + if ($newColumn->getDefault() === null) { + continue; + } + + $queryParts[] = $this->getAlterTableDropDefaultConstraintClause( + $tableName, + $oldColumnName->getQuotedName($this), + ); + $queryParts[] = $this->getAlterTableAddDefaultConstraintClause($tableName, $newColumn); + } + + $tableSql = []; + + if ($this->onSchemaAlterTable($diff, $tableSql)) { + return array_merge($tableSql, $columnSql); + } + + foreach ($queryParts as $query) { + $sql[] = 'ALTER TABLE ' . $tableNameSQL . ' ' . $query; + } + + $sql = array_merge($sql, $commentsSql); + + $newName = $diff->getNewName(); + + if ($newName !== false) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5663', + 'Generation of "rename table" SQL using %s is deprecated. Use getRenameTableSQL() instead.', + __METHOD__, + ); + + $sql = array_merge($sql, $this->getRenameTableSQL($tableName, $newName->getName())); + } + + $sql = array_merge( + $this->getPreAlterTableIndexForeignKeySQL($diff), + $sql, + $this->getPostAlterTableIndexForeignKeySQL($diff), + ); + + return array_merge($sql, $tableSql, $columnSql); + } + + /** + * {@inheritDoc} + */ + public function getRenameTableSQL(string $oldName, string $newName): array + { + return [ + sprintf('sp_rename %s, %s', $this->quoteStringLiteral($oldName), $this->quoteStringLiteral($newName)), + + /* Rename table's default constraints names + * to match the new table name. + * This is necessary to ensure that the default + * constraints can be referenced in future table + * alterations as the table name is encoded in + * default constraints' names. */ + sprintf( + <<<'SQL' + DECLARE @sql NVARCHAR(MAX) = N''; + SELECT @sql += N'EXEC sp_rename N''' + dc.name + ''', N''' + + REPLACE(dc.name, '%s', '%s') + ''', ''OBJECT'';' + FROM sys.default_constraints dc + JOIN sys.tables tbl + ON dc.parent_object_id = tbl.object_id + WHERE tbl.name = %s; + EXEC sp_executesql @sql + SQL, + $this->generateIdentifierName($oldName), + $this->generateIdentifierName($newName), + $this->quoteStringLiteral($newName), + ), + ]; + } + + /** + * Returns the SQL clause for adding a default constraint in an ALTER TABLE statement. + * + * @param string $tableName The name of the table to generate the clause for. + * @param Column $column The column to generate the clause for. + */ + private function getAlterTableAddDefaultConstraintClause($tableName, Column $column): string + { + $columnDef = $column->toArray(); + $columnDef['name'] = $column->getQuotedName($this); + + return 'ADD' . $this->getDefaultConstraintDeclarationSQL($tableName, $columnDef); + } + + /** + * Returns the SQL clause for dropping an existing default constraint in an ALTER TABLE statement. + * + * @param string $tableName The name of the table to generate the clause for. + * @param string $columnName The name of the column to generate the clause for. + */ + private function getAlterTableDropDefaultConstraintClause($tableName, $columnName): string + { + return 'DROP CONSTRAINT ' . $this->generateDefaultConstraintName($tableName, $columnName); + } + + /** + * Checks whether a column alteration requires dropping its default constraint first. + * + * Different to other database vendors SQL Server implements column default values + * as constraints and therefore changes in a column's default value as well as changes + * in a column's type require dropping the default constraint first before being to + * alter the particular column to the new definition. + */ + private function alterColumnRequiresDropDefaultConstraint(ColumnDiff $columnDiff): bool + { + $oldColumn = $columnDiff->getOldColumn(); + + // We can only decide whether to drop an existing default constraint + // if we know the original default value. + if (! $oldColumn instanceof Column) { + return false; + } + + // We only need to drop an existing default constraint if we know the + // column was defined with a default value before. + if ($oldColumn->getDefault() === null) { + return false; + } + + // We need to drop an existing default constraint if the column was + // defined with a default value before and it has changed. + if ($columnDiff->hasDefaultChanged()) { + return true; + } + + // We need to drop an existing default constraint if the column was + // defined with a default value before and the native column type has changed. + return $columnDiff->hasTypeChanged() || $columnDiff->hasFixedChanged(); + } + + /** + * Returns the SQL statement for altering a column comment. + * + * SQL Server does not support native column comments, + * therefore the extended properties functionality is used + * as a workaround to store them. + * The property name used to store column comments is "MS_Description" + * which provides compatibility with SQL Server Management Studio, + * as column comments are stored in the same property there when + * specifying a column's "Description" attribute. + * + * @param string $tableName The quoted table name to which the column belongs. + * @param string $columnName The quoted column name to alter the comment for. + * @param string|null $comment The column's comment. + * + * @return string + */ + protected function getAlterColumnCommentSQL($tableName, $columnName, $comment) + { + if (strpos($tableName, '.') !== false) { + [$schemaSQL, $tableSQL] = explode('.', $tableName); + $schemaSQL = $this->quoteStringLiteral($schemaSQL); + $tableSQL = $this->quoteStringLiteral($tableSQL); + } else { + $schemaSQL = "'dbo'"; + $tableSQL = $this->quoteStringLiteral($tableName); + } + + return $this->getUpdateExtendedPropertySQL( + 'MS_Description', + $comment, + 'SCHEMA', + $schemaSQL, + 'TABLE', + $tableSQL, + 'COLUMN', + $columnName, + ); + } + + /** + * Returns the SQL statement for dropping a column comment. + * + * SQL Server does not support native column comments, + * therefore the extended properties functionality is used + * as a workaround to store them. + * The property name used to store column comments is "MS_Description" + * which provides compatibility with SQL Server Management Studio, + * as column comments are stored in the same property there when + * specifying a column's "Description" attribute. + * + * @param string $tableName The quoted table name to which the column belongs. + * @param string $columnName The quoted column name to drop the comment for. + * + * @return string + */ + protected function getDropColumnCommentSQL($tableName, $columnName) + { + if (strpos($tableName, '.') !== false) { + [$schemaSQL, $tableSQL] = explode('.', $tableName); + $schemaSQL = $this->quoteStringLiteral($schemaSQL); + $tableSQL = $this->quoteStringLiteral($tableSQL); + } else { + $schemaSQL = "'dbo'"; + $tableSQL = $this->quoteStringLiteral($tableName); + } + + return $this->getDropExtendedPropertySQL( + 'MS_Description', + 'SCHEMA', + $schemaSQL, + 'TABLE', + $tableSQL, + 'COLUMN', + $columnName, + ); + } + + /** + * {@inheritdoc} + */ + protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName) + { + return [sprintf( + "EXEC sp_rename N'%s.%s', N'%s', N'INDEX'", + $tableName, + $oldIndexName, + $index->getQuotedName($this), + ), + ]; + } + + /** + * Returns the SQL statement for adding an extended property to a database object. + * + * @internal The method should be only used from within the SQLServerPlatform class hierarchy. + * + * @link http://msdn.microsoft.com/en-us/library/ms180047%28v=sql.90%29.aspx + * + * @param string $name The name of the property to add. + * @param string|null $value The value of the property to add. + * @param string|null $level0Type The type of the object at level 0 the property belongs to. + * @param string|null $level0Name The name of the object at level 0 the property belongs to. + * @param string|null $level1Type The type of the object at level 1 the property belongs to. + * @param string|null $level1Name The name of the object at level 1 the property belongs to. + * @param string|null $level2Type The type of the object at level 2 the property belongs to. + * @param string|null $level2Name The name of the object at level 2 the property belongs to. + * + * @return string + */ + public function getAddExtendedPropertySQL( + $name, + $value = null, + $level0Type = null, + $level0Name = null, + $level1Type = null, + $level1Name = null, + $level2Type = null, + $level2Name = null + ) { + return 'EXEC sp_addextendedproperty ' . + 'N' . $this->quoteStringLiteral($name) . ', N' . $this->quoteStringLiteral((string) $value) . ', ' . + 'N' . $this->quoteStringLiteral((string) $level0Type) . ', ' . $level0Name . ', ' . + 'N' . $this->quoteStringLiteral((string) $level1Type) . ', ' . $level1Name . ', ' . + 'N' . $this->quoteStringLiteral((string) $level2Type) . ', ' . $level2Name; + } + + /** + * Returns the SQL statement for dropping an extended property from a database object. + * + * @internal The method should be only used from within the SQLServerPlatform class hierarchy. + * + * @link http://technet.microsoft.com/en-gb/library/ms178595%28v=sql.90%29.aspx + * + * @param string $name The name of the property to drop. + * @param string|null $level0Type The type of the object at level 0 the property belongs to. + * @param string|null $level0Name The name of the object at level 0 the property belongs to. + * @param string|null $level1Type The type of the object at level 1 the property belongs to. + * @param string|null $level1Name The name of the object at level 1 the property belongs to. + * @param string|null $level2Type The type of the object at level 2 the property belongs to. + * @param string|null $level2Name The name of the object at level 2 the property belongs to. + * + * @return string + */ + public function getDropExtendedPropertySQL( + $name, + $level0Type = null, + $level0Name = null, + $level1Type = null, + $level1Name = null, + $level2Type = null, + $level2Name = null + ) { + return 'EXEC sp_dropextendedproperty ' . + 'N' . $this->quoteStringLiteral($name) . ', ' . + 'N' . $this->quoteStringLiteral((string) $level0Type) . ', ' . $level0Name . ', ' . + 'N' . $this->quoteStringLiteral((string) $level1Type) . ', ' . $level1Name . ', ' . + 'N' . $this->quoteStringLiteral((string) $level2Type) . ', ' . $level2Name; + } + + /** + * Returns the SQL statement for updating an extended property of a database object. + * + * @internal The method should be only used from within the SQLServerPlatform class hierarchy. + * + * @link http://msdn.microsoft.com/en-us/library/ms186885%28v=sql.90%29.aspx + * + * @param string $name The name of the property to update. + * @param string|null $value The value of the property to update. + * @param string|null $level0Type The type of the object at level 0 the property belongs to. + * @param string|null $level0Name The name of the object at level 0 the property belongs to. + * @param string|null $level1Type The type of the object at level 1 the property belongs to. + * @param string|null $level1Name The name of the object at level 1 the property belongs to. + * @param string|null $level2Type The type of the object at level 2 the property belongs to. + * @param string|null $level2Name The name of the object at level 2 the property belongs to. + * + * @return string + */ + public function getUpdateExtendedPropertySQL( + $name, + $value = null, + $level0Type = null, + $level0Name = null, + $level1Type = null, + $level1Name = null, + $level2Type = null, + $level2Name = null + ) { + return 'EXEC sp_updateextendedproperty ' . + 'N' . $this->quoteStringLiteral($name) . ', N' . $this->quoteStringLiteral((string) $value) . ', ' . + 'N' . $this->quoteStringLiteral((string) $level0Type) . ', ' . $level0Name . ', ' . + 'N' . $this->quoteStringLiteral((string) $level1Type) . ', ' . $level1Name . ', ' . + 'N' . $this->quoteStringLiteral((string) $level2Type) . ', ' . $level2Name; + } + + /** + * {@inheritDoc} + */ + public function getEmptyIdentityInsertSQL($quotedTableName, $quotedIdentifierColumnName) + { + return 'INSERT INTO ' . $quotedTableName . ' DEFAULT VALUES'; + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * {@inheritDoc} + */ + public function getListTablesSQL() + { + // "sysdiagrams" table must be ignored as it's internal SQL Server table for Database Diagrams + // Category 2 must be ignored as it is "MS SQL Server 'pseudo-system' object[s]" for replication + return 'SELECT name, SCHEMA_NAME (uid) AS schema_name FROM sysobjects' + . " WHERE type = 'U' AND name != 'sysdiagrams' AND category != 2 ORDER BY name"; + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * {@inheritDoc} + */ + public function getListTableColumnsSQL($table, $database = null) + { + return "SELECT col.name, + type.name AS type, + col.max_length AS length, + ~col.is_nullable AS notnull, + def.definition AS [default], + col.scale, + col.precision, + col.is_identity AS autoincrement, + col.collation_name AS collation, + CAST(prop.value AS NVARCHAR(MAX)) AS comment -- CAST avoids driver error for sql_variant type + FROM sys.columns AS col + JOIN sys.types AS type + ON col.user_type_id = type.user_type_id + JOIN sys.objects AS obj + ON col.object_id = obj.object_id + JOIN sys.schemas AS scm + ON obj.schema_id = scm.schema_id + LEFT JOIN sys.default_constraints def + ON col.default_object_id = def.object_id + AND col.object_id = def.parent_object_id + LEFT JOIN sys.extended_properties AS prop + ON obj.object_id = prop.major_id + AND col.column_id = prop.minor_id + AND prop.name = 'MS_Description' + WHERE obj.type = 'U' + AND " . $this->getTableWhereClause($table, 'scm.name', 'obj.name'); + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * @param string $table + * @param string|null $database + * + * @return string + */ + public function getListTableForeignKeysSQL($table, $database = null) + { + return 'SELECT f.name AS ForeignKey, + SCHEMA_NAME (f.SCHEMA_ID) AS SchemaName, + OBJECT_NAME (f.parent_object_id) AS TableName, + COL_NAME (fc.parent_object_id,fc.parent_column_id) AS ColumnName, + SCHEMA_NAME (o.SCHEMA_ID) ReferenceSchemaName, + OBJECT_NAME (f.referenced_object_id) AS ReferenceTableName, + COL_NAME(fc.referenced_object_id,fc.referenced_column_id) AS ReferenceColumnName, + f.delete_referential_action_desc, + f.update_referential_action_desc + FROM sys.foreign_keys AS f + INNER JOIN sys.foreign_key_columns AS fc + INNER JOIN sys.objects AS o ON o.OBJECT_ID = fc.referenced_object_id + ON f.OBJECT_ID = fc.constraint_object_id + WHERE ' . + $this->getTableWhereClause($table, 'SCHEMA_NAME (f.schema_id)', 'OBJECT_NAME (f.parent_object_id)') . + ' ORDER BY fc.constraint_column_id'; + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * {@inheritDoc} + */ + public function getListTableIndexesSQL($table, $database = null) + { + return "SELECT idx.name AS key_name, + col.name AS column_name, + ~idx.is_unique AS non_unique, + idx.is_primary_key AS [primary], + CASE idx.type + WHEN '1' THEN 'clustered' + WHEN '2' THEN 'nonclustered' + ELSE NULL + END AS flags + FROM sys.tables AS tbl + JOIN sys.schemas AS scm ON tbl.schema_id = scm.schema_id + JOIN sys.indexes AS idx ON tbl.object_id = idx.object_id + JOIN sys.index_columns AS idxcol ON idx.object_id = idxcol.object_id AND idx.index_id = idxcol.index_id + JOIN sys.columns AS col ON idxcol.object_id = col.object_id AND idxcol.column_id = col.column_id + WHERE " . $this->getTableWhereClause($table, 'scm.name', 'tbl.name') . ' + ORDER BY idx.index_id ASC, idxcol.key_ordinal ASC'; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractSchemaManager} class hierarchy. + */ + public function getListViewsSQL($database) + { + return "SELECT name, definition FROM sysobjects + INNER JOIN sys.sql_modules ON sysobjects.id = sys.sql_modules.object_id + WHERE type = 'V' ORDER BY name"; + } + + /** + * Returns the where clause to filter schema and table name in a query. + * + * @param string $table The full qualified name of the table. + * @param string $schemaColumn The name of the column to compare the schema to in the where clause. + * @param string $tableColumn The name of the column to compare the table to in the where clause. + */ + private function getTableWhereClause($table, $schemaColumn, $tableColumn): string + { + if (strpos($table, '.') !== false) { + [$schema, $table] = explode('.', $table); + $schema = $this->quoteStringLiteral($schema); + $table = $this->quoteStringLiteral($table); + } else { + $schema = 'SCHEMA_NAME()'; + $table = $this->quoteStringLiteral($table); + } + + return sprintf('(%s = %s AND %s = %s)', $tableColumn, $table, $schemaColumn, $schema); + } + + /** + * {@inheritDoc} + */ + public function getLocateExpression($str, $substr, $startPos = false) + { + if ($startPos === false) { + return 'CHARINDEX(' . $substr . ', ' . $str . ')'; + } + + return 'CHARINDEX(' . $substr . ', ' . $str . ', ' . $startPos . ')'; + } + + /** + * {@inheritDoc} + */ + public function getModExpression($expression1, $expression2) + { + return $expression1 . ' % ' . $expression2; + } + + /** + * {@inheritDoc} + */ + public function getTrimExpression($str, $mode = TrimMode::UNSPECIFIED, $char = false) + { + if ($char === false) { + switch ($mode) { + case TrimMode::LEADING: + $trimFn = 'LTRIM'; + break; + + case TrimMode::TRAILING: + $trimFn = 'RTRIM'; + break; + + default: + return 'LTRIM(RTRIM(' . $str . '))'; + } + + return $trimFn . '(' . $str . ')'; + } + + $pattern = "'%[^' + " . $char . " + ']%'"; + + if ($mode === TrimMode::LEADING) { + return 'stuff(' . $str . ', 1, patindex(' . $pattern . ', ' . $str . ') - 1, null)'; + } + + if ($mode === TrimMode::TRAILING) { + return 'reverse(stuff(reverse(' . $str . '), 1, ' + . 'patindex(' . $pattern . ', reverse(' . $str . ')) - 1, null))'; + } + + return 'reverse(stuff(reverse(stuff(' . $str . ', 1, patindex(' . $pattern . ', ' . $str . ') - 1, null)), 1, ' + . 'patindex(' . $pattern . ', reverse(stuff(' . $str . ', 1, patindex(' . $pattern . ', ' . $str + . ') - 1, null))) - 1, null))'; + } + + /** + * {@inheritDoc} + */ + public function getConcatExpression() + { + return sprintf('CONCAT(%s)', implode(', ', func_get_args())); + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractSchemaManager} class hierarchy. + */ + public function getListDatabasesSQL() + { + return 'SELECT * FROM sys.databases'; + } + + /** + * {@inheritDoc} + * + * @deprecated Use {@see SQLServerSchemaManager::listSchemaNames()} instead. + */ + public function getListNamespacesSQL() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4503', + 'SQLServerPlatform::getListNamespacesSQL() is deprecated,' + . ' use SQLServerSchemaManager::listSchemaNames() instead.', + ); + + return "SELECT name FROM sys.schemas WHERE name NOT IN('guest', 'INFORMATION_SCHEMA', 'sys')"; + } + + /** + * {@inheritDoc} + */ + public function getSubstringExpression($string, $start, $length = null) + { + if ($length !== null) { + return 'SUBSTRING(' . $string . ', ' . $start . ', ' . $length . ')'; + } + + return 'SUBSTRING(' . $string . ', ' . $start . ', LEN(' . $string . ') - ' . $start . ' + 1)'; + } + + /** + * {@inheritDoc} + */ + public function getLengthExpression($column) + { + return 'LEN(' . $column . ')'; + } + + public function getCurrentDatabaseExpression(): string + { + return 'DB_NAME()'; + } + + /** + * {@inheritDoc} + */ + public function getSetTransactionIsolationSQL($level) + { + return 'SET TRANSACTION ISOLATION LEVEL ' . $this->_getTransactionIsolationLevelSQL($level); + } + + /** + * {@inheritDoc} + */ + public function getIntegerTypeDeclarationSQL(array $column) + { + return 'INT' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + public function getBigIntTypeDeclarationSQL(array $column) + { + return 'BIGINT' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + public function getSmallIntTypeDeclarationSQL(array $column) + { + return 'SMALLINT' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + public function getGuidTypeDeclarationSQL(array $column) + { + return 'UNIQUEIDENTIFIER'; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeTzTypeDeclarationSQL(array $column) + { + return 'DATETIMEOFFSET(6)'; + } + + /** + * {@inheritDoc} + */ + public function getAsciiStringTypeDeclarationSQL(array $column): string + { + $length = $column['length'] ?? null; + + if (! isset($column['fixed'])) { + return sprintf('VARCHAR(%d)', $length ?? 255); + } + + return sprintf('CHAR(%d)', $length ?? 255); + } + + /** + * {@inheritDoc} + */ + protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed/*, $lengthOmitted = false*/) + { + if ($length <= 0 || (func_num_args() > 2 && func_get_arg(2))) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3263', + 'Relying on the default string column length on SQL Server is deprecated' + . ', specify the length explicitly.', + ); + } + + return $fixed + ? 'NCHAR(' . ($length > 0 ? $length : 255) . ')' + : 'NVARCHAR(' . ($length > 0 ? $length : 255) . ')'; + } + + /** + * {@inheritdoc} + */ + protected function getBinaryTypeDeclarationSQLSnippet($length, $fixed/*, $lengthOmitted = false*/) + { + if ($length <= 0 || (func_num_args() > 2 && func_get_arg(2))) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3263', + 'Relying on the default binary column length on SQL Server is deprecated' + . ', specify the length explicitly.', + ); + } + + return $fixed + ? 'BINARY(' . ($length > 0 ? $length : 255) . ')' + : 'VARBINARY(' . ($length > 0 ? $length : 255) . ')'; + } + + /** + * {@inheritdoc} + * + * @deprecated + */ + public function getBinaryMaxLength() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3263', + 'SQLServerPlatform::getBinaryMaxLength() is deprecated.', + ); + + return 8000; + } + + /** + * {@inheritDoc} + */ + public function getClobTypeDeclarationSQL(array $column) + { + return 'VARCHAR(MAX)'; + } + + /** + * {@inheritDoc} + */ + protected function _getCommonIntegerTypeDeclarationSQL(array $column) + { + return ! empty($column['autoincrement']) ? ' IDENTITY' : ''; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeTypeDeclarationSQL(array $column) + { + // 3 - microseconds precision length + // http://msdn.microsoft.com/en-us/library/ms187819.aspx + return 'DATETIME2(6)'; + } + + /** + * {@inheritDoc} + */ + public function getDateTypeDeclarationSQL(array $column) + { + return 'DATE'; + } + + /** + * {@inheritDoc} + */ + public function getTimeTypeDeclarationSQL(array $column) + { + return 'TIME(0)'; + } + + /** + * {@inheritDoc} + */ + public function getBooleanTypeDeclarationSQL(array $column) + { + return 'BIT'; + } + + /** + * {@inheritDoc} + */ + protected function doModifyLimitQuery($query, $limit, $offset) + { + if ($limit === null && $offset <= 0) { + return $query; + } + + if ($this->shouldAddOrderBy($query)) { + if (preg_match('/^SELECT\s+DISTINCT/im', $query) > 0) { + // SQL Server won't let us order by a non-selected column in a DISTINCT query, + // so we have to do this madness. This says, order by the first column in the + // result. SQL Server's docs say that a nonordered query's result order is non- + // deterministic anyway, so this won't do anything that a bunch of update and + // deletes to the table wouldn't do anyway. + $query .= ' ORDER BY 1'; + } else { + // In another DBMS, we could do ORDER BY 0, but SQL Server gets angry if you + // use constant expressions in the order by list. + $query .= ' ORDER BY (SELECT 0)'; + } + } + + // This looks somewhat like MYSQL, but limit/offset are in inverse positions + // Supposedly SQL:2008 core standard. + // Per TSQL spec, FETCH NEXT n ROWS ONLY is not valid without OFFSET n ROWS. + $query .= sprintf(' OFFSET %d ROWS', $offset); + + if ($limit !== null) { + $query .= sprintf(' FETCH NEXT %d ROWS ONLY', $limit); + } + + return $query; + } + + /** + * {@inheritDoc} + */ + public function convertBooleans($item) + { + if (is_array($item)) { + foreach ($item as $key => $value) { + if (! is_bool($value) && ! is_numeric($value)) { + continue; + } + + $item[$key] = (int) (bool) $value; + } + } elseif (is_bool($item) || is_numeric($item)) { + $item = (int) (bool) $item; + } + + return $item; + } + + /** + * {@inheritDoc} + */ + public function getCreateTemporaryTableSnippetSQL() + { + return 'CREATE TABLE'; + } + + /** + * {@inheritDoc} + */ + public function getTemporaryTableName($tableName) + { + return '#' . $tableName; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeFormatString() + { + return 'Y-m-d H:i:s.u'; + } + + /** + * {@inheritDoc} + */ + public function getDateFormatString() + { + return 'Y-m-d'; + } + + /** + * {@inheritDoc} + */ + public function getTimeFormatString() + { + return 'H:i:s'; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeTzFormatString() + { + return 'Y-m-d H:i:s.u P'; + } + + /** + * {@inheritDoc} + */ + public function getName() + { + return 'mssql'; + } + + /** + * {@inheritDoc} + */ + protected function initializeDoctrineTypeMappings() + { + $this->doctrineTypeMapping = [ + 'bigint' => 'bigint', + 'binary' => 'binary', + 'bit' => 'boolean', + 'blob' => 'blob', + 'char' => 'string', + 'date' => 'date', + 'datetime' => 'datetime', + 'datetime2' => 'datetime', + 'datetimeoffset' => 'datetimetz', + 'decimal' => 'decimal', + 'double' => 'float', + 'double precision' => 'float', + 'float' => 'float', + 'image' => 'blob', + 'int' => 'integer', + 'money' => 'integer', + 'nchar' => 'string', + 'ntext' => 'text', + 'numeric' => 'decimal', + 'nvarchar' => 'string', + 'real' => 'float', + 'smalldatetime' => 'datetime', + 'smallint' => 'smallint', + 'smallmoney' => 'integer', + 'text' => 'text', + 'time' => 'time', + 'tinyint' => 'smallint', + 'uniqueidentifier' => 'guid', + 'varbinary' => 'binary', + 'varchar' => 'string', + ]; + } + + /** + * {@inheritDoc} + */ + public function createSavePoint($savepoint) + { + return 'SAVE TRANSACTION ' . $savepoint; + } + + /** + * {@inheritDoc} + */ + public function releaseSavePoint($savepoint) + { + return ''; + } + + /** + * {@inheritDoc} + */ + public function rollbackSavePoint($savepoint) + { + return 'ROLLBACK TRANSACTION ' . $savepoint; + } + + /** + * {@inheritdoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function getForeignKeyReferentialActionSQL($action) + { + // RESTRICT is not supported, therefore falling back to NO ACTION. + if (strtoupper($action) === 'RESTRICT') { + return 'NO ACTION'; + } + + return parent::getForeignKeyReferentialActionSQL($action); + } + + public function appendLockHint(string $fromClause, int $lockMode): string + { + switch ($lockMode) { + case LockMode::NONE: + case LockMode::OPTIMISTIC: + return $fromClause; + + case LockMode::PESSIMISTIC_READ: + return $fromClause . ' WITH (HOLDLOCK, ROWLOCK)'; + + case LockMode::PESSIMISTIC_WRITE: + return $fromClause . ' WITH (UPDLOCK, ROWLOCK)'; + + default: + throw InvalidLockMode::fromLockMode($lockMode); + } + } + + /** + * {@inheritDoc} + */ + public function getForUpdateSQL() + { + return ' '; + } + + /** + * {@inheritDoc} + * + * @deprecated Implement {@see createReservedKeywordsList()} instead. + */ + protected function getReservedKeywordsClass() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4510', + 'SQLServerPlatform::getReservedKeywordsClass() is deprecated,' + . ' use SQLServerPlatform::createReservedKeywordsList() instead.', + ); + + return Keywords\SQLServer2012Keywords::class; + } + + /** + * {@inheritDoc} + */ + public function quoteSingleIdentifier($str) + { + return '[' . str_replace(']', ']]', $str) . ']'; + } + + /** + * {@inheritDoc} + */ + public function getTruncateTableSQL($tableName, $cascade = false) + { + $tableIdentifier = new Identifier($tableName); + + return 'TRUNCATE TABLE ' . $tableIdentifier->getQuotedName($this); + } + + /** + * {@inheritDoc} + */ + public function getBlobTypeDeclarationSQL(array $column) + { + return 'VARBINARY(MAX)'; + } + + /** + * {@inheritdoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function getColumnDeclarationSQL($name, array $column) + { + if (isset($column['columnDefinition'])) { + $columnDef = $this->getCustomTypeDeclarationSQL($column); + } else { + $collation = ! empty($column['collation']) ? + ' ' . $this->getColumnCollationDeclarationSQL($column['collation']) : ''; + + $notnull = ! empty($column['notnull']) ? ' NOT NULL' : ''; + + if (! empty($column['unique'])) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5656', + 'The usage of the "unique" column property is deprecated. Use unique constraints instead.', + ); + + $unique = ' ' . $this->getUniqueFieldDeclarationSQL(); + } else { + $unique = ''; + } + + if (! empty($column['check'])) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5656', + 'The usage of the "check" column property is deprecated.', + ); + + $check = ' ' . $column['check']; + } else { + $check = ''; + } + + $typeDecl = $column['type']->getSQLDeclaration($column, $this); + $columnDef = $typeDecl . $collation . $notnull . $unique . $check; + } + + return $name . ' ' . $columnDef; + } + + /** + * {@inheritDoc} + * + * SQL Server does not support quoting collation identifiers. + */ + public function getColumnCollationDeclarationSQL($collation) + { + return 'COLLATE ' . $collation; + } + + public function columnsEqual(Column $column1, Column $column2): bool + { + if (! parent::columnsEqual($column1, $column2)) { + return false; + } + + return $this->getDefaultValueDeclarationSQL($column1->toArray()) + === $this->getDefaultValueDeclarationSQL($column2->toArray()); + } + + protected function getLikeWildcardCharacters(): string + { + return parent::getLikeWildcardCharacters() . '[]^'; + } + + /** + * Returns a unique default constraint name for a table and column. + * + * @param string $table Name of the table to generate the unique default constraint name for. + * @param string $column Name of the column in the table to generate the unique default constraint name for. + */ + private function generateDefaultConstraintName($table, $column): string + { + return 'DF_' . $this->generateIdentifierName($table) . '_' . $this->generateIdentifierName($column); + } + + /** + * Returns a hash value for a given identifier. + * + * @param string $identifier Identifier to generate a hash value for. + */ + private function generateIdentifierName($identifier): string + { + // Always generate name for unquoted identifiers to ensure consistency. + $identifier = new Identifier($identifier); + + return strtoupper(dechex(crc32($identifier->getName()))); + } + + protected function getCommentOnTableSQL(string $tableName, ?string $comment): string + { + return sprintf( + <<<'SQL' + EXEC sys.sp_addextendedproperty @name=N'MS_Description', + @value=N%s, @level0type=N'SCHEMA', @level0name=N'dbo', + @level1type=N'TABLE', @level1name=N%s + SQL + , + $this->quoteStringLiteral((string) $comment), + $this->quoteStringLiteral($tableName), + ); + } + + /** @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. */ + public function getListTableMetadataSQL(string $table): string + { + return sprintf( + <<<'SQL' + SELECT + p.value AS [table_comment] + FROM + sys.tables AS tbl + INNER JOIN sys.extended_properties AS p ON p.major_id=tbl.object_id AND p.minor_id=0 AND p.class=1 + WHERE + (tbl.name=N%s and SCHEMA_NAME(tbl.schema_id)=N'dbo' and p.name=N'MS_Description') + SQL + , + $this->quoteStringLiteral($table), + ); + } + + /** @param string $query */ + private function shouldAddOrderBy($query): bool + { + // Find the position of the last instance of ORDER BY and ensure it is not within a parenthetical statement + // but can be in a newline + $matches = []; + $matchesCount = preg_match_all('/[\\s]+order\\s+by\\s/im', $query, $matches, PREG_OFFSET_CAPTURE); + if ($matchesCount === 0) { + return true; + } + + // ORDER BY instance may be in a subquery after ORDER BY + // e.g. SELECT col1 FROM test ORDER BY (SELECT col2 from test ORDER BY col2) + // if in the searched query ORDER BY clause was found where + // number of open parentheses after the occurrence of the clause is equal to + // number of closed brackets after the occurrence of the clause, + // it means that ORDER BY is included in the query being checked + while ($matchesCount > 0) { + $orderByPos = $matches[0][--$matchesCount][1]; + $openBracketsCount = substr_count($query, '(', $orderByPos); + $closedBracketsCount = substr_count($query, ')', $orderByPos); + if ($openBracketsCount === $closedBracketsCount) { + return false; + } + } + + return true; + } + + public function createSchemaManager(Connection $connection): SQLServerSchemaManager + { + return new SQLServerSchemaManager($connection, $this); + } +} diff --git a/vendor/doctrine/dbal/src/Platforms/SQLite/Comparator.php b/vendor/doctrine/dbal/src/Platforms/SQLite/Comparator.php new file mode 100644 index 00000000..263f3561 --- /dev/null +++ b/vendor/doctrine/dbal/src/Platforms/SQLite/Comparator.php @@ -0,0 +1,51 @@ +normalizeColumns($fromTable); + $this->normalizeColumns($toTable); + + return parent::diffTable($fromTable, $toTable); + } + + private function normalizeColumns(Table $table): void + { + foreach ($table->getColumns() as $column) { + $options = $column->getPlatformOptions(); + + if (! isset($options['collation']) || strcasecmp($options['collation'], 'binary') !== 0) { + continue; + } + + unset($options['collation']); + $column->setPlatformOptions($options); + } + } +} diff --git a/vendor/doctrine/dbal/src/Platforms/SqlitePlatform.php b/vendor/doctrine/dbal/src/Platforms/SqlitePlatform.php new file mode 100644 index 00000000..71c29f38 --- /dev/null +++ b/vendor/doctrine/dbal/src/Platforms/SqlitePlatform.php @@ -0,0 +1,1485 @@ + 0 THEN INSTR(SUBSTR(' . $str . ', ' . $startPos . '), ' . $substr . ') + ' . $startPos + . ' - 1 ELSE 0 END'; + } + + /** + * {@inheritdoc} + */ + protected function getDateArithmeticIntervalExpression($date, $operator, $interval, $unit) + { + switch ($unit) { + case DateIntervalUnit::SECOND: + case DateIntervalUnit::MINUTE: + case DateIntervalUnit::HOUR: + return 'DATETIME(' . $date . ",'" . $operator . $interval . ' ' . $unit . "')"; + } + + switch ($unit) { + case DateIntervalUnit::WEEK: + $interval *= 7; + $unit = DateIntervalUnit::DAY; + break; + + case DateIntervalUnit::QUARTER: + $interval *= 3; + $unit = DateIntervalUnit::MONTH; + break; + } + + if (! is_numeric($interval)) { + $interval = "' || " . $interval . " || '"; + } + + return 'DATE(' . $date . ",'" . $operator . $interval . ' ' . $unit . "')"; + } + + /** + * {@inheritDoc} + */ + public function getDateDiffExpression($date1, $date2) + { + return sprintf("JULIANDAY(%s, 'start of day') - JULIANDAY(%s, 'start of day')", $date1, $date2); + } + + /** + * {@inheritDoc} + * + * The DBAL doesn't support databases on the SQLite platform. The expression here always returns a fixed string + * as an indicator of an implicitly selected database. + * + * @link https://www.sqlite.org/lang_select.html + * @see Connection::getDatabase() + */ + public function getCurrentDatabaseExpression(): string + { + return "'main'"; + } + + /** + * {@inheritDoc} + */ + protected function _getTransactionIsolationLevelSQL($level) + { + switch ($level) { + case TransactionIsolationLevel::READ_UNCOMMITTED: + return '0'; + + case TransactionIsolationLevel::READ_COMMITTED: + case TransactionIsolationLevel::REPEATABLE_READ: + case TransactionIsolationLevel::SERIALIZABLE: + return '1'; + + default: + return parent::_getTransactionIsolationLevelSQL($level); + } + } + + /** + * {@inheritDoc} + */ + public function getSetTransactionIsolationSQL($level) + { + return 'PRAGMA read_uncommitted = ' . $this->_getTransactionIsolationLevelSQL($level); + } + + /** + * {@inheritDoc} + * + * @deprecated + */ + public function prefersIdentityColumns() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/1519', + 'SqlitePlatform::prefersIdentityColumns() is deprecated.', + ); + + return true; + } + + /** + * {@inheritDoc} + */ + public function getBooleanTypeDeclarationSQL(array $column) + { + return 'BOOLEAN'; + } + + /** + * {@inheritDoc} + */ + public function getIntegerTypeDeclarationSQL(array $column) + { + return 'INTEGER' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + public function getBigIntTypeDeclarationSQL(array $column) + { + // SQLite autoincrement is implicit for INTEGER PKs, but not for BIGINT columns + if (! empty($column['autoincrement'])) { + return $this->getIntegerTypeDeclarationSQL($column); + } + + return 'BIGINT' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * @deprecated Use {@see getSmallIntTypeDeclarationSQL()} instead. + * + * @param array $column + * + * @return string + */ + public function getTinyIntTypeDeclarationSQL(array $column) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5511', + '%s is deprecated. Use getSmallIntTypeDeclarationSQL() instead.', + __METHOD__, + ); + + // SQLite autoincrement is implicit for INTEGER PKs, but not for TINYINT columns + if (! empty($column['autoincrement'])) { + return $this->getIntegerTypeDeclarationSQL($column); + } + + return 'TINYINT' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + public function getSmallIntTypeDeclarationSQL(array $column) + { + // SQLite autoincrement is implicit for INTEGER PKs, but not for SMALLINT columns + if (! empty($column['autoincrement'])) { + return $this->getIntegerTypeDeclarationSQL($column); + } + + return 'SMALLINT' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * @deprecated Use {@see getIntegerTypeDeclarationSQL()} instead. + * + * @param array $column + * + * @return string + */ + public function getMediumIntTypeDeclarationSQL(array $column) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5511', + '%s is deprecated. Use getIntegerTypeDeclarationSQL() instead.', + __METHOD__, + ); + + // SQLite autoincrement is implicit for INTEGER PKs, but not for MEDIUMINT columns + if (! empty($column['autoincrement'])) { + return $this->getIntegerTypeDeclarationSQL($column); + } + + return 'MEDIUMINT' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + public function getDateTimeTypeDeclarationSQL(array $column) + { + return 'DATETIME'; + } + + /** + * {@inheritDoc} + */ + public function getDateTypeDeclarationSQL(array $column) + { + return 'DATE'; + } + + /** + * {@inheritDoc} + */ + public function getTimeTypeDeclarationSQL(array $column) + { + return 'TIME'; + } + + /** + * {@inheritDoc} + */ + protected function _getCommonIntegerTypeDeclarationSQL(array $column) + { + // sqlite autoincrement is only possible for the primary key + if (! empty($column['autoincrement'])) { + return ' PRIMARY KEY AUTOINCREMENT'; + } + + return ! empty($column['unsigned']) ? ' UNSIGNED' : ''; + } + + /** + * Disables schema emulation. + * + * Schema emulation is enabled by default to maintain backwards compatibility. + * Disable it to opt-in to the behavior of DBAL 4. + * + * @deprecated Will be removed in DBAL 4.0. + */ + public function disableSchemaEmulation(): void + { + $this->schemaEmulationEnabled = false; + } + + private function emulateSchemaNamespacing(string $tableName): string + { + return $this->schemaEmulationEnabled + ? str_replace('.', '__', $tableName) + : $tableName; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function getForeignKeyDeclarationSQL(ForeignKeyConstraint $foreignKey) + { + return parent::getForeignKeyDeclarationSQL(new ForeignKeyConstraint( + $foreignKey->getQuotedLocalColumns($this), + $this->emulateSchemaNamespacing($foreignKey->getQuotedForeignTableName($this)), + $foreignKey->getQuotedForeignColumns($this), + $foreignKey->getName(), + $foreignKey->getOptions(), + )); + } + + /** + * {@inheritDoc} + */ + protected function _getCreateTableSQL($name, array $columns, array $options = []) + { + $name = $this->emulateSchemaNamespacing($name); + $queryFields = $this->getColumnDeclarationListSQL($columns); + + if (isset($options['uniqueConstraints']) && ! empty($options['uniqueConstraints'])) { + foreach ($options['uniqueConstraints'] as $constraintName => $definition) { + $queryFields .= ', ' . $this->getUniqueConstraintDeclarationSQL($constraintName, $definition); + } + } + + $queryFields .= $this->getNonAutoincrementPrimaryKeyDefinition($columns, $options); + + if (isset($options['foreignKeys'])) { + foreach ($options['foreignKeys'] as $foreignKey) { + $queryFields .= ', ' . $this->getForeignKeyDeclarationSQL($foreignKey); + } + } + + $tableComment = ''; + if (isset($options['comment'])) { + $comment = trim($options['comment'], " '"); + + $tableComment = $this->getInlineTableCommentSQL($comment); + } + + $query = ['CREATE TABLE ' . $name . ' ' . $tableComment . '(' . $queryFields . ')']; + + if (isset($options['alter']) && $options['alter'] === true) { + return $query; + } + + if (isset($options['indexes']) && ! empty($options['indexes'])) { + foreach ($options['indexes'] as $indexDef) { + $query[] = $this->getCreateIndexSQL($indexDef, $name); + } + } + + if (isset($options['unique']) && ! empty($options['unique'])) { + foreach ($options['unique'] as $indexDef) { + $query[] = $this->getCreateIndexSQL($indexDef, $name); + } + } + + return $query; + } + + /** + * Generate a PRIMARY KEY definition if no autoincrement value is used + * + * @param mixed[][] $columns + * @param mixed[] $options + */ + private function getNonAutoincrementPrimaryKeyDefinition(array $columns, array $options): string + { + if (empty($options['primary'])) { + return ''; + } + + $keyColumns = array_unique(array_values($options['primary'])); + + foreach ($keyColumns as $keyColumn) { + if (! empty($columns[$keyColumn]['autoincrement'])) { + return ''; + } + } + + return ', PRIMARY KEY(' . implode(', ', $keyColumns) . ')'; + } + + /** + * {@inheritDoc} + */ + protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed) + { + return $fixed ? ($length > 0 ? 'CHAR(' . $length . ')' : 'CHAR(255)') + : ($length > 0 ? 'VARCHAR(' . $length . ')' : 'TEXT'); + } + + /** + * {@inheritdoc} + */ + protected function getBinaryTypeDeclarationSQLSnippet($length, $fixed) + { + return 'BLOB'; + } + + /** + * {@inheritdoc} + * + * @deprecated + */ + public function getBinaryMaxLength() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3263', + 'SqlitePlatform::getBinaryMaxLength() is deprecated.', + ); + + return 0; + } + + /** + * {@inheritdoc} + * + * @deprecated + */ + public function getBinaryDefaultLength() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3263', + 'Relying on the default binary column length is deprecated, specify the length explicitly.', + ); + + return 0; + } + + /** + * {@inheritDoc} + */ + public function getClobTypeDeclarationSQL(array $column) + { + return 'CLOB'; + } + + /** + * @deprecated + * + * {@inheritDoc} + */ + public function getListTableConstraintsSQL($table) + { + $table = $this->emulateSchemaNamespacing($table); + + return sprintf( + "SELECT sql FROM sqlite_master WHERE type='index' AND tbl_name = %s AND sql NOT NULL ORDER BY name", + $this->quoteStringLiteral($table), + ); + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * {@inheritDoc} + */ + public function getListTableColumnsSQL($table, $database = null) + { + $table = $this->emulateSchemaNamespacing($table); + + return sprintf('PRAGMA table_info(%s)', $this->quoteStringLiteral($table)); + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * {@inheritDoc} + */ + public function getListTableIndexesSQL($table, $database = null) + { + $table = $this->emulateSchemaNamespacing($table); + + return sprintf('PRAGMA index_list(%s)', $this->quoteStringLiteral($table)); + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * {@inheritDoc} + */ + public function getListTablesSQL() + { + return 'SELECT name FROM sqlite_master' + . " WHERE type = 'table'" + . " AND name != 'sqlite_sequence'" + . " AND name != 'geometry_columns'" + . " AND name != 'spatial_ref_sys'" + . ' UNION ALL SELECT name FROM sqlite_temp_master' + . " WHERE type = 'table' ORDER BY name"; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractSchemaManager} class hierarchy. + */ + public function getListViewsSQL($database) + { + return "SELECT name, sql FROM sqlite_master WHERE type='view' AND sql NOT NULL"; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint $foreignKey) + { + $query = parent::getAdvancedForeignKeyOptionsSQL($foreignKey); + + if (! $foreignKey->hasOption('deferrable') || $foreignKey->getOption('deferrable') === false) { + $query .= ' NOT'; + } + + $query .= ' DEFERRABLE'; + $query .= ' INITIALLY'; + + if ($foreignKey->hasOption('deferred') && $foreignKey->getOption('deferred') !== false) { + $query .= ' DEFERRED'; + } else { + $query .= ' IMMEDIATE'; + } + + return $query; + } + + /** + * {@inheritDoc} + * + * @deprecated + */ + public function supportsCreateDropDatabase() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5513', + '%s is deprecated.', + __METHOD__, + ); + + return false; + } + + /** + * {@inheritDoc} + */ + public function supportsIdentityColumns() + { + return true; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function supportsColumnCollation() + { + return true; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function supportsInlineColumnComments() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function getName() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4749', + 'SqlitePlatform::getName() is deprecated. Identify platforms by their class.', + ); + + return 'sqlite'; + } + + /** + * {@inheritDoc} + */ + public function getTruncateTableSQL($tableName, $cascade = false) + { + $tableIdentifier = new Identifier($tableName); + $tableName = $this->emulateSchemaNamespacing($tableIdentifier->getQuotedName($this)); + + return 'DELETE FROM ' . $tableName; + } + + /** + * User-defined function for Sqlite that is used with PDO::sqliteCreateFunction(). + * + * @deprecated The driver will use {@see sqrt()} in the next major release. + * + * @param int|float $value + * + * @return float + */ + public static function udfSqrt($value) + { + return sqrt($value); + } + + /** + * User-defined function for Sqlite that implements MOD(a, b). + * + * @deprecated The driver will use {@see UserDefinedFunctions::mod()} in the next major release. + * + * @param int $a + * @param int $b + * + * @return int + */ + public static function udfMod($a, $b) + { + return UserDefinedFunctions::mod($a, $b); + } + + /** + * @deprecated The driver will use {@see UserDefinedFunctions::locate()} in the next major release. + * + * @param string $str + * @param string $substr + * @param int $offset + * + * @return int + */ + public static function udfLocate($str, $substr, $offset = 0) + { + return UserDefinedFunctions::locate($str, $substr, $offset); + } + + /** + * {@inheritDoc} + */ + public function getForUpdateSQL() + { + return ''; + } + + /** + * {@inheritDoc} + * + * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. + */ + public function getInlineColumnCommentSQL($comment) + { + return '--' . str_replace("\n", "\n--", $comment) . "\n"; + } + + private function getInlineTableCommentSQL(string $comment): string + { + return $this->getInlineColumnCommentSQL($comment); + } + + /** + * {@inheritDoc} + */ + protected function initializeDoctrineTypeMappings() + { + $this->doctrineTypeMapping = [ + 'bigint' => 'bigint', + 'bigserial' => 'bigint', + 'blob' => 'blob', + 'boolean' => 'boolean', + 'char' => 'string', + 'clob' => 'text', + 'date' => 'date', + 'datetime' => 'datetime', + 'decimal' => 'decimal', + 'double' => 'float', + 'double precision' => 'float', + 'float' => 'float', + 'image' => 'string', + 'int' => 'integer', + 'integer' => 'integer', + 'longtext' => 'text', + 'longvarchar' => 'string', + 'mediumint' => 'integer', + 'mediumtext' => 'text', + 'ntext' => 'string', + 'numeric' => 'decimal', + 'nvarchar' => 'string', + 'real' => 'float', + 'serial' => 'integer', + 'smallint' => 'smallint', + 'text' => 'text', + 'time' => 'time', + 'timestamp' => 'datetime', + 'tinyint' => 'boolean', + 'tinytext' => 'text', + 'varchar' => 'string', + 'varchar2' => 'string', + ]; + } + + /** + * {@inheritDoc} + * + * @deprecated Implement {@see createReservedKeywordsList()} instead. + */ + protected function getReservedKeywordsClass() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4510', + 'SqlitePlatform::getReservedKeywordsClass() is deprecated,' + . ' use SqlitePlatform::createReservedKeywordsList() instead.', + ); + + return Keywords\SQLiteKeywords::class; + } + + /** + * {@inheritDoc} + */ + protected function getPreAlterTableIndexForeignKeySQL(TableDiff $diff) + { + return []; + } + + /** + * {@inheritDoc} + */ + protected function getPostAlterTableIndexForeignKeySQL(TableDiff $diff) + { + $table = $diff->getOldTable(); + + if (! $table instanceof Table) { + throw new Exception( + 'Sqlite platform requires for alter table the table diff with reference to original table schema', + ); + } + + $sql = []; + $tableName = $diff->getNewName(); + + if ($tableName === false) { + $tableName = $diff->getName($this); + } + + foreach ($this->getIndexesInAlteredTable($diff, $table) as $index) { + if ($index->isPrimary()) { + continue; + } + + $sql[] = $this->getCreateIndexSQL($index, $tableName->getQuotedName($this)); + } + + return $sql; + } + + /** + * {@inheritDoc} + */ + protected function doModifyLimitQuery($query, $limit, $offset) + { + if ($limit === null && $offset > 0) { + return sprintf('%s LIMIT -1 OFFSET %d', $query, $offset); + } + + return parent::doModifyLimitQuery($query, $limit, $offset); + } + + /** + * {@inheritDoc} + */ + public function getBlobTypeDeclarationSQL(array $column) + { + return 'BLOB'; + } + + /** + * {@inheritDoc} + */ + public function getTemporaryTableName($tableName) + { + $tableName = $this->emulateSchemaNamespacing($tableName); + + return $tableName; + } + + /** + * {@inheritDoc} + * + * @deprecated + * + * Sqlite Platform emulates schema by underscoring each dot and generating tables + * into the default database. + * + * This hack is implemented to be able to use SQLite as testdriver when + * using schema supporting databases. + */ + public function canEmulateSchemas() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4805', + 'SqlitePlatform::canEmulateSchemas() is deprecated.', + ); + + return $this->schemaEmulationEnabled; + } + + /** + * {@inheritDoc} + */ + public function getCreateTablesSQL(array $tables): array + { + $sql = []; + + foreach ($tables as $table) { + $sql = array_merge($sql, $this->getCreateTableSQL($table)); + } + + return $sql; + } + + /** + * {@inheritDoc} + */ + public function getDropTablesSQL(array $tables): array + { + $sql = []; + + foreach ($tables as $table) { + $sql[] = $this->getDropTableSQL($table->getQuotedName($this)); + } + + return $sql; + } + + /** + * {@inheritDoc} + */ + public function getCreatePrimaryKeySQL(Index $index, $table) + { + throw new Exception('Sqlite platform does not support alter primary key.'); + } + + /** + * {@inheritdoc} + */ + public function getCreateForeignKeySQL(ForeignKeyConstraint $foreignKey, $table) + { + throw new Exception('Sqlite platform does not support alter foreign key.'); + } + + /** + * {@inheritdoc} + */ + public function getDropForeignKeySQL($foreignKey, $table) + { + throw new Exception('Sqlite platform does not support alter foreign key.'); + } + + /** + * {@inheritDoc} + * + * @deprecated + */ + public function getCreateConstraintSQL(Constraint $constraint, $table) + { + throw new Exception('Sqlite platform does not support alter constraint.'); + } + + /** + * {@inheritDoc} + * + * @param int|null $createFlags + * @psalm-param int-mask-of|null $createFlags + */ + public function getCreateTableSQL(Table $table, $createFlags = null) + { + $createFlags = $createFlags ?? self::CREATE_INDEXES | self::CREATE_FOREIGNKEYS; + + return parent::getCreateTableSQL($table, $createFlags); + } + + /** + * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. + * + * @param string $table + * @param string|null $database + * + * @return string + */ + public function getListTableForeignKeysSQL($table, $database = null) + { + $table = $this->emulateSchemaNamespacing($table); + + return sprintf('PRAGMA foreign_key_list(%s)', $this->quoteStringLiteral($table)); + } + + /** + * {@inheritDoc} + */ + public function getAlterTableSQL(TableDiff $diff) + { + $sql = $this->getSimpleAlterTableSQL($diff); + if ($sql !== false) { + return $sql; + } + + $table = $diff->getOldTable(); + + if (! $table instanceof Table) { + throw new Exception( + 'Sqlite platform requires for alter table the table diff with reference to original table schema', + ); + } + + $columns = []; + $oldColumnNames = []; + $newColumnNames = []; + $columnSql = []; + + foreach ($table->getColumns() as $columnName => $column) { + $columnName = strtolower($columnName); + $columns[$columnName] = $column; + $oldColumnNames[$columnName] = $newColumnNames[$columnName] = $column->getQuotedName($this); + } + + foreach ($diff->getDroppedColumns() as $column) { + if ($this->onSchemaAlterTableRemoveColumn($column, $diff, $columnSql)) { + continue; + } + + $columnName = strtolower($column->getName()); + if (! isset($columns[$columnName])) { + continue; + } + + unset( + $columns[$columnName], + $oldColumnNames[$columnName], + $newColumnNames[$columnName], + ); + } + + foreach ($diff->getRenamedColumns() as $oldColumnName => $column) { + if ($this->onSchemaAlterTableRenameColumn($oldColumnName, $column, $diff, $columnSql)) { + continue; + } + + $oldColumnName = strtolower($oldColumnName); + + $columns = $this->replaceColumn( + $table->getName(), + $columns, + $oldColumnName, + $column, + ); + + if (! isset($newColumnNames[$oldColumnName])) { + continue; + } + + $newColumnNames[$oldColumnName] = $column->getQuotedName($this); + } + + foreach ($diff->getModifiedColumns() as $columnDiff) { + if ($this->onSchemaAlterTableChangeColumn($columnDiff, $diff, $columnSql)) { + continue; + } + + $oldColumn = $columnDiff->getOldColumn() ?? $columnDiff->getOldColumnName(); + + $oldColumnName = strtolower($oldColumn->getName()); + + $columns = $this->replaceColumn( + $table->getName(), + $columns, + $oldColumnName, + $columnDiff->getNewColumn(), + ); + + if (! isset($newColumnNames[$oldColumnName])) { + continue; + } + + $newColumnNames[$oldColumnName] = $columnDiff->getNewColumn()->getQuotedName($this); + } + + foreach ($diff->getAddedColumns() as $column) { + if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { + continue; + } + + $columns[strtolower($column->getName())] = $column; + } + + $sql = []; + $tableSql = []; + if (! $this->onSchemaAlterTable($diff, $tableSql)) { + $dataTable = new Table('__temp__' . $table->getName()); + + $newTable = new Table( + $table->getQuotedName($this), + $columns, + $this->getPrimaryIndexInAlteredTable($diff, $table), + [], + $this->getForeignKeysInAlteredTable($diff, $table), + $table->getOptions(), + ); + $newTable->addOption('alter', true); + + $sql = $this->getPreAlterTableIndexForeignKeySQL($diff); + + $sql[] = sprintf( + 'CREATE TEMPORARY TABLE %s AS SELECT %s FROM %s', + $dataTable->getQuotedName($this), + implode(', ', $oldColumnNames), + $table->getQuotedName($this), + ); + $sql[] = $this->getDropTableSQL($table); + + $sql = array_merge($sql, $this->getCreateTableSQL($newTable)); + $sql[] = sprintf( + 'INSERT INTO %s (%s) SELECT %s FROM %s', + $newTable->getQuotedName($this), + implode(', ', $newColumnNames), + implode(', ', $oldColumnNames), + $dataTable->getQuotedName($this), + ); + $sql[] = $this->getDropTableSQL($dataTable->getQuotedName($this)); + + $newName = $diff->getNewName(); + + if ($newName !== false) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5663', + 'Generation of "rename table" SQL using %s is deprecated. Use getRenameTableSQL() instead.', + __METHOD__, + ); + + $sql[] = sprintf( + 'ALTER TABLE %s RENAME TO %s', + $newTable->getQuotedName($this), + $newName->getQuotedName($this), + ); + } + + $sql = array_merge($sql, $this->getPostAlterTableIndexForeignKeySQL($diff)); + } + + return array_merge($sql, $tableSql, $columnSql); + } + + /** + * Replace the column with the given name with the new column. + * + * @param string $tableName + * @param array $columns + * @param string $columnName + * + * @return array + * + * @throws Exception + */ + private function replaceColumn($tableName, array $columns, $columnName, Column $column): array + { + $keys = array_keys($columns); + $index = array_search($columnName, $keys, true); + + if ($index === false) { + throw SchemaException::columnDoesNotExist($columnName, $tableName); + } + + $values = array_values($columns); + + $keys[$index] = strtolower($column->getName()); + $values[$index] = $column; + + return array_combine($keys, $values); + } + + /** + * @return string[]|false + * + * @throws Exception + */ + private function getSimpleAlterTableSQL(TableDiff $diff) + { + // Suppress changes on integer type autoincrement columns. + foreach ($diff->getModifiedColumns() as $columnDiff) { + $oldColumn = $columnDiff->getOldColumn(); + + if ($oldColumn === null) { + continue; + } + + $newColumn = $columnDiff->getNewColumn(); + + if (! $newColumn->getAutoincrement() || ! $newColumn->getType() instanceof IntegerType) { + continue; + } + + $oldColumnName = $oldColumn->getName(); + + if (! $columnDiff->hasTypeChanged() && $columnDiff->hasUnsignedChanged()) { + unset($diff->changedColumns[$oldColumnName]); + + continue; + } + + $fromColumnType = $oldColumn->getType(); + + if (! ($fromColumnType instanceof Types\SmallIntType) && ! ($fromColumnType instanceof Types\BigIntType)) { + continue; + } + + unset($diff->changedColumns[$oldColumnName]); + } + + if ( + count($diff->getModifiedColumns()) > 0 + || count($diff->getDroppedColumns()) > 0 + || count($diff->getRenamedColumns()) > 0 + || count($diff->getAddedIndexes()) > 0 + || count($diff->getModifiedIndexes()) > 0 + || count($diff->getDroppedIndexes()) > 0 + || count($diff->getRenamedIndexes()) > 0 + || count($diff->getAddedForeignKeys()) > 0 + || count($diff->getModifiedForeignKeys()) > 0 + || count($diff->getDroppedForeignKeys()) > 0 + ) { + return false; + } + + $table = $diff->getOldTable() ?? $diff->getName($this); + + $sql = []; + $tableSql = []; + $columnSql = []; + + foreach ($diff->getAddedColumns() as $column) { + if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { + continue; + } + + $definition = array_merge([ + 'unique' => null, + 'autoincrement' => null, + 'default' => null, + ], $column->toArray()); + + $type = $definition['type']; + + switch (true) { + case isset($definition['columnDefinition']) || $definition['autoincrement'] || $definition['unique']: + case $type instanceof Types\DateTimeType && $definition['default'] === $this->getCurrentTimestampSQL(): + case $type instanceof Types\DateType && $definition['default'] === $this->getCurrentDateSQL(): + case $type instanceof Types\TimeType && $definition['default'] === $this->getCurrentTimeSQL(): + return false; + } + + $definition['name'] = $column->getQuotedName($this); + if ($type instanceof Types\StringType) { + $definition['length'] ??= 255; + } + + $sql[] = 'ALTER TABLE ' . $table->getQuotedName($this) . ' ADD COLUMN ' + . $this->getColumnDeclarationSQL($definition['name'], $definition); + } + + if (! $this->onSchemaAlterTable($diff, $tableSql)) { + if ($diff->newName !== false) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5663', + 'Generation of SQL that renames a table using %s is deprecated.' + . ' Use getRenameTableSQL() instead.', + __METHOD__, + ); + + $newTable = new Identifier($diff->newName); + + $sql[] = 'ALTER TABLE ' . $table->getQuotedName($this) . ' RENAME TO ' + . $newTable->getQuotedName($this); + } + } + + return array_merge($sql, $tableSql, $columnSql); + } + + /** @return string[] */ + private function getColumnNamesInAlteredTable(TableDiff $diff, Table $fromTable): array + { + $columns = []; + + foreach ($fromTable->getColumns() as $columnName => $column) { + $columns[strtolower($columnName)] = $column->getName(); + } + + foreach ($diff->getDroppedColumns() as $column) { + $columnName = strtolower($column->getName()); + if (! isset($columns[$columnName])) { + continue; + } + + unset($columns[$columnName]); + } + + foreach ($diff->getRenamedColumns() as $oldColumnName => $column) { + $columnName = $column->getName(); + $columns[strtolower($oldColumnName)] = $columnName; + $columns[strtolower($columnName)] = $columnName; + } + + foreach ($diff->getModifiedColumns() as $columnDiff) { + $oldColumn = $columnDiff->getOldColumn() ?? $columnDiff->getOldColumnName(); + + $oldColumnName = $oldColumn->getName(); + $newColumnName = $columnDiff->getNewColumn()->getName(); + $columns[strtolower($oldColumnName)] = $newColumnName; + $columns[strtolower($newColumnName)] = $newColumnName; + } + + foreach ($diff->getAddedColumns() as $column) { + $columnName = $column->getName(); + $columns[strtolower($columnName)] = $columnName; + } + + return $columns; + } + + /** @return Index[] */ + private function getIndexesInAlteredTable(TableDiff $diff, Table $fromTable): array + { + $indexes = $fromTable->getIndexes(); + $columnNames = $this->getColumnNamesInAlteredTable($diff, $fromTable); + + foreach ($indexes as $key => $index) { + foreach ($diff->getRenamedIndexes() as $oldIndexName => $renamedIndex) { + if (strtolower($key) !== strtolower($oldIndexName)) { + continue; + } + + unset($indexes[$key]); + } + + $changed = false; + $indexColumns = []; + foreach ($index->getColumns() as $columnName) { + $normalizedColumnName = strtolower($columnName); + if (! isset($columnNames[$normalizedColumnName])) { + unset($indexes[$key]); + continue 2; + } + + $indexColumns[] = $columnNames[$normalizedColumnName]; + if ($columnName === $columnNames[$normalizedColumnName]) { + continue; + } + + $changed = true; + } + + if (! $changed) { + continue; + } + + $indexes[$key] = new Index( + $index->getName(), + $indexColumns, + $index->isUnique(), + $index->isPrimary(), + $index->getFlags(), + ); + } + + foreach ($diff->getDroppedIndexes() as $index) { + $indexName = strtolower($index->getName()); + if (strlen($indexName) === 0 || ! isset($indexes[$indexName])) { + continue; + } + + unset($indexes[$indexName]); + } + + foreach ( + array_merge( + $diff->getModifiedIndexes(), + $diff->getAddedIndexes(), + $diff->getRenamedIndexes(), + ) as $index + ) { + $indexName = strtolower($index->getName()); + if (strlen($indexName) > 0) { + $indexes[$indexName] = $index; + } else { + $indexes[] = $index; + } + } + + return $indexes; + } + + /** @return ForeignKeyConstraint[] */ + private function getForeignKeysInAlteredTable(TableDiff $diff, Table $fromTable): array + { + $foreignKeys = $fromTable->getForeignKeys(); + $columnNames = $this->getColumnNamesInAlteredTable($diff, $fromTable); + + foreach ($foreignKeys as $key => $constraint) { + $changed = false; + $localColumns = []; + foreach ($constraint->getLocalColumns() as $columnName) { + $normalizedColumnName = strtolower($columnName); + if (! isset($columnNames[$normalizedColumnName])) { + unset($foreignKeys[$key]); + continue 2; + } + + $localColumns[] = $columnNames[$normalizedColumnName]; + if ($columnName === $columnNames[$normalizedColumnName]) { + continue; + } + + $changed = true; + } + + if (! $changed) { + continue; + } + + $foreignKeys[$key] = new ForeignKeyConstraint( + $localColumns, + $constraint->getForeignTableName(), + $constraint->getForeignColumns(), + $constraint->getName(), + $constraint->getOptions(), + ); + } + + foreach ($diff->getDroppedForeignKeys() as $constraint) { + if (! $constraint instanceof ForeignKeyConstraint) { + $constraint = new Identifier($constraint); + } + + $constraintName = strtolower($constraint->getName()); + if (strlen($constraintName) === 0 || ! isset($foreignKeys[$constraintName])) { + continue; + } + + unset($foreignKeys[$constraintName]); + } + + foreach (array_merge($diff->getModifiedForeignKeys(), $diff->getAddedForeignKeys()) as $constraint) { + $constraintName = strtolower($constraint->getName()); + if (strlen($constraintName) > 0) { + $foreignKeys[$constraintName] = $constraint; + } else { + $foreignKeys[] = $constraint; + } + } + + return $foreignKeys; + } + + /** @return Index[] */ + private function getPrimaryIndexInAlteredTable(TableDiff $diff, Table $fromTable): array + { + $primaryIndex = []; + + foreach ($this->getIndexesInAlteredTable($diff, $fromTable) as $index) { + if (! $index->isPrimary()) { + continue; + } + + $primaryIndex = [$index->getName() => $index]; + } + + return $primaryIndex; + } + + public function createSchemaManager(Connection $connection): SqliteSchemaManager + { + return new SqliteSchemaManager($connection, $this); + } +} diff --git a/vendor/doctrine/dbal/src/Platforms/TrimMode.php b/vendor/doctrine/dbal/src/Platforms/TrimMode.php new file mode 100644 index 00000000..01356c0d --- /dev/null +++ b/vendor/doctrine/dbal/src/Platforms/TrimMode.php @@ -0,0 +1,21 @@ +converter = $converter; + } + + public function prepare(string $sql): DriverStatement + { + return new Statement( + parent::prepare($sql), + $this->converter, + ); + } + + public function query(string $sql): DriverResult + { + return new Result( + parent::query($sql), + $this->converter, + ); + } +} diff --git a/vendor/doctrine/dbal/src/Portability/Converter.php b/vendor/doctrine/dbal/src/Portability/Converter.php new file mode 100644 index 00000000..eb76eb78 --- /dev/null +++ b/vendor/doctrine/dbal/src/Portability/Converter.php @@ -0,0 +1,292 @@ +createConvertValue($convertEmptyStringToNull, $rightTrimString); + $convertNumeric = $this->createConvertRow($convertValue, null); + $convertAssociative = $this->createConvertRow($convertValue, $case); + + $this->convertNumeric = $this->createConvert($convertNumeric, [self::class, 'id']); + $this->convertAssociative = $this->createConvert($convertAssociative, [self::class, 'id']); + $this->convertOne = $this->createConvert($convertValue, [self::class, 'id']); + + $this->convertAllNumeric = $this->createConvertAll($convertNumeric, [self::class, 'id']); + $this->convertAllAssociative = $this->createConvertAll($convertAssociative, [self::class, 'id']); + $this->convertFirstColumn = $this->createConvertAll($convertValue, [self::class, 'id']); + } + + /** + * @param array|false $row + * + * @return list|false + */ + public function convertNumeric($row) + { + return ($this->convertNumeric)($row); + } + + /** + * @param array|false $row + * + * @return array|false + */ + public function convertAssociative($row) + { + return ($this->convertAssociative)($row); + } + + /** + * @param mixed|false $value + * + * @return mixed|false + */ + public function convertOne($value) + { + return ($this->convertOne)($value); + } + + /** + * @param list> $data + * + * @return list> + */ + public function convertAllNumeric(array $data): array + { + return ($this->convertAllNumeric)($data); + } + + /** + * @param list> $data + * + * @return list> + */ + public function convertAllAssociative(array $data): array + { + return ($this->convertAllAssociative)($data); + } + + /** + * @param list $data + * + * @return list + */ + public function convertFirstColumn(array $data): array + { + return ($this->convertFirstColumn)($data); + } + + /** + * @param T $value + * + * @return T + * + * @template T + */ + private static function id($value) + { + return $value; + } + + /** + * @param T $value + * + * @return T|null + * + * @template T + */ + private static function convertEmptyStringToNull($value) + { + if ($value === '') { + return null; + } + + return $value; + } + + /** + * @param T $value + * + * @return T|string + * @psalm-return (T is string ? string : T) + * + * @template T + */ + private static function rightTrimString($value) + { + if (! is_string($value)) { + return $value; + } + + return rtrim($value); + } + + /** + * Creates a function that will convert each individual value retrieved from the database + * + * @param bool $convertEmptyStringToNull Whether each empty string should be converted to NULL + * @param bool $rightTrimString Whether each string should right-trimmed + * + * @return callable|null The resulting function or NULL if no conversion is needed + */ + private function createConvertValue(bool $convertEmptyStringToNull, bool $rightTrimString): ?callable + { + $functions = []; + + if ($convertEmptyStringToNull) { + $functions[] = [self::class, 'convertEmptyStringToNull']; + } + + if ($rightTrimString) { + $functions[] = [self::class, 'rightTrimString']; + } + + return $this->compose(...$functions); + } + + /** + * Creates a function that will convert each array-row retrieved from the database + * + * @param callable|null $function The function that will convert each value + * @param int|null $case Column name case + * + * @return callable|null The resulting function or NULL if no conversion is needed + */ + private function createConvertRow(?callable $function, ?int $case): ?callable + { + $functions = []; + + if ($function !== null) { + $functions[] = $this->createMapper($function); + } + + if ($case !== null) { + $functions[] = static function (array $row) use ($case): array { + return array_change_key_case($row, $case); + }; + } + + return $this->compose(...$functions); + } + + /** + * Creates a function that will be applied to the return value of Statement::fetch*() + * or an identity function if no conversion is needed + * + * @param callable|null $function The function that will convert each tow + * @param callable $id Identity function + */ + private function createConvert(?callable $function, callable $id): callable + { + if ($function === null) { + return $id; + } + + return /** + * @param T $value + * + * @psalm-return (T is false ? false : T) + * + * @template T + */ + static function ($value) use ($function) { + if ($value === false) { + return false; + } + + return $function($value); + }; + } + + /** + * Creates a function that will be applied to the return value of Statement::fetchAll*() + * or an identity function if no transformation is required + * + * @param callable|null $function The function that will transform each value + * @param callable $id Identity function + */ + private function createConvertAll(?callable $function, callable $id): callable + { + if ($function === null) { + return $id; + } + + return $this->createMapper($function); + } + + /** + * Creates a function that maps each value of the array using the given function + * + * @param callable $function The function that maps each value of the array + */ + private function createMapper(callable $function): callable + { + return static function (array $array) use ($function): array { + return array_map($function, $array); + }; + } + + /** + * Creates a composition of the given set of functions + * + * @param callable(T):T ...$functions The functions to compose + * + * @return callable(T):T|null + * + * @template T + */ + private function compose(callable ...$functions): ?callable + { + return array_reduce($functions, static function (?callable $carry, callable $item): callable { + if ($carry === null) { + return $item; + } + + return /** + * @param T $value + * + * @return T + * + * @template T + */ + static function ($value) use ($carry, $item) { + return $item($carry($value)); + }; + }); + } +} diff --git a/vendor/doctrine/dbal/src/Portability/Driver.php b/vendor/doctrine/dbal/src/Portability/Driver.php new file mode 100644 index 00000000..2425dde0 --- /dev/null +++ b/vendor/doctrine/dbal/src/Portability/Driver.php @@ -0,0 +1,73 @@ +mode = $mode; + $this->case = $case; + } + + /** + * {@inheritDoc} + */ + public function connect(array $params) + { + $connection = parent::connect($params); + + $portability = (new OptimizeFlags())( + $this->getDatabasePlatform(), + $this->mode, + ); + + $case = null; + + if ($this->case !== 0 && ($portability & Connection::PORTABILITY_FIX_CASE) !== 0) { + $nativeConnection = null; + if (method_exists($connection, 'getNativeConnection')) { + try { + $nativeConnection = $connection->getNativeConnection(); + } catch (LogicException $e) { + } + } + + if ($nativeConnection instanceof PDO) { + $portability &= ~Connection::PORTABILITY_FIX_CASE; + $nativeConnection->setAttribute(PDO::ATTR_CASE, $this->case); + } else { + $case = $this->case === ColumnCase::LOWER ? CASE_LOWER : CASE_UPPER; + } + } + + $convertEmptyStringToNull = ($portability & Connection::PORTABILITY_EMPTY_TO_NULL) !== 0; + $rightTrimString = ($portability & Connection::PORTABILITY_RTRIM) !== 0; + + if (! $convertEmptyStringToNull && ! $rightTrimString && $case === null) { + return $connection; + } + + return new Connection( + $connection, + new Converter($convertEmptyStringToNull, $rightTrimString, $case), + ); + } +} diff --git a/vendor/doctrine/dbal/src/Portability/Middleware.php b/vendor/doctrine/dbal/src/Portability/Middleware.php new file mode 100644 index 00000000..6e4bea2f --- /dev/null +++ b/vendor/doctrine/dbal/src/Portability/Middleware.php @@ -0,0 +1,30 @@ +mode = $mode; + $this->case = $case; + } + + public function wrap(DriverInterface $driver): DriverInterface + { + if ($this->mode !== 0) { + return new Driver($driver, $this->mode, $this->case); + } + + return $driver; + } +} diff --git a/vendor/doctrine/dbal/src/Portability/OptimizeFlags.php b/vendor/doctrine/dbal/src/Portability/OptimizeFlags.php new file mode 100644 index 00000000..09f52831 --- /dev/null +++ b/vendor/doctrine/dbal/src/Portability/OptimizeFlags.php @@ -0,0 +1,42 @@ + + */ + private static array $platforms = [ + DB2Platform::class => 0, + OraclePlatform::class => Connection::PORTABILITY_EMPTY_TO_NULL, + PostgreSQLPlatform::class => 0, + SqlitePlatform::class => 0, + SQLServerPlatform::class => 0, + ]; + + public function __invoke(AbstractPlatform $platform, int $flags): int + { + foreach (self::$platforms as $class => $mask) { + if ($platform instanceof $class) { + $flags &= ~$mask; + + break; + } + } + + return $flags; + } +} diff --git a/vendor/doctrine/dbal/src/Portability/Result.php b/vendor/doctrine/dbal/src/Portability/Result.php new file mode 100644 index 00000000..da1eca98 --- /dev/null +++ b/vendor/doctrine/dbal/src/Portability/Result.php @@ -0,0 +1,81 @@ +converter = $converter; + } + + /** + * {@inheritDoc} + */ + public function fetchNumeric() + { + return $this->converter->convertNumeric( + parent::fetchNumeric(), + ); + } + + /** + * {@inheritDoc} + */ + public function fetchAssociative() + { + return $this->converter->convertAssociative( + parent::fetchAssociative(), + ); + } + + /** + * {@inheritDoc} + */ + public function fetchOne() + { + return $this->converter->convertOne( + parent::fetchOne(), + ); + } + + /** + * {@inheritDoc} + */ + public function fetchAllNumeric(): array + { + return $this->converter->convertAllNumeric( + parent::fetchAllNumeric(), + ); + } + + /** + * {@inheritDoc} + */ + public function fetchAllAssociative(): array + { + return $this->converter->convertAllAssociative( + parent::fetchAllAssociative(), + ); + } + + /** + * {@inheritDoc} + */ + public function fetchFirstColumn(): array + { + return $this->converter->convertFirstColumn( + parent::fetchFirstColumn(), + ); + } +} diff --git a/vendor/doctrine/dbal/src/Portability/Statement.php b/vendor/doctrine/dbal/src/Portability/Statement.php new file mode 100644 index 00000000..9b3e74f5 --- /dev/null +++ b/vendor/doctrine/dbal/src/Portability/Statement.php @@ -0,0 +1,36 @@ +Statement and applies portability measures. + */ + public function __construct(DriverStatement $stmt, Converter $converter) + { + parent::__construct($stmt); + + $this->converter = $converter; + } + + /** + * {@inheritdoc} + */ + public function execute($params = null): ResultInterface + { + return new Result( + parent::execute($params), + $this->converter, + ); + } +} diff --git a/vendor/doctrine/dbal/src/Query.php b/vendor/doctrine/dbal/src/Query.php new file mode 100644 index 00000000..bfc9b14e --- /dev/null +++ b/vendor/doctrine/dbal/src/Query.php @@ -0,0 +1,64 @@ + + */ + private array $params; + + /** + * The types of the parameters bound to the query. + * + * @var array + */ + private array $types; + + /** + * @param array $params + * @param array $types + * + * @psalm-suppress ImpurePropertyAssignment + */ + public function __construct(string $sql, array $params, array $types) + { + $this->sql = $sql; + $this->params = $params; + $this->types = $types; + } + + public function getSQL(): string + { + return $this->sql; + } + + /** @return array */ + public function getParams(): array + { + return $this->params; + } + + /** @return array */ + public function getTypes(): array + { + return $this->types; + } +} diff --git a/vendor/doctrine/dbal/src/Query/Expression/CompositeExpression.php b/vendor/doctrine/dbal/src/Query/Expression/CompositeExpression.php new file mode 100644 index 00000000..de1d929a --- /dev/null +++ b/vendor/doctrine/dbal/src/Query/Expression/CompositeExpression.php @@ -0,0 +1,182 @@ +type = $type; + + $this->addMultiple($parts); + + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/3864', + 'Do not use CompositeExpression constructor directly, use static and() and or() factory methods.', + ); + } + + /** + * @param self|string $part + * @param self|string ...$parts + */ + public static function and($part, ...$parts): self + { + return new self(self::TYPE_AND, array_merge([$part], $parts)); + } + + /** + * @param self|string $part + * @param self|string ...$parts + */ + public static function or($part, ...$parts): self + { + return new self(self::TYPE_OR, array_merge([$part], $parts)); + } + + /** + * Adds multiple parts to composite expression. + * + * @deprecated This class will be made immutable. Use with() instead. + * + * @param self[]|string[] $parts + * + * @return CompositeExpression + */ + public function addMultiple(array $parts = []) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3844', + 'CompositeExpression::addMultiple() is deprecated, use CompositeExpression::with() instead.', + ); + + foreach ($parts as $part) { + $this->add($part); + } + + return $this; + } + + /** + * Adds an expression to composite expression. + * + * @deprecated This class will be made immutable. Use with() instead. + * + * @param mixed $part + * + * @return CompositeExpression + */ + public function add($part) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3844', + 'CompositeExpression::add() is deprecated, use CompositeExpression::with() instead.', + ); + + if ($part === null) { + return $this; + } + + if ($part instanceof self && count($part) === 0) { + return $this; + } + + $this->parts[] = $part; + + return $this; + } + + /** + * Returns a new CompositeExpression with the given parts added. + * + * @param self|string $part + * @param self|string ...$parts + */ + public function with($part, ...$parts): self + { + $that = clone $this; + + $that->parts = array_merge($that->parts, [$part], $parts); + + return $that; + } + + /** + * Retrieves the amount of expressions on composite expression. + * + * @return int + */ + #[ReturnTypeWillChange] + public function count() + { + return count($this->parts); + } + + /** + * Retrieves the string representation of this composite expression. + * + * @return string + */ + public function __toString() + { + if ($this->count() === 1) { + return (string) $this->parts[0]; + } + + return '(' . implode(') ' . $this->type . ' (', $this->parts) . ')'; + } + + /** + * Returns the type of this composite expression (AND/OR). + * + * @return string + */ + public function getType() + { + return $this->type; + } +} diff --git a/vendor/doctrine/dbal/src/Query/Expression/ExpressionBuilder.php b/vendor/doctrine/dbal/src/Query/Expression/ExpressionBuilder.php new file mode 100644 index 00000000..d532b289 --- /dev/null +++ b/vendor/doctrine/dbal/src/Query/Expression/ExpressionBuilder.php @@ -0,0 +1,323 @@ +'; + public const LT = '<'; + public const LTE = '<='; + public const GT = '>'; + public const GTE = '>='; + + /** + * The DBAL Connection. + */ + private Connection $connection; + + /** + * Initializes a new ExpressionBuilder. + * + * @param Connection $connection The DBAL Connection. + */ + public function __construct(Connection $connection) + { + $this->connection = $connection; + } + + /** + * Creates a conjunction of the given expressions. + * + * @param string|CompositeExpression $expression + * @param string|CompositeExpression ...$expressions + */ + public function and($expression, ...$expressions): CompositeExpression + { + return CompositeExpression::and($expression, ...$expressions); + } + + /** + * Creates a disjunction of the given expressions. + * + * @param string|CompositeExpression $expression + * @param string|CompositeExpression ...$expressions + */ + public function or($expression, ...$expressions): CompositeExpression + { + return CompositeExpression::or($expression, ...$expressions); + } + + /** + * @deprecated Use `and()` instead. + * + * @param mixed $x Optional clause. Defaults = null, but requires + * at least one defined when converting to string. + * + * @return CompositeExpression + */ + public function andX($x = null) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/3851', + 'ExpressionBuilder::andX() is deprecated, use ExpressionBuilder::and() instead.', + ); + + return new CompositeExpression(CompositeExpression::TYPE_AND, func_get_args()); + } + + /** + * @deprecated Use `or()` instead. + * + * @param mixed $x Optional clause. Defaults = null, but requires + * at least one defined when converting to string. + * + * @return CompositeExpression + */ + public function orX($x = null) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/3851', + 'ExpressionBuilder::orX() is deprecated, use ExpressionBuilder::or() instead.', + ); + + return new CompositeExpression(CompositeExpression::TYPE_OR, func_get_args()); + } + + /** + * Creates a comparison expression. + * + * @param mixed $x The left expression. + * @param string $operator One of the ExpressionBuilder::* constants. + * @param mixed $y The right expression. + * + * @return string + */ + public function comparison($x, $operator, $y) + { + return $x . ' ' . $operator . ' ' . $y; + } + + /** + * Creates an equality comparison expression with the given arguments. + * + * First argument is considered the left expression and the second is the right expression. + * When converted to string, it will generated a = . Example: + * + * [php] + * // u.id = ? + * $expr->eq('u.id', '?'); + * + * @param mixed $x The left expression. + * @param mixed $y The right expression. + * + * @return string + */ + public function eq($x, $y) + { + return $this->comparison($x, self::EQ, $y); + } + + /** + * Creates a non equality comparison expression with the given arguments. + * First argument is considered the left expression and the second is the right expression. + * When converted to string, it will generated a <> . Example: + * + * [php] + * // u.id <> 1 + * $q->where($q->expr()->neq('u.id', '1')); + * + * @param mixed $x The left expression. + * @param mixed $y The right expression. + * + * @return string + */ + public function neq($x, $y) + { + return $this->comparison($x, self::NEQ, $y); + } + + /** + * Creates a lower-than comparison expression with the given arguments. + * First argument is considered the left expression and the second is the right expression. + * When converted to string, it will generated a < . Example: + * + * [php] + * // u.id < ? + * $q->where($q->expr()->lt('u.id', '?')); + * + * @param mixed $x The left expression. + * @param mixed $y The right expression. + * + * @return string + */ + public function lt($x, $y) + { + return $this->comparison($x, self::LT, $y); + } + + /** + * Creates a lower-than-equal comparison expression with the given arguments. + * First argument is considered the left expression and the second is the right expression. + * When converted to string, it will generated a <= . Example: + * + * [php] + * // u.id <= ? + * $q->where($q->expr()->lte('u.id', '?')); + * + * @param mixed $x The left expression. + * @param mixed $y The right expression. + * + * @return string + */ + public function lte($x, $y) + { + return $this->comparison($x, self::LTE, $y); + } + + /** + * Creates a greater-than comparison expression with the given arguments. + * First argument is considered the left expression and the second is the right expression. + * When converted to string, it will generated a > . Example: + * + * [php] + * // u.id > ? + * $q->where($q->expr()->gt('u.id', '?')); + * + * @param mixed $x The left expression. + * @param mixed $y The right expression. + * + * @return string + */ + public function gt($x, $y) + { + return $this->comparison($x, self::GT, $y); + } + + /** + * Creates a greater-than-equal comparison expression with the given arguments. + * First argument is considered the left expression and the second is the right expression. + * When converted to string, it will generated a >= . Example: + * + * [php] + * // u.id >= ? + * $q->where($q->expr()->gte('u.id', '?')); + * + * @param mixed $x The left expression. + * @param mixed $y The right expression. + * + * @return string + */ + public function gte($x, $y) + { + return $this->comparison($x, self::GTE, $y); + } + + /** + * Creates an IS NULL expression with the given arguments. + * + * @param string $x The expression to be restricted by IS NULL. + * + * @return string + */ + public function isNull($x) + { + return $x . ' IS NULL'; + } + + /** + * Creates an IS NOT NULL expression with the given arguments. + * + * @param string $x The expression to be restricted by IS NOT NULL. + * + * @return string + */ + public function isNotNull($x) + { + return $x . ' IS NOT NULL'; + } + + /** + * Creates a LIKE() comparison expression with the given arguments. + * + * @param string $x The expression to be inspected by the LIKE comparison + * @param mixed $y The pattern to compare against + * + * @return string + */ + public function like($x, $y/*, ?string $escapeChar = null */) + { + return $this->comparison($x, 'LIKE', $y) . + (func_num_args() >= 3 ? sprintf(' ESCAPE %s', func_get_arg(2)) : ''); + } + + /** + * Creates a NOT LIKE() comparison expression with the given arguments. + * + * @param string $x The expression to be inspected by the NOT LIKE comparison + * @param mixed $y The pattern to compare against + * + * @return string + */ + public function notLike($x, $y/*, ?string $escapeChar = null */) + { + return $this->comparison($x, 'NOT LIKE', $y) . + (func_num_args() >= 3 ? sprintf(' ESCAPE %s', func_get_arg(2)) : ''); + } + + /** + * Creates an IN () comparison expression with the given arguments. + * + * @param string $x The SQL expression to be matched against the set. + * @param string|string[] $y The SQL expression or an array of SQL expressions representing the set. + * + * @return string + */ + public function in($x, $y) + { + return $this->comparison($x, 'IN', '(' . implode(', ', (array) $y) . ')'); + } + + /** + * Creates a NOT IN () comparison expression with the given arguments. + * + * @param string $x The SQL expression to be matched against the set. + * @param string|string[] $y The SQL expression or an array of SQL expressions representing the set. + * + * @return string + */ + public function notIn($x, $y) + { + return $this->comparison($x, 'NOT IN', '(' . implode(', ', (array) $y) . ')'); + } + + /** + * Builds an SQL literal from a given input parameter. + * + * The usage of this method is discouraged. Use prepared statements + * or {@see AbstractPlatform::quoteStringLiteral()} instead. + * + * @param mixed $input The parameter to be quoted. + * @param int|null $type The type of the parameter. + * + * @return string + */ + public function literal($input, $type = null) + { + return $this->connection->quote($input, $type); + } +} diff --git a/vendor/doctrine/dbal/src/Query/QueryBuilder.php b/vendor/doctrine/dbal/src/Query/QueryBuilder.php new file mode 100644 index 00000000..5fa722d6 --- /dev/null +++ b/vendor/doctrine/dbal/src/Query/QueryBuilder.php @@ -0,0 +1,1622 @@ + [], + 'distinct' => false, + 'from' => [], + 'join' => [], + 'set' => [], + 'where' => null, + 'groupBy' => [], + 'having' => null, + 'orderBy' => [], + 'values' => [], + ]; + + /** + * The array of SQL parts collected. + * + * @var mixed[] + */ + private array $sqlParts = self::SQL_PARTS_DEFAULTS; + + /** + * The complete SQL string for this query. + */ + private ?string $sql = null; + + /** + * The query parameters. + * + * @var list|array + */ + private $params = []; + + /** + * The parameter type map of this query. + * + * @var array|array + */ + private array $paramTypes = []; + + /** + * The type of query this is. Can be select, update or delete. + */ + private int $type = self::SELECT; + + /** + * The state of the query object. Can be dirty or clean. + */ + private int $state = self::STATE_CLEAN; + + /** + * The index of the first result to retrieve. + */ + private int $firstResult = 0; + + /** + * The maximum number of results to retrieve or NULL to retrieve all results. + */ + private ?int $maxResults = null; + + /** + * The counter of bound parameters used with {@see bindValue). + */ + private int $boundCounter = 0; + + /** + * The query cache profile used for caching results. + */ + private ?QueryCacheProfile $resultCacheProfile = null; + + /** + * Initializes a new QueryBuilder. + * + * @param Connection $connection The DBAL Connection. + */ + public function __construct(Connection $connection) + { + $this->connection = $connection; + } + + /** + * Gets an ExpressionBuilder used for object-oriented construction of query expressions. + * This producer method is intended for convenient inline usage. Example: + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u') + * ->from('users', 'u') + * ->where($qb->expr()->eq('u.id', 1)); + * + * + * For more complex expression construction, consider storing the expression + * builder object in a local variable. + * + * @return ExpressionBuilder + */ + public function expr() + { + return $this->connection->getExpressionBuilder(); + } + + /** + * Gets the type of the currently built query. + * + * @deprecated If necessary, track the type of the query being built outside of the builder. + * + * @return int + */ + public function getType() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5551', + 'Relying on the type of the query being built is deprecated.' + . ' If necessary, track the type of the query being built outside of the builder.', + ); + + return $this->type; + } + + /** + * Gets the associated DBAL Connection for this query builder. + * + * @deprecated Use the connection used to instantiate the builder instead. + * + * @return Connection + */ + public function getConnection() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5780', + '%s is deprecated. Use the connection used to instantiate the builder instead.', + __METHOD__, + ); + + return $this->connection; + } + + /** + * Gets the state of this query builder instance. + * + * @deprecated The builder state is an internal concern. + * + * @return int Either QueryBuilder::STATE_DIRTY or QueryBuilder::STATE_CLEAN. + */ + public function getState() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5551', + 'Relying on the query builder state is deprecated as it is an internal concern.', + ); + + return $this->state; + } + + /** + * Prepares and executes an SQL query and returns the first row of the result + * as an associative array. + * + * @return array|false False is returned if no rows are found. + * + * @throws Exception + */ + public function fetchAssociative() + { + return $this->executeQuery()->fetchAssociative(); + } + + /** + * Prepares and executes an SQL query and returns the first row of the result + * as a numerically indexed array. + * + * @return array|false False is returned if no rows are found. + * + * @throws Exception + */ + public function fetchNumeric() + { + return $this->executeQuery()->fetchNumeric(); + } + + /** + * Prepares and executes an SQL query and returns the value of a single column + * of the first row of the result. + * + * @return mixed|false False is returned if no rows are found. + * + * @throws Exception + */ + public function fetchOne() + { + return $this->executeQuery()->fetchOne(); + } + + /** + * Prepares and executes an SQL query and returns the result as an array of numeric arrays. + * + * @return array> + * + * @throws Exception + */ + public function fetchAllNumeric(): array + { + return $this->executeQuery()->fetchAllNumeric(); + } + + /** + * Prepares and executes an SQL query and returns the result as an array of associative arrays. + * + * @return array> + * + * @throws Exception + */ + public function fetchAllAssociative(): array + { + return $this->executeQuery()->fetchAllAssociative(); + } + + /** + * Prepares and executes an SQL query and returns the result as an associative array with the keys + * mapped to the first column and the values mapped to the second column. + * + * @return array + * + * @throws Exception + */ + public function fetchAllKeyValue(): array + { + return $this->executeQuery()->fetchAllKeyValue(); + } + + /** + * Prepares and executes an SQL query and returns the result as an associative array with the keys mapped + * to the first column and the values being an associative array representing the rest of the columns + * and their values. + * + * @return array> + * + * @throws Exception + */ + public function fetchAllAssociativeIndexed(): array + { + return $this->executeQuery()->fetchAllAssociativeIndexed(); + } + + /** + * Prepares and executes an SQL query and returns the result as an array of the first column values. + * + * @return array + * + * @throws Exception + */ + public function fetchFirstColumn(): array + { + return $this->executeQuery()->fetchFirstColumn(); + } + + /** + * Executes an SQL query (SELECT) and returns a Result. + * + * @throws Exception + */ + public function executeQuery(): Result + { + return $this->connection->executeQuery( + $this->getSQL(), + $this->params, + $this->paramTypes, + $this->resultCacheProfile, + ); + } + + /** + * Executes an SQL statement and returns the number of affected rows. + * + * Should be used for INSERT, UPDATE and DELETE + * + * @return int The number of affected rows. + * + * @throws Exception + */ + public function executeStatement(): int + { + return $this->connection->executeStatement($this->getSQL(), $this->params, $this->paramTypes); + } + + /** + * Executes this query using the bound parameters and their types. + * + * @deprecated Use {@see executeQuery()} or {@see executeStatement()} instead. + * + * @return Result|int|string + * + * @throws Exception + */ + public function execute() + { + if ($this->type === self::SELECT) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4578', + 'QueryBuilder::execute() is deprecated, use QueryBuilder::executeQuery() for SQL queries instead.', + ); + + return $this->executeQuery(); + } + + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4578', + 'QueryBuilder::execute() is deprecated, use QueryBuilder::executeStatement() for SQL statements instead.', + ); + + return $this->connection->executeStatement($this->getSQL(), $this->params, $this->paramTypes); + } + + /** + * Gets the complete SQL string formed by the current specifications of this QueryBuilder. + * + * + * $qb = $em->createQueryBuilder() + * ->select('u') + * ->from('User', 'u') + * echo $qb->getSQL(); // SELECT u FROM User u + * + * + * @return string The SQL query string. + */ + public function getSQL() + { + if ($this->sql !== null && $this->state === self::STATE_CLEAN) { + return $this->sql; + } + + switch ($this->type) { + case self::INSERT: + $sql = $this->getSQLForInsert(); + break; + + case self::DELETE: + $sql = $this->getSQLForDelete(); + break; + + case self::UPDATE: + $sql = $this->getSQLForUpdate(); + break; + + case self::SELECT: + default: + $sql = $this->getSQLForSelect(); + break; + } + + $this->state = self::STATE_CLEAN; + $this->sql = $sql; + + return $sql; + } + + /** + * Sets a query parameter for the query being constructed. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u') + * ->from('users', 'u') + * ->where('u.id = :user_id') + * ->setParameter('user_id', 1); + * + * + * @param int|string $key Parameter position or name + * @param mixed $value Parameter value + * @param int|string|Type|null $type Parameter type + * + * @return $this This QueryBuilder instance. + */ + public function setParameter($key, $value, $type = ParameterType::STRING) + { + if ($type !== null) { + $this->paramTypes[$key] = $type; + } else { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5550', + 'Using NULL as prepared statement parameter type is deprecated.' + . 'Omit or use Parameter::STRING instead', + ); + } + + $this->params[$key] = $value; + + return $this; + } + + /** + * Sets a collection of query parameters for the query being constructed. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u') + * ->from('users', 'u') + * ->where('u.id = :user_id1 OR u.id = :user_id2') + * ->setParameters(array( + * 'user_id1' => 1, + * 'user_id2' => 2 + * )); + * + * + * @param list|array $params Parameters to set + * @param array|array $types Parameter types + * + * @return $this This QueryBuilder instance. + */ + public function setParameters(array $params, array $types = []) + { + $this->paramTypes = $types; + $this->params = $params; + + return $this; + } + + /** + * Gets all defined query parameters for the query being constructed indexed by parameter index or name. + * + * @return list|array The currently defined query parameters + */ + public function getParameters() + { + return $this->params; + } + + /** + * Gets a (previously set) query parameter of the query being constructed. + * + * @param mixed $key The key (index or name) of the bound parameter. + * + * @return mixed The value of the bound parameter. + */ + public function getParameter($key) + { + return $this->params[$key] ?? null; + } + + /** + * Gets all defined query parameter types for the query being constructed indexed by parameter index or name. + * + * @return array|array The currently defined + * query parameter types + */ + public function getParameterTypes() + { + return $this->paramTypes; + } + + /** + * Gets a (previously set) query parameter type of the query being constructed. + * + * @param int|string $key The key of the bound parameter type + * + * @return int|string|Type The value of the bound parameter type + */ + public function getParameterType($key) + { + return $this->paramTypes[$key] ?? ParameterType::STRING; + } + + /** + * Sets the position of the first result to retrieve (the "offset"). + * + * @param int $firstResult The first result to return. + * + * @return $this This QueryBuilder instance. + */ + public function setFirstResult($firstResult) + { + $this->state = self::STATE_DIRTY; + $this->firstResult = $firstResult; + + return $this; + } + + /** + * Gets the position of the first result the query object was set to retrieve (the "offset"). + * + * @return int The position of the first result. + */ + public function getFirstResult() + { + return $this->firstResult; + } + + /** + * Sets the maximum number of results to retrieve (the "limit"). + * + * @param int|null $maxResults The maximum number of results to retrieve or NULL to retrieve all results. + * + * @return $this This QueryBuilder instance. + */ + public function setMaxResults($maxResults) + { + $this->state = self::STATE_DIRTY; + $this->maxResults = $maxResults; + + return $this; + } + + /** + * Gets the maximum number of results the query object was set to retrieve (the "limit"). + * Returns NULL if all results will be returned. + * + * @return int|null The maximum number of results. + */ + public function getMaxResults() + { + return $this->maxResults; + } + + /** + * Either appends to or replaces a single, generic query part. + * + * The available parts are: 'select', 'from', 'set', 'where', + * 'groupBy', 'having' and 'orderBy'. + * + * @param string $sqlPartName + * @param mixed $sqlPart + * @param bool $append + * + * @return $this This QueryBuilder instance. + */ + public function add($sqlPartName, $sqlPart, $append = false) + { + $isArray = is_array($sqlPart); + $isMultiple = is_array($this->sqlParts[$sqlPartName]); + + if ($isMultiple && ! $isArray) { + $sqlPart = [$sqlPart]; + } + + $this->state = self::STATE_DIRTY; + + if ($append) { + if ( + $sqlPartName === 'orderBy' + || $sqlPartName === 'groupBy' + || $sqlPartName === 'select' + || $sqlPartName === 'set' + ) { + foreach ($sqlPart as $part) { + $this->sqlParts[$sqlPartName][] = $part; + } + } elseif ($isArray && is_array($sqlPart[key($sqlPart)])) { + $key = key($sqlPart); + $this->sqlParts[$sqlPartName][$key][] = $sqlPart[$key]; + } elseif ($isMultiple) { + $this->sqlParts[$sqlPartName][] = $sqlPart; + } else { + $this->sqlParts[$sqlPartName] = $sqlPart; + } + + return $this; + } + + $this->sqlParts[$sqlPartName] = $sqlPart; + + return $this; + } + + /** + * Specifies an item that is to be returned in the query result. + * Replaces any previously specified selections, if any. + * + * USING AN ARRAY ARGUMENT IS DEPRECATED. Pass each value as an individual argument. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u.id', 'p.id') + * ->from('users', 'u') + * ->leftJoin('u', 'phonenumbers', 'p', 'u.id = p.user_id'); + * + * + * @param string|string[]|null $select The selection expression. USING AN ARRAY OR NULL IS DEPRECATED. + * Pass each value as an individual argument. + * + * @return $this This QueryBuilder instance. + */ + public function select($select = null/*, string ...$selects*/) + { + $this->type = self::SELECT; + + if ($select === null) { + return $this; + } + + if (is_array($select)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3837', + 'Passing an array for the first argument to QueryBuilder::select() is deprecated, ' . + 'pass each value as an individual variadic argument instead.', + ); + } + + $selects = is_array($select) ? $select : func_get_args(); + + return $this->add('select', $selects); + } + + /** + * Adds DISTINCT to the query. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u.id') + * ->distinct() + * ->from('users', 'u') + * + * + * @return $this This QueryBuilder instance. + */ + public function distinct(): self + { + $this->sqlParts['distinct'] = true; + + return $this; + } + + /** + * Adds an item that is to be returned in the query result. + * + * USING AN ARRAY ARGUMENT IS DEPRECATED. Pass each value as an individual argument. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u.id') + * ->addSelect('p.id') + * ->from('users', 'u') + * ->leftJoin('u', 'phonenumbers', 'u.id = p.user_id'); + * + * + * @param string|string[]|null $select The selection expression. USING AN ARRAY OR NULL IS DEPRECATED. + * Pass each value as an individual argument. + * + * @return $this This QueryBuilder instance. + */ + public function addSelect($select = null/*, string ...$selects*/) + { + $this->type = self::SELECT; + + if ($select === null) { + return $this; + } + + if (is_array($select)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3837', + 'Passing an array for the first argument to QueryBuilder::addSelect() is deprecated, ' . + 'pass each value as an individual variadic argument instead.', + ); + } + + $selects = is_array($select) ? $select : func_get_args(); + + return $this->add('select', $selects, true); + } + + /** + * Turns the query being built into a bulk delete query that ranges over + * a certain table. + * + * + * $qb = $conn->createQueryBuilder() + * ->delete('users', 'u') + * ->where('u.id = :user_id') + * ->setParameter(':user_id', 1); + * + * + * @param string $delete The table whose rows are subject to the deletion. + * @param string $alias The table alias used in the constructed query. + * + * @return $this This QueryBuilder instance. + */ + public function delete($delete = null, $alias = null) + { + $this->type = self::DELETE; + + if ($delete === null) { + return $this; + } + + return $this->add('from', [ + 'table' => $delete, + 'alias' => $alias, + ]); + } + + /** + * Turns the query being built into a bulk update query that ranges over + * a certain table + * + * + * $qb = $conn->createQueryBuilder() + * ->update('counters', 'c') + * ->set('c.value', 'c.value + 1') + * ->where('c.id = ?'); + * + * + * @param string $update The table whose rows are subject to the update. + * @param string $alias The table alias used in the constructed query. + * + * @return $this This QueryBuilder instance. + */ + public function update($update = null, $alias = null) + { + $this->type = self::UPDATE; + + if ($update === null) { + return $this; + } + + return $this->add('from', [ + 'table' => $update, + 'alias' => $alias, + ]); + } + + /** + * Turns the query being built into an insert query that inserts into + * a certain table + * + * + * $qb = $conn->createQueryBuilder() + * ->insert('users') + * ->values( + * array( + * 'name' => '?', + * 'password' => '?' + * ) + * ); + * + * + * @param string $insert The table into which the rows should be inserted. + * + * @return $this This QueryBuilder instance. + */ + public function insert($insert = null) + { + $this->type = self::INSERT; + + if ($insert === null) { + return $this; + } + + return $this->add('from', ['table' => $insert]); + } + + /** + * Creates and adds a query root corresponding to the table identified by the + * given alias, forming a cartesian product with any existing query roots. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u.id') + * ->from('users', 'u') + * + * + * @param string $from The table. + * @param string|null $alias The alias of the table. + * + * @return $this This QueryBuilder instance. + */ + public function from($from, $alias = null) + { + return $this->add('from', [ + 'table' => $from, + 'alias' => $alias, + ], true); + } + + /** + * Creates and adds a join to the query. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u.name') + * ->from('users', 'u') + * ->join('u', 'phonenumbers', 'p', 'p.is_primary = 1'); + * + * + * @param string $fromAlias The alias that points to a from clause. + * @param string $join The table name to join. + * @param string $alias The alias of the join table. + * @param string $condition The condition for the join. + * + * @return $this This QueryBuilder instance. + */ + public function join($fromAlias, $join, $alias, $condition = null) + { + return $this->innerJoin($fromAlias, $join, $alias, $condition); + } + + /** + * Creates and adds a join to the query. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u.name') + * ->from('users', 'u') + * ->innerJoin('u', 'phonenumbers', 'p', 'p.is_primary = 1'); + * + * + * @param string $fromAlias The alias that points to a from clause. + * @param string $join The table name to join. + * @param string $alias The alias of the join table. + * @param string $condition The condition for the join. + * + * @return $this This QueryBuilder instance. + */ + public function innerJoin($fromAlias, $join, $alias, $condition = null) + { + return $this->add('join', [ + $fromAlias => [ + 'joinType' => 'inner', + 'joinTable' => $join, + 'joinAlias' => $alias, + 'joinCondition' => $condition, + ], + ], true); + } + + /** + * Creates and adds a left join to the query. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u.name') + * ->from('users', 'u') + * ->leftJoin('u', 'phonenumbers', 'p', 'p.is_primary = 1'); + * + * + * @param string $fromAlias The alias that points to a from clause. + * @param string $join The table name to join. + * @param string $alias The alias of the join table. + * @param string $condition The condition for the join. + * + * @return $this This QueryBuilder instance. + */ + public function leftJoin($fromAlias, $join, $alias, $condition = null) + { + return $this->add('join', [ + $fromAlias => [ + 'joinType' => 'left', + 'joinTable' => $join, + 'joinAlias' => $alias, + 'joinCondition' => $condition, + ], + ], true); + } + + /** + * Creates and adds a right join to the query. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u.name') + * ->from('users', 'u') + * ->rightJoin('u', 'phonenumbers', 'p', 'p.is_primary = 1'); + * + * + * @param string $fromAlias The alias that points to a from clause. + * @param string $join The table name to join. + * @param string $alias The alias of the join table. + * @param string $condition The condition for the join. + * + * @return $this This QueryBuilder instance. + */ + public function rightJoin($fromAlias, $join, $alias, $condition = null) + { + return $this->add('join', [ + $fromAlias => [ + 'joinType' => 'right', + 'joinTable' => $join, + 'joinAlias' => $alias, + 'joinCondition' => $condition, + ], + ], true); + } + + /** + * Sets a new value for a column in a bulk update query. + * + * + * $qb = $conn->createQueryBuilder() + * ->update('counters', 'c') + * ->set('c.value', 'c.value + 1') + * ->where('c.id = ?'); + * + * + * @param string $key The column to set. + * @param string $value The value, expression, placeholder, etc. + * + * @return $this This QueryBuilder instance. + */ + public function set($key, $value) + { + return $this->add('set', $key . ' = ' . $value, true); + } + + /** + * Specifies one or more restrictions to the query result. + * Replaces any previously specified restrictions, if any. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('c.value') + * ->from('counters', 'c') + * ->where('c.id = ?'); + * + * // You can optionally programmatically build and/or expressions + * $qb = $conn->createQueryBuilder(); + * + * $or = $qb->expr()->orx(); + * $or->add($qb->expr()->eq('c.id', 1)); + * $or->add($qb->expr()->eq('c.id', 2)); + * + * $qb->update('counters', 'c') + * ->set('c.value', 'c.value + 1') + * ->where($or); + * + * + * @param mixed $predicates The restriction predicates. + * + * @return $this This QueryBuilder instance. + */ + public function where($predicates) + { + if (! (func_num_args() === 1 && $predicates instanceof CompositeExpression)) { + $predicates = CompositeExpression::and(...func_get_args()); + } + + return $this->add('where', $predicates); + } + + /** + * Adds one or more restrictions to the query results, forming a logical + * conjunction with any previously specified restrictions. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u') + * ->from('users', 'u') + * ->where('u.username LIKE ?') + * ->andWhere('u.is_active = 1'); + * + * + * @see where() + * + * @param mixed $where The query restrictions. + * + * @return $this This QueryBuilder instance. + */ + public function andWhere($where) + { + $args = func_get_args(); + $where = $this->getQueryPart('where'); + + if ($where instanceof CompositeExpression && $where->getType() === CompositeExpression::TYPE_AND) { + $where = $where->with(...$args); + } else { + array_unshift($args, $where); + $where = CompositeExpression::and(...$args); + } + + return $this->add('where', $where, true); + } + + /** + * Adds one or more restrictions to the query results, forming a logical + * disjunction with any previously specified restrictions. + * + * + * $qb = $em->createQueryBuilder() + * ->select('u.name') + * ->from('users', 'u') + * ->where('u.id = 1') + * ->orWhere('u.id = 2'); + * + * + * @see where() + * + * @param mixed $where The WHERE statement. + * + * @return $this This QueryBuilder instance. + */ + public function orWhere($where) + { + $args = func_get_args(); + $where = $this->getQueryPart('where'); + + if ($where instanceof CompositeExpression && $where->getType() === CompositeExpression::TYPE_OR) { + $where = $where->with(...$args); + } else { + array_unshift($args, $where); + $where = CompositeExpression::or(...$args); + } + + return $this->add('where', $where, true); + } + + /** + * Specifies a grouping over the results of the query. + * Replaces any previously specified groupings, if any. + * + * USING AN ARRAY ARGUMENT IS DEPRECATED. Pass each value as an individual argument. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u.name') + * ->from('users', 'u') + * ->groupBy('u.id'); + * + * + * @param string|string[] $groupBy The grouping expression. USING AN ARRAY IS DEPRECATED. + * Pass each value as an individual argument. + * + * @return $this This QueryBuilder instance. + */ + public function groupBy($groupBy/*, string ...$groupBys*/) + { + if (is_array($groupBy) && count($groupBy) === 0) { + return $this; + } + + if (is_array($groupBy)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3837', + 'Passing an array for the first argument to QueryBuilder::groupBy() is deprecated, ' . + 'pass each value as an individual variadic argument instead.', + ); + } + + $groupBy = is_array($groupBy) ? $groupBy : func_get_args(); + + return $this->add('groupBy', $groupBy, false); + } + + /** + * Adds a grouping expression to the query. + * + * USING AN ARRAY ARGUMENT IS DEPRECATED. Pass each value as an individual argument. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u.name') + * ->from('users', 'u') + * ->groupBy('u.lastLogin') + * ->addGroupBy('u.createdAt'); + * + * + * @param string|string[] $groupBy The grouping expression. USING AN ARRAY IS DEPRECATED. + * Pass each value as an individual argument. + * + * @return $this This QueryBuilder instance. + */ + public function addGroupBy($groupBy/*, string ...$groupBys*/) + { + if (is_array($groupBy) && count($groupBy) === 0) { + return $this; + } + + if (is_array($groupBy)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3837', + 'Passing an array for the first argument to QueryBuilder::addGroupBy() is deprecated, ' . + 'pass each value as an individual variadic argument instead.', + ); + } + + $groupBy = is_array($groupBy) ? $groupBy : func_get_args(); + + return $this->add('groupBy', $groupBy, true); + } + + /** + * Sets a value for a column in an insert query. + * + * + * $qb = $conn->createQueryBuilder() + * ->insert('users') + * ->values( + * array( + * 'name' => '?' + * ) + * ) + * ->setValue('password', '?'); + * + * + * @param string $column The column into which the value should be inserted. + * @param string $value The value that should be inserted into the column. + * + * @return $this This QueryBuilder instance. + */ + public function setValue($column, $value) + { + $this->sqlParts['values'][$column] = $value; + + return $this; + } + + /** + * Specifies values for an insert query indexed by column names. + * Replaces any previous values, if any. + * + * + * $qb = $conn->createQueryBuilder() + * ->insert('users') + * ->values( + * array( + * 'name' => '?', + * 'password' => '?' + * ) + * ); + * + * + * @param mixed[] $values The values to specify for the insert query indexed by column names. + * + * @return $this This QueryBuilder instance. + */ + public function values(array $values) + { + return $this->add('values', $values); + } + + /** + * Specifies a restriction over the groups of the query. + * Replaces any previous having restrictions, if any. + * + * @param mixed $having The restriction over the groups. + * + * @return $this This QueryBuilder instance. + */ + public function having($having) + { + if (! (func_num_args() === 1 && $having instanceof CompositeExpression)) { + $having = CompositeExpression::and(...func_get_args()); + } + + return $this->add('having', $having); + } + + /** + * Adds a restriction over the groups of the query, forming a logical + * conjunction with any existing having restrictions. + * + * @param mixed $having The restriction to append. + * + * @return $this This QueryBuilder instance. + */ + public function andHaving($having) + { + $args = func_get_args(); + $having = $this->getQueryPart('having'); + + if ($having instanceof CompositeExpression && $having->getType() === CompositeExpression::TYPE_AND) { + $having = $having->with(...$args); + } else { + array_unshift($args, $having); + $having = CompositeExpression::and(...$args); + } + + return $this->add('having', $having); + } + + /** + * Adds a restriction over the groups of the query, forming a logical + * disjunction with any existing having restrictions. + * + * @param mixed $having The restriction to add. + * + * @return $this This QueryBuilder instance. + */ + public function orHaving($having) + { + $args = func_get_args(); + $having = $this->getQueryPart('having'); + + if ($having instanceof CompositeExpression && $having->getType() === CompositeExpression::TYPE_OR) { + $having = $having->with(...$args); + } else { + array_unshift($args, $having); + $having = CompositeExpression::or(...$args); + } + + return $this->add('having', $having); + } + + /** + * Specifies an ordering for the query results. + * Replaces any previously specified orderings, if any. + * + * @param string $sort The ordering expression. + * @param string $order The ordering direction. + * + * @return $this This QueryBuilder instance. + */ + public function orderBy($sort, $order = null) + { + return $this->add('orderBy', $sort . ' ' . ($order ?? 'ASC'), false); + } + + /** + * Adds an ordering to the query results. + * + * @param string $sort The ordering expression. + * @param string $order The ordering direction. + * + * @return $this This QueryBuilder instance. + */ + public function addOrderBy($sort, $order = null) + { + return $this->add('orderBy', $sort . ' ' . ($order ?? 'ASC'), true); + } + + /** + * Gets a query part by its name. + * + * @param string $queryPartName + * + * @return mixed + */ + public function getQueryPart($queryPartName) + { + return $this->sqlParts[$queryPartName]; + } + + /** + * Gets all query parts. + * + * @return mixed[] + */ + public function getQueryParts() + { + return $this->sqlParts; + } + + /** + * Resets SQL parts. + * + * @param string[]|null $queryPartNames + * + * @return $this This QueryBuilder instance. + */ + public function resetQueryParts($queryPartNames = null) + { + $queryPartNames ??= array_keys($this->sqlParts); + + foreach ($queryPartNames as $queryPartName) { + $this->resetQueryPart($queryPartName); + } + + return $this; + } + + /** + * Resets a single SQL part. + * + * @param string $queryPartName + * + * @return $this This QueryBuilder instance. + */ + public function resetQueryPart($queryPartName) + { + $this->sqlParts[$queryPartName] = self::SQL_PARTS_DEFAULTS[$queryPartName]; + + $this->state = self::STATE_DIRTY; + + return $this; + } + + /** @throws QueryException */ + private function getSQLForSelect(): string + { + $query = 'SELECT ' . ($this->sqlParts['distinct'] ? 'DISTINCT ' : '') . + implode(', ', $this->sqlParts['select']); + + $query .= ($this->sqlParts['from'] ? ' FROM ' . implode(', ', $this->getFromClauses()) : '') + . ($this->sqlParts['where'] !== null ? ' WHERE ' . ((string) $this->sqlParts['where']) : '') + . ($this->sqlParts['groupBy'] ? ' GROUP BY ' . implode(', ', $this->sqlParts['groupBy']) : '') + . ($this->sqlParts['having'] !== null ? ' HAVING ' . ((string) $this->sqlParts['having']) : '') + . ($this->sqlParts['orderBy'] ? ' ORDER BY ' . implode(', ', $this->sqlParts['orderBy']) : ''); + + if ($this->isLimitQuery()) { + return $this->connection->getDatabasePlatform()->modifyLimitQuery( + $query, + $this->maxResults, + $this->firstResult, + ); + } + + return $query; + } + + /** + * @return string[] + * + * @throws QueryException + */ + private function getFromClauses(): array + { + $fromClauses = []; + $knownAliases = []; + + // Loop through all FROM clauses + foreach ($this->sqlParts['from'] as $from) { + if ($from['alias'] === null) { + $tableSql = $from['table']; + $tableReference = $from['table']; + } else { + $tableSql = $from['table'] . ' ' . $from['alias']; + $tableReference = $from['alias']; + } + + $knownAliases[$tableReference] = true; + + $fromClauses[$tableReference] = $tableSql . $this->getSQLForJoins($tableReference, $knownAliases); + } + + $this->verifyAllAliasesAreKnown($knownAliases); + + return $fromClauses; + } + + /** + * @param array $knownAliases + * + * @throws QueryException + */ + private function verifyAllAliasesAreKnown(array $knownAliases): void + { + foreach ($this->sqlParts['join'] as $fromAlias => $joins) { + if (! isset($knownAliases[$fromAlias])) { + throw QueryException::unknownAlias($fromAlias, array_keys($knownAliases)); + } + } + } + + private function isLimitQuery(): bool + { + return $this->maxResults !== null || $this->firstResult !== 0; + } + + /** + * Converts this instance into an INSERT string in SQL. + */ + private function getSQLForInsert(): string + { + return 'INSERT INTO ' . $this->sqlParts['from']['table'] . + ' (' . implode(', ', array_keys($this->sqlParts['values'])) . ')' . + ' VALUES(' . implode(', ', $this->sqlParts['values']) . ')'; + } + + /** + * Converts this instance into an UPDATE string in SQL. + */ + private function getSQLForUpdate(): string + { + $table = $this->sqlParts['from']['table'] + . ($this->sqlParts['from']['alias'] ? ' ' . $this->sqlParts['from']['alias'] : ''); + + return 'UPDATE ' . $table + . ' SET ' . implode(', ', $this->sqlParts['set']) + . ($this->sqlParts['where'] !== null ? ' WHERE ' . ((string) $this->sqlParts['where']) : ''); + } + + /** + * Converts this instance into a DELETE string in SQL. + */ + private function getSQLForDelete(): string + { + $table = $this->sqlParts['from']['table'] + . ($this->sqlParts['from']['alias'] ? ' ' . $this->sqlParts['from']['alias'] : ''); + + return 'DELETE FROM ' . $table + . ($this->sqlParts['where'] !== null ? ' WHERE ' . ((string) $this->sqlParts['where']) : ''); + } + + /** + * Gets a string representation of this QueryBuilder which corresponds to + * the final SQL query being constructed. + * + * @return string The string representation of this QueryBuilder. + */ + public function __toString() + { + return $this->getSQL(); + } + + /** + * Creates a new named parameter and bind the value $value to it. + * + * This method provides a shortcut for {@see Statement::bindValue()} + * when using prepared statements. + * + * The parameter $value specifies the value that you want to bind. If + * $placeholder is not provided createNamedParameter() will automatically + * create a placeholder for you. An automatic placeholder will be of the + * name ':dcValue1', ':dcValue2' etc. + * + * Example: + * + * $value = 2; + * $q->eq( 'id', $q->createNamedParameter( $value ) ); + * $stmt = $q->executeQuery(); // executed with 'id = 2' + * + * + * @link http://www.zetacomponents.org + * + * @param mixed $value + * @param int|string|Type|null $type + * @param string $placeHolder The name to bind with. The string must start with a colon ':'. + * + * @return string the placeholder name used. + */ + public function createNamedParameter($value, $type = ParameterType::STRING, $placeHolder = null) + { + if ($placeHolder === null) { + $this->boundCounter++; + $placeHolder = ':dcValue' . $this->boundCounter; + } + + $this->setParameter(substr($placeHolder, 1), $value, $type); + + return $placeHolder; + } + + /** + * Creates a new positional parameter and bind the given value to it. + * + * Attention: If you are using positional parameters with the query builder you have + * to be very careful to bind all parameters in the order they appear in the SQL + * statement , otherwise they get bound in the wrong order which can lead to serious + * bugs in your code. + * + * Example: + * + * $qb = $conn->createQueryBuilder(); + * $qb->select('u.*') + * ->from('users', 'u') + * ->where('u.username = ' . $qb->createPositionalParameter('Foo', ParameterType::STRING)) + * ->orWhere('u.username = ' . $qb->createPositionalParameter('Bar', ParameterType::STRING)) + * + * + * @param mixed $value + * @param int|string|Type|null $type + * + * @return string + */ + public function createPositionalParameter($value, $type = ParameterType::STRING) + { + $this->setParameter($this->boundCounter, $value, $type); + $this->boundCounter++; + + return '?'; + } + + /** + * @param string $fromAlias + * @param array $knownAliases + * + * @throws QueryException + */ + private function getSQLForJoins($fromAlias, array &$knownAliases): string + { + $sql = ''; + + if (isset($this->sqlParts['join'][$fromAlias])) { + foreach ($this->sqlParts['join'][$fromAlias] as $join) { + if (array_key_exists($join['joinAlias'], $knownAliases)) { + throw QueryException::nonUniqueAlias($join['joinAlias'], array_keys($knownAliases)); + } + + $sql .= ' ' . strtoupper($join['joinType']) + . ' JOIN ' . $join['joinTable'] . ' ' . $join['joinAlias']; + if ($join['joinCondition'] !== null) { + $sql .= ' ON ' . $join['joinCondition']; + } + + $knownAliases[$join['joinAlias']] = true; + } + + foreach ($this->sqlParts['join'][$fromAlias] as $join) { + $sql .= $this->getSQLForJoins($join['joinAlias'], $knownAliases); + } + } + + return $sql; + } + + /** + * Deep clone of all expression objects in the SQL parts. + * + * @return void + */ + public function __clone() + { + foreach ($this->sqlParts as $part => $elements) { + if (is_array($this->sqlParts[$part])) { + foreach ($this->sqlParts[$part] as $idx => $element) { + if (! is_object($element)) { + continue; + } + + $this->sqlParts[$part][$idx] = clone $element; + } + } elseif (is_object($elements)) { + $this->sqlParts[$part] = clone $elements; + } + } + + foreach ($this->params as $name => $param) { + if (! is_object($param)) { + continue; + } + + $this->params[$name] = clone $param; + } + } + + /** + * Enables caching of the results of this query, for given amount of seconds + * and optionally specified witch key to use for the cache entry. + * + * @return $this + */ + public function enableResultCache(QueryCacheProfile $cacheProfile): self + { + $this->resultCacheProfile = $cacheProfile; + + return $this; + } + + /** + * Disables caching of the results of this query. + * + * @return $this + */ + public function disableResultCache(): self + { + $this->resultCacheProfile = null; + + return $this; + } +} diff --git a/vendor/doctrine/dbal/src/Query/QueryException.php b/vendor/doctrine/dbal/src/Query/QueryException.php new file mode 100644 index 00000000..90d1f47d --- /dev/null +++ b/vendor/doctrine/dbal/src/Query/QueryException.php @@ -0,0 +1,37 @@ +result = $result; + $this->connection = $connection; + } + + /** + * Returns the next row of the result as a numeric array or FALSE if there are no more rows. + * + * @return list|false + * + * @throws Exception + */ + public function fetchNumeric() + { + try { + return $this->result->fetchNumeric(); + } catch (DriverException $e) { + throw $this->connection->convertException($e); + } + } + + /** + * Returns the next row of the result as an associative array or FALSE if there are no more rows. + * + * @return array|false + * + * @throws Exception + */ + public function fetchAssociative() + { + try { + return $this->result->fetchAssociative(); + } catch (DriverException $e) { + throw $this->connection->convertException($e); + } + } + + /** + * Returns the first value of the next row of the result or FALSE if there are no more rows. + * + * @return mixed|false + * + * @throws Exception + */ + public function fetchOne() + { + try { + return $this->result->fetchOne(); + } catch (DriverException $e) { + throw $this->connection->convertException($e); + } + } + + /** + * Returns an array containing all of the result rows represented as numeric arrays. + * + * @return list> + * + * @throws Exception + */ + public function fetchAllNumeric(): array + { + try { + return $this->result->fetchAllNumeric(); + } catch (DriverException $e) { + throw $this->connection->convertException($e); + } + } + + /** + * Returns an array containing all of the result rows represented as associative arrays. + * + * @return list> + * + * @throws Exception + */ + public function fetchAllAssociative(): array + { + try { + return $this->result->fetchAllAssociative(); + } catch (DriverException $e) { + throw $this->connection->convertException($e); + } + } + + /** + * Returns an array containing the values of the first column of the result. + * + * @return array + * + * @throws Exception + */ + public function fetchAllKeyValue(): array + { + $this->ensureHasKeyValue(); + + $data = []; + + foreach ($this->fetchAllNumeric() as [$key, $value]) { + $data[$key] = $value; + } + + return $data; + } + + /** + * Returns an associative array with the keys mapped to the first column and the values being + * an associative array representing the rest of the columns and their values. + * + * @return array> + * + * @throws Exception + */ + public function fetchAllAssociativeIndexed(): array + { + $data = []; + + foreach ($this->fetchAllAssociative() as $row) { + $data[array_shift($row)] = $row; + } + + return $data; + } + + /** + * @return list + * + * @throws Exception + */ + public function fetchFirstColumn(): array + { + try { + return $this->result->fetchFirstColumn(); + } catch (DriverException $e) { + throw $this->connection->convertException($e); + } + } + + /** + * @return Traversable> + * + * @throws Exception + */ + public function iterateNumeric(): Traversable + { + while (($row = $this->fetchNumeric()) !== false) { + yield $row; + } + } + + /** + * @return Traversable> + * + * @throws Exception + */ + public function iterateAssociative(): Traversable + { + while (($row = $this->fetchAssociative()) !== false) { + yield $row; + } + } + + /** + * {@inheritDoc} + * + * @throws Exception + */ + public function iterateKeyValue(): Traversable + { + $this->ensureHasKeyValue(); + + foreach ($this->iterateNumeric() as [$key, $value]) { + yield $key => $value; + } + } + + /** + * Returns an iterator over the result set with the keys mapped to the first column and the values being + * an associative array representing the rest of the columns and their values. + * + * @return Traversable> + * + * @throws Exception + */ + public function iterateAssociativeIndexed(): Traversable + { + foreach ($this->iterateAssociative() as $row) { + yield array_shift($row) => $row; + } + } + + /** + * @return Traversable + * + * @throws Exception + */ + public function iterateColumn(): Traversable + { + while (($value = $this->fetchOne()) !== false) { + yield $value; + } + } + + /** @throws Exception */ + public function rowCount(): int + { + try { + return $this->result->rowCount(); + } catch (DriverException $e) { + throw $this->connection->convertException($e); + } + } + + /** @throws Exception */ + public function columnCount(): int + { + try { + return $this->result->columnCount(); + } catch (DriverException $e) { + throw $this->connection->convertException($e); + } + } + + public function free(): void + { + $this->result->free(); + } + + /** @throws Exception */ + private function ensureHasKeyValue(): void + { + $columnCount = $this->columnCount(); + + if ($columnCount < 2) { + throw NoKeyValue::fromColumnCount($columnCount); + } + } + + /** + * BC layer for a wide-spread use-case of old DBAL APIs + * + * @deprecated This API is deprecated and will be removed after 2022 + * + * @return mixed + * + * @throws Exception + */ + public function fetch(int $mode = FetchMode::ASSOCIATIVE) + { + if (func_num_args() > 1) { + throw new LogicException('Only invocations with one argument are still supported by this legacy API.'); + } + + if ($mode === FetchMode::ASSOCIATIVE) { + return $this->fetchAssociative(); + } + + if ($mode === FetchMode::NUMERIC) { + return $this->fetchNumeric(); + } + + if ($mode === FetchMode::COLUMN) { + return $this->fetchOne(); + } + + throw new LogicException('Only fetch modes declared on Doctrine\DBAL\FetchMode are supported by legacy API.'); + } + + /** + * BC layer for a wide-spread use-case of old DBAL APIs + * + * @deprecated This API is deprecated and will be removed after 2022 + * + * @return list + * + * @throws Exception + */ + public function fetchAll(int $mode = FetchMode::ASSOCIATIVE): array + { + if (func_num_args() > 1) { + throw new LogicException('Only invocations with one argument are still supported by this legacy API.'); + } + + if ($mode === FetchMode::ASSOCIATIVE) { + return $this->fetchAllAssociative(); + } + + if ($mode === FetchMode::NUMERIC) { + return $this->fetchAllNumeric(); + } + + if ($mode === FetchMode::COLUMN) { + return $this->fetchFirstColumn(); + } + + throw new LogicException('Only fetch modes declared on Doctrine\DBAL\FetchMode are supported by legacy API.'); + } +} diff --git a/vendor/doctrine/dbal/src/SQL/Builder/CreateSchemaObjectsSQLBuilder.php b/vendor/doctrine/dbal/src/SQL/Builder/CreateSchemaObjectsSQLBuilder.php new file mode 100644 index 00000000..2e392e66 --- /dev/null +++ b/vendor/doctrine/dbal/src/SQL/Builder/CreateSchemaObjectsSQLBuilder.php @@ -0,0 +1,85 @@ +platform = $platform; + } + + /** + * @return list + * + * @throws Exception + */ + public function buildSQL(Schema $schema): array + { + return array_merge( + $this->buildNamespaceStatements($schema->getNamespaces()), + $this->buildSequenceStatements($schema->getSequences()), + $this->buildTableStatements($schema->getTables()), + ); + } + + /** + * @param list $namespaces + * + * @return list + * + * @throws Exception + */ + private function buildNamespaceStatements(array $namespaces): array + { + $statements = []; + + if ($this->platform->supportsSchemas()) { + foreach ($namespaces as $namespace) { + $statements[] = $this->platform->getCreateSchemaSQL($namespace); + } + } + + return $statements; + } + + /** + * @param list
$tables + * + * @return list + * + * @throws Exception + */ + private function buildTableStatements(array $tables): array + { + return $this->platform->getCreateTablesSQL($tables); + } + + /** + * @param list $sequences + * + * @return list + * + * @throws Exception + */ + private function buildSequenceStatements(array $sequences): array + { + $statements = []; + + foreach ($sequences as $sequence) { + $statements[] = $this->platform->getCreateSequenceSQL($sequence); + } + + return $statements; + } +} diff --git a/vendor/doctrine/dbal/src/SQL/Builder/DropSchemaObjectsSQLBuilder.php b/vendor/doctrine/dbal/src/SQL/Builder/DropSchemaObjectsSQLBuilder.php new file mode 100644 index 00000000..8de742a3 --- /dev/null +++ b/vendor/doctrine/dbal/src/SQL/Builder/DropSchemaObjectsSQLBuilder.php @@ -0,0 +1,62 @@ +platform = $platform; + } + + /** + * @return list + * + * @throws Exception + */ + public function buildSQL(Schema $schema): array + { + return array_merge( + $this->buildSequenceStatements($schema->getSequences()), + $this->buildTableStatements($schema->getTables()), + ); + } + + /** + * @param list
$tables + * + * @return list + */ + private function buildTableStatements(array $tables): array + { + return $this->platform->getDropTablesSQL($tables); + } + + /** + * @param list $sequences + * + * @return list + * + * @throws Exception + */ + private function buildSequenceStatements(array $sequences): array + { + $statements = []; + + foreach ($sequences as $sequence) { + $statements[] = $this->platform->getDropSequenceSQL($sequence); + } + + return $statements; + } +} diff --git a/vendor/doctrine/dbal/src/SQL/Parser.php b/vendor/doctrine/dbal/src/SQL/Parser.php new file mode 100644 index 00000000..ae0d4428 --- /dev/null +++ b/vendor/doctrine/dbal/src/SQL/Parser.php @@ -0,0 +1,127 @@ +getMySQLStringLiteralPattern("'"), + $this->getMySQLStringLiteralPattern('"'), + ]; + } else { + $patterns = [ + $this->getAnsiSQLStringLiteralPattern("'"), + $this->getAnsiSQLStringLiteralPattern('"'), + ]; + } + + $patterns = array_merge($patterns, [ + self::BACKTICK_IDENTIFIER, + self::BRACKET_IDENTIFIER, + self::MULTICHAR, + self::ONE_LINE_COMMENT, + self::MULTI_LINE_COMMENT, + self::OTHER, + ]); + + $this->sqlPattern = sprintf('(%s)', implode('|', $patterns)); + } + + /** + * Parses the given SQL statement + * + * @throws Exception + */ + public function parse(string $sql, Visitor $visitor): void + { + /** @var array $patterns */ + $patterns = [ + self::NAMED_PARAMETER => static function (string $sql) use ($visitor): void { + $visitor->acceptNamedParameter($sql); + }, + self::POSITIONAL_PARAMETER => static function (string $sql) use ($visitor): void { + $visitor->acceptPositionalParameter($sql); + }, + $this->sqlPattern => static function (string $sql) use ($visitor): void { + $visitor->acceptOther($sql); + }, + self::SPECIAL => static function (string $sql) use ($visitor): void { + $visitor->acceptOther($sql); + }, + ]; + + $offset = 0; + + while (($handler = current($patterns)) !== false) { + if (preg_match('~\G' . key($patterns) . '~s', $sql, $matches, 0, $offset) === 1) { + $handler($matches[0]); + reset($patterns); + + $offset += strlen($matches[0]); + } elseif (preg_last_error() !== PREG_NO_ERROR) { + // @codeCoverageIgnoreStart + throw RegularExpressionError::new(); + // @codeCoverageIgnoreEnd + } else { + next($patterns); + } + } + + assert($offset === strlen($sql)); + } + + private function getMySQLStringLiteralPattern(string $delimiter): string + { + return $delimiter . '((\\\\.)|(?![' . $delimiter . '\\\\]).)*' . $delimiter; + } + + private function getAnsiSQLStringLiteralPattern(string $delimiter): string + { + return $delimiter . '[^' . $delimiter . ']*' . $delimiter; + } +} diff --git a/vendor/doctrine/dbal/src/SQL/Parser/Exception.php b/vendor/doctrine/dbal/src/SQL/Parser/Exception.php new file mode 100644 index 00000000..0c14b358 --- /dev/null +++ b/vendor/doctrine/dbal/src/SQL/Parser/Exception.php @@ -0,0 +1,11 @@ + Table($tableName)); if you want to rename the table, you have to make sure + */ +abstract class AbstractAsset +{ + /** @var string */ + protected $_name = ''; + + /** + * Namespace of the asset. If none isset the default namespace is assumed. + * + * @var string|null + */ + protected $_namespace; + + /** @var bool */ + protected $_quoted = false; + + /** + * Sets the name of this asset. + * + * @param string $name + * + * @return void + */ + protected function _setName($name) + { + if ($this->isIdentifierQuoted($name)) { + $this->_quoted = true; + $name = $this->trimQuotes($name); + } + + if (strpos($name, '.') !== false) { + $parts = explode('.', $name); + $this->_namespace = $parts[0]; + $name = $parts[1]; + } + + $this->_name = $name; + } + + /** + * Is this asset in the default namespace? + * + * @param string $defaultNamespaceName + * + * @return bool + */ + public function isInDefaultNamespace($defaultNamespaceName) + { + return $this->_namespace === $defaultNamespaceName || $this->_namespace === null; + } + + /** + * Gets the namespace name of this asset. + * + * If NULL is returned this means the default namespace is used. + * + * @return string|null + */ + public function getNamespaceName() + { + return $this->_namespace; + } + + /** + * The shortest name is stripped of the default namespace. All other + * namespaced elements are returned as full-qualified names. + * + * @param string|null $defaultNamespaceName + * + * @return string + */ + public function getShortestName($defaultNamespaceName) + { + $shortestName = $this->getName(); + if ($this->_namespace === $defaultNamespaceName) { + $shortestName = $this->_name; + } + + return strtolower($shortestName); + } + + /** + * The normalized name is full-qualified and lower-cased. Lower-casing is + * actually wrong, but we have to do it to keep our sanity. If you are + * using database objects that only differentiate in the casing (FOO vs + * Foo) then you will NOT be able to use Doctrine Schema abstraction. + * + * Every non-namespaced element is prefixed with the default namespace + * name which is passed as argument to this method. + * + * @deprecated Use {@see getNamespaceName()} and {@see getName()} instead. + * + * @param string $defaultNamespaceName + * + * @return string + */ + public function getFullQualifiedName($defaultNamespaceName) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4814', + 'AbstractAsset::getFullQualifiedName() is deprecated.' + . ' Use AbstractAsset::getNamespaceName() and ::getName() instead.', + ); + + $name = $this->getName(); + if ($this->_namespace === null) { + $name = $defaultNamespaceName . '.' . $name; + } + + return strtolower($name); + } + + /** + * Checks if this asset's name is quoted. + * + * @return bool + */ + public function isQuoted() + { + return $this->_quoted; + } + + /** + * Checks if this identifier is quoted. + * + * @param string $identifier + * + * @return bool + */ + protected function isIdentifierQuoted($identifier) + { + return isset($identifier[0]) && ($identifier[0] === '`' || $identifier[0] === '"' || $identifier[0] === '['); + } + + /** + * Trim quotes from the identifier. + * + * @param string $identifier + * + * @return string + */ + protected function trimQuotes($identifier) + { + return str_replace(['`', '"', '[', ']'], '', $identifier); + } + + /** + * Returns the name of this schema asset. + * + * @return string + */ + public function getName() + { + if ($this->_namespace !== null) { + return $this->_namespace . '.' . $this->_name; + } + + return $this->_name; + } + + /** + * Gets the quoted representation of this asset but only if it was defined with one. Otherwise + * return the plain unquoted value as inserted. + * + * @return string + */ + public function getQuotedName(AbstractPlatform $platform) + { + $keywords = $platform->getReservedKeywordsList(); + $parts = explode('.', $this->getName()); + foreach ($parts as $k => $v) { + $parts[$k] = $this->_quoted || $keywords->isKeyword($v) ? $platform->quoteIdentifier($v) : $v; + } + + return implode('.', $parts); + } + + /** + * Generates an identifier from a list of column names obeying a certain string length. + * + * This is especially important for Oracle, since it does not allow identifiers larger than 30 chars, + * however building idents automatically for foreign keys, composite keys or such can easily create + * very long names. + * + * @param string[] $columnNames + * @param string $prefix + * @param int $maxSize + * + * @return string + */ + protected function _generateIdentifierName($columnNames, $prefix = '', $maxSize = 30) + { + $hash = implode('', array_map(static function ($column): string { + return dechex(crc32($column)); + }, $columnNames)); + + return strtoupper(substr($prefix . '_' . $hash, 0, $maxSize)); + } +} diff --git a/vendor/doctrine/dbal/src/Schema/AbstractSchemaManager.php b/vendor/doctrine/dbal/src/Schema/AbstractSchemaManager.php new file mode 100644 index 00000000..445c9ff2 --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/AbstractSchemaManager.php @@ -0,0 +1,1800 @@ +_conn = $connection; + $this->_platform = $platform; + } + + /** + * Returns the associated platform. + * + * @deprecated Use {@link Connection::getDatabasePlatform()} instead. + * + * @return T + */ + public function getDatabasePlatform() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5387', + 'AbstractSchemaManager::getDatabasePlatform() is deprecated.' + . ' Use Connection::getDatabasePlatform() instead.', + ); + + return $this->_platform; + } + + /** + * Tries any method on the schema manager. Normally a method throws an + * exception when your DBMS doesn't support it or if an error occurs. + * This method allows you to try and method on your SchemaManager + * instance and will return false if it does not work or is not supported. + * + * + * $result = $sm->tryMethod('dropView', 'view_name'); + * + * + * @deprecated + * + * @return mixed + */ + public function tryMethod() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4897', + 'AbstractSchemaManager::tryMethod() is deprecated.', + ); + + $args = func_get_args(); + $method = $args[0]; + unset($args[0]); + $args = array_values($args); + + $callback = [$this, $method]; + assert(is_callable($callback)); + + try { + return call_user_func_array($callback, $args); + } catch (Throwable $e) { + return false; + } + } + + /** + * Lists the available databases for this connection. + * + * @return string[] + * + * @throws Exception + */ + public function listDatabases() + { + $sql = $this->_platform->getListDatabasesSQL(); + + $databases = $this->_conn->fetchAllAssociative($sql); + + return $this->_getPortableDatabasesList($databases); + } + + /** + * Returns a list of all namespaces in the current database. + * + * @deprecated Use {@see listSchemaNames()} instead. + * + * @return string[] + * + * @throws Exception + */ + public function listNamespaceNames() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4503', + 'AbstractSchemaManager::listNamespaceNames() is deprecated,' + . ' use AbstractSchemaManager::listSchemaNames() instead.', + ); + + $sql = $this->_platform->getListNamespacesSQL(); + + $namespaces = $this->_conn->fetchAllAssociative($sql); + + return $this->getPortableNamespacesList($namespaces); + } + + /** + * Returns a list of the names of all schemata in the current database. + * + * @return list + * + * @throws Exception + */ + public function listSchemaNames(): array + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Lists the available sequences for this connection. + * + * @param string|null $database + * + * @return Sequence[] + * + * @throws Exception + */ + public function listSequences($database = null) + { + if ($database === null) { + $database = $this->getDatabase(__METHOD__); + } else { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/5284', + 'Passing $database to AbstractSchemaManager::listSequences() is deprecated.', + ); + } + + $sql = $this->_platform->getListSequencesSQL($database); + + $sequences = $this->_conn->fetchAllAssociative($sql); + + return $this->filterAssetNames($this->_getPortableSequencesList($sequences)); + } + + /** + * Lists the columns for a given table. + * + * In contrast to other libraries and to the old version of Doctrine, + * this column definition does try to contain the 'primary' column for + * the reason that it is not portable across different RDBMS. Use + * {@see listTableIndexes($tableName)} to retrieve the primary key + * of a table. Where a RDBMS specifies more details, these are held + * in the platformDetails array. + * + * @param string $table The name of the table. + * @param string|null $database + * + * @return Column[] + * + * @throws Exception + */ + public function listTableColumns($table, $database = null) + { + if ($database === null) { + $database = $this->getDatabase(__METHOD__); + } else { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/5284', + 'Passing $database to AbstractSchemaManager::listTableColumns() is deprecated.', + ); + } + + $sql = $this->_platform->getListTableColumnsSQL($table, $database); + + $tableColumns = $this->_conn->fetchAllAssociative($sql); + + return $this->_getPortableTableColumnList($table, $database, $tableColumns); + } + + /** + * @param string $table + * @param string|null $database + * + * @return Column[] + * + * @throws Exception + */ + protected function doListTableColumns($table, $database = null): array + { + if ($database === null) { + $database = $this->getDatabase(__METHOD__); + } else { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/5284', + 'Passing $database to AbstractSchemaManager::listTableColumns() is deprecated.', + ); + } + + return $this->_getPortableTableColumnList( + $table, + $database, + $this->selectTableColumns($database, $this->normalizeName($table)) + ->fetchAllAssociative(), + ); + } + + /** + * Lists the indexes for a given table returning an array of Index instances. + * + * Keys of the portable indexes list are all lower-cased. + * + * @param string $table The name of the table. + * + * @return Index[] + * + * @throws Exception + */ + public function listTableIndexes($table) + { + $sql = $this->_platform->getListTableIndexesSQL($table, $this->_conn->getDatabase()); + + $tableIndexes = $this->_conn->fetchAllAssociative($sql); + + return $this->_getPortableTableIndexesList($tableIndexes, $table); + } + + /** + * @param string $table + * + * @return Index[] + * + * @throws Exception + */ + protected function doListTableIndexes($table): array + { + $database = $this->getDatabase(__METHOD__); + $table = $this->normalizeName($table); + + return $this->_getPortableTableIndexesList( + $this->selectIndexColumns( + $database, + $table, + )->fetchAllAssociative(), + $table, + ); + } + + /** + * Returns true if all the given tables exist. + * + * The usage of a string $tableNames is deprecated. Pass a one-element array instead. + * + * @param string|string[] $names + * + * @return bool + * + * @throws Exception + */ + public function tablesExist($names) + { + if (is_string($names)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3580', + 'The usage of a string $tableNames in AbstractSchemaManager::tablesExist() is deprecated. ' . + 'Pass a one-element array instead.', + ); + } + + $names = array_map('strtolower', (array) $names); + + return count($names) === count(array_intersect($names, array_map('strtolower', $this->listTableNames()))); + } + + /** + * Returns a list of all tables in the current database. + * + * @return string[] + * + * @throws Exception + */ + public function listTableNames() + { + $sql = $this->_platform->getListTablesSQL(); + + $tables = $this->_conn->fetchAllAssociative($sql); + $tableNames = $this->_getPortableTablesList($tables); + + return $this->filterAssetNames($tableNames); + } + + /** + * @return list + * + * @throws Exception + */ + protected function doListTableNames(): array + { + $database = $this->getDatabase(__METHOD__); + + return $this->filterAssetNames( + $this->_getPortableTablesList( + $this->selectTableNames($database) + ->fetchAllAssociative(), + ), + ); + } + + /** + * Filters asset names if they are configured to return only a subset of all + * the found elements. + * + * @param mixed[] $assetNames + * + * @return mixed[] + */ + protected function filterAssetNames($assetNames) + { + $filter = $this->_conn->getConfiguration()->getSchemaAssetsFilter(); + if ($filter === null) { + return $assetNames; + } + + return array_values(array_filter($assetNames, $filter)); + } + + /** + * Lists the tables for this connection. + * + * @return list
+ * + * @throws Exception + */ + public function listTables() + { + $tableNames = $this->listTableNames(); + + $tables = []; + foreach ($tableNames as $tableName) { + $tables[] = $this->introspectTable($tableName); + } + + return $tables; + } + + /** + * @return list
+ * + * @throws Exception + */ + protected function doListTables(): array + { + $database = $this->getDatabase(__METHOD__); + + $tableColumnsByTable = $this->fetchTableColumnsByTable($database); + $indexColumnsByTable = $this->fetchIndexColumnsByTable($database); + $foreignKeyColumnsByTable = $this->fetchForeignKeyColumnsByTable($database); + $tableOptionsByTable = $this->fetchTableOptionsByTable($database); + + $filter = $this->_conn->getConfiguration()->getSchemaAssetsFilter(); + $tables = []; + + foreach ($tableColumnsByTable as $tableName => $tableColumns) { + if ($filter !== null && ! $filter($tableName)) { + continue; + } + + $tables[] = new Table( + $tableName, + $this->_getPortableTableColumnList($tableName, $database, $tableColumns), + $this->_getPortableTableIndexesList($indexColumnsByTable[$tableName] ?? [], $tableName), + [], + $this->_getPortableTableForeignKeysList($foreignKeyColumnsByTable[$tableName] ?? []), + $tableOptionsByTable[$tableName] ?? [], + ); + } + + return $tables; + } + + /** + * @deprecated Use {@see introspectTable()} instead. + * + * @param string $name + * + * @return Table + * + * @throws Exception + */ + public function listTableDetails($name) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5595', + '%s is deprecated. Use introspectTable() instead.', + __METHOD__, + ); + + $columns = $this->listTableColumns($name); + $foreignKeys = []; + + if ($this->_platform->supportsForeignKeyConstraints()) { + $foreignKeys = $this->listTableForeignKeys($name); + } + + $indexes = $this->listTableIndexes($name); + + return new Table($name, $columns, $indexes, [], $foreignKeys); + } + + /** + * @param string $name + * + * @throws Exception + */ + protected function doListTableDetails($name): Table + { + $database = $this->getDatabase(__METHOD__); + + $normalizedName = $this->normalizeName($name); + + $tableOptionsByTable = $this->fetchTableOptionsByTable($database, $normalizedName); + + if ($this->_platform->supportsForeignKeyConstraints()) { + $foreignKeys = $this->listTableForeignKeys($name); + } else { + $foreignKeys = []; + } + + return new Table( + $name, + $this->listTableColumns($name, $database), + $this->listTableIndexes($name), + [], + $foreignKeys, + $tableOptionsByTable[$normalizedName] ?? [], + ); + } + + /** + * An extension point for those platforms where case sensitivity of the object name depends on whether it's quoted. + * + * Such platforms should convert a possibly quoted name into a value of the corresponding case. + */ + protected function normalizeName(string $name): string + { + $identifier = new Identifier($name); + + return $identifier->getName(); + } + + /** + * Selects names of tables in the specified database. + * + * @throws Exception + * + * @abstract + */ + protected function selectTableNames(string $databaseName): Result + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Selects definitions of table columns in the specified database. If the table name is specified, narrows down + * the selection to this table. + * + * @throws Exception + * + * @abstract + */ + protected function selectTableColumns(string $databaseName, ?string $tableName = null): Result + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Selects definitions of index columns in the specified database. If the table name is specified, narrows down + * the selection to this table. + * + * @throws Exception + */ + protected function selectIndexColumns(string $databaseName, ?string $tableName = null): Result + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Selects definitions of foreign key columns in the specified database. If the table name is specified, + * narrows down the selection to this table. + * + * @throws Exception + */ + protected function selectForeignKeyColumns(string $databaseName, ?string $tableName = null): Result + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Fetches definitions of table columns in the specified database and returns them grouped by table name. + * + * @return array>> + * + * @throws Exception + */ + protected function fetchTableColumnsByTable(string $databaseName): array + { + return $this->fetchAllAssociativeGrouped($this->selectTableColumns($databaseName)); + } + + /** + * Fetches definitions of index columns in the specified database and returns them grouped by table name. + * + * @return array>> + * + * @throws Exception + */ + protected function fetchIndexColumnsByTable(string $databaseName): array + { + return $this->fetchAllAssociativeGrouped($this->selectIndexColumns($databaseName)); + } + + /** + * Fetches definitions of foreign key columns in the specified database and returns them grouped by table name. + * + * @return array>> + * + * @throws Exception + */ + protected function fetchForeignKeyColumnsByTable(string $databaseName): array + { + if (! $this->_platform->supportsForeignKeyConstraints()) { + return []; + } + + return $this->fetchAllAssociativeGrouped( + $this->selectForeignKeyColumns($databaseName), + ); + } + + /** + * Fetches table options for the tables in the specified database and returns them grouped by table name. + * If the table name is specified, narrows down the selection to this table. + * + * @return array> + * + * @throws Exception + */ + protected function fetchTableOptionsByTable(string $databaseName, ?string $tableName = null): array + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Introspects the table with the given name. + * + * @throws Exception + */ + public function introspectTable(string $name): Table + { + $table = $this->listTableDetails($name); + + if ($table->getColumns() === []) { + throw SchemaException::tableDoesNotExist($name); + } + + return $table; + } + + /** + * Lists the views this connection has. + * + * @return View[] + * + * @throws Exception + */ + public function listViews() + { + $database = $this->_conn->getDatabase(); + $sql = $this->_platform->getListViewsSQL($database); + $views = $this->_conn->fetchAllAssociative($sql); + + return $this->_getPortableViewsList($views); + } + + /** + * Lists the foreign keys for the given table. + * + * @param string $table The name of the table. + * @param string|null $database + * + * @return ForeignKeyConstraint[] + * + * @throws Exception + */ + public function listTableForeignKeys($table, $database = null) + { + if ($database === null) { + $database = $this->getDatabase(__METHOD__); + } else { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/5284', + 'Passing $database to AbstractSchemaManager::listTableForeignKeys() is deprecated.', + ); + } + + $sql = $this->_platform->getListTableForeignKeysSQL($table, $database); + $tableForeignKeys = $this->_conn->fetchAllAssociative($sql); + + return $this->_getPortableTableForeignKeysList($tableForeignKeys); + } + + /** + * @param string $table + * @param string|null $database + * + * @return ForeignKeyConstraint[] + * + * @throws Exception + */ + protected function doListTableForeignKeys($table, $database = null): array + { + if ($database === null) { + $database = $this->getDatabase(__METHOD__); + } else { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/5284', + 'Passing $database to AbstractSchemaManager::listTableForeignKeys() is deprecated.', + ); + } + + return $this->_getPortableTableForeignKeysList( + $this->selectForeignKeyColumns( + $database, + $this->normalizeName($table), + )->fetchAllAssociative(), + ); + } + + /* drop*() Methods */ + + /** + * Drops a database. + * + * NOTE: You can not drop the database this SchemaManager is currently connected to. + * + * @param string $database The name of the database to drop. + * + * @return void + * + * @throws Exception + */ + public function dropDatabase($database) + { + $this->_conn->executeStatement( + $this->_platform->getDropDatabaseSQL($database), + ); + } + + /** + * Drops a schema. + * + * @throws Exception + */ + public function dropSchema(string $schemaName): void + { + $this->_conn->executeStatement( + $this->_platform->getDropSchemaSQL($schemaName), + ); + } + + /** + * Drops the given table. + * + * @param string $name The name of the table to drop. + * + * @return void + * + * @throws Exception + */ + public function dropTable($name) + { + $this->_conn->executeStatement( + $this->_platform->getDropTableSQL($name), + ); + } + + /** + * Drops the index from the given table. + * + * @param Index|string $index The name of the index. + * @param Table|string $table The name of the table. + * + * @return void + * + * @throws Exception + */ + public function dropIndex($index, $table) + { + if ($index instanceof Index) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $index as an Index object to %s is deprecated. Pass it as a quoted name instead.', + __METHOD__, + ); + + $index = $index->getQuotedName($this->_platform); + } + + if ($table instanceof Table) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $table as an Table object to %s is deprecated. Pass it as a quoted name instead.', + __METHOD__, + ); + + $table = $table->getQuotedName($this->_platform); + } + + $this->_conn->executeStatement( + $this->_platform->getDropIndexSQL($index, $table), + ); + } + + /** + * Drops the constraint from the given table. + * + * @deprecated Use {@see dropIndex()}, {@see dropForeignKey()} or {@see dropUniqueConstraint()} instead. + * + * @param Table|string $table The name of the table. + * + * @return void + * + * @throws Exception + */ + public function dropConstraint(Constraint $constraint, $table) + { + if ($table instanceof Table) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $table as a Table object to %s is deprecated. Pass it as a quoted name instead.', + __METHOD__, + ); + + $table = $table->getQuotedName($this->_platform); + } + + $this->_conn->executeStatement($this->_platform->getDropConstraintSQL( + $constraint->getQuotedName($this->_platform), + $table, + )); + } + + /** + * Drops a foreign key from a table. + * + * @param ForeignKeyConstraint|string $foreignKey The name of the foreign key. + * @param Table|string $table The name of the table with the foreign key. + * + * @return void + * + * @throws Exception + */ + public function dropForeignKey($foreignKey, $table) + { + if ($foreignKey instanceof ForeignKeyConstraint) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $foreignKey as a ForeignKeyConstraint object to %s is deprecated.' + . ' Pass it as a quoted name instead.', + __METHOD__, + ); + + $foreignKey = $foreignKey->getQuotedName($this->_platform); + } + + if ($table instanceof Table) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4798', + 'Passing $table as a Table object to %s is deprecated. Pass it as a quoted name instead.', + __METHOD__, + ); + + $table = $table->getQuotedName($this->_platform); + } + + $this->_conn->executeStatement( + $this->_platform->getDropForeignKeySQL($foreignKey, $table), + ); + } + + /** + * Drops a sequence with a given name. + * + * @param string $name The name of the sequence to drop. + * + * @return void + * + * @throws Exception + */ + public function dropSequence($name) + { + $this->_conn->executeStatement( + $this->_platform->getDropSequenceSQL($name), + ); + } + + /** + * Drops the unique constraint from the given table. + * + * @throws Exception + */ + public function dropUniqueConstraint(string $name, string $tableName): void + { + $this->_conn->executeStatement( + $this->_platform->getDropUniqueConstraintSQL($name, $tableName), + ); + } + + /** + * Drops a view. + * + * @param string $name The name of the view. + * + * @return void + * + * @throws Exception + */ + public function dropView($name) + { + $this->_conn->executeStatement( + $this->_platform->getDropViewSQL($name), + ); + } + + /* create*() Methods */ + + /** @throws Exception */ + public function createSchemaObjects(Schema $schema): void + { + $this->_execSql($schema->toSql($this->_platform)); + } + + /** + * Creates a new database. + * + * @param string $database The name of the database to create. + * + * @return void + * + * @throws Exception + */ + public function createDatabase($database) + { + $this->_conn->executeStatement( + $this->_platform->getCreateDatabaseSQL($database), + ); + } + + /** + * Creates a new table. + * + * @return void + * + * @throws Exception + */ + public function createTable(Table $table) + { + $createFlags = AbstractPlatform::CREATE_INDEXES | AbstractPlatform::CREATE_FOREIGNKEYS; + $this->_execSql($this->_platform->getCreateTableSQL($table, $createFlags)); + } + + /** + * Creates a new sequence. + * + * @param Sequence $sequence + * + * @return void + * + * @throws Exception + */ + public function createSequence($sequence) + { + $this->_conn->executeStatement( + $this->_platform->getCreateSequenceSQL($sequence), + ); + } + + /** + * Creates a constraint on a table. + * + * @deprecated Use {@see createIndex()}, {@see createForeignKey()} or {@see createUniqueConstraint()} instead. + * + * @param Table|string $table + * + * @return void + * + * @throws Exception + */ + public function createConstraint(Constraint $constraint, $table) + { + $this->_conn->executeStatement( + $this->_platform->getCreateConstraintSQL($constraint, $table), + ); + } + + /** + * Creates a new index on a table. + * + * @param Table|string $table The name of the table on which the index is to be created. + * + * @return void + * + * @throws Exception + */ + public function createIndex(Index $index, $table) + { + $this->_conn->executeStatement( + $this->_platform->getCreateIndexSQL($index, $table), + ); + } + + /** + * Creates a new foreign key. + * + * @param ForeignKeyConstraint $foreignKey The ForeignKey instance. + * @param Table|string $table The name of the table on which the foreign key is to be created. + * + * @return void + * + * @throws Exception + */ + public function createForeignKey(ForeignKeyConstraint $foreignKey, $table) + { + $this->_conn->executeStatement( + $this->_platform->getCreateForeignKeySQL($foreignKey, $table), + ); + } + + /** + * Creates a unique constraint on a table. + * + * @throws Exception + */ + public function createUniqueConstraint(UniqueConstraint $uniqueConstraint, string $tableName): void + { + $this->_conn->executeStatement( + $this->_platform->getCreateUniqueConstraintSQL($uniqueConstraint, $tableName), + ); + } + + /** + * Creates a new view. + * + * @return void + * + * @throws Exception + */ + public function createView(View $view) + { + $this->_conn->executeStatement( + $this->_platform->getCreateViewSQL( + $view->getQuotedName($this->_platform), + $view->getSql(), + ), + ); + } + + /* dropAndCreate*() Methods */ + + /** @throws Exception */ + public function dropSchemaObjects(Schema $schema): void + { + $this->_execSql($schema->toDropSql($this->_platform)); + } + + /** + * Drops and creates a constraint. + * + * @deprecated Use {@see dropIndex()} and {@see createIndex()}, + * {@see dropForeignKey()} and {@see createForeignKey()} + * or {@see dropUniqueConstraint()} and {@see createUniqueConstraint()} instead. + * + * @see dropConstraint() + * @see createConstraint() + * + * @param Table|string $table + * + * @return void + * + * @throws Exception + */ + public function dropAndCreateConstraint(Constraint $constraint, $table) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4897', + 'AbstractSchemaManager::dropAndCreateConstraint() is deprecated.' + . ' Use AbstractSchemaManager::dropIndex() and AbstractSchemaManager::createIndex(),' + . ' AbstractSchemaManager::dropForeignKey() and AbstractSchemaManager::createForeignKey()' + . ' or AbstractSchemaManager::dropUniqueConstraint()' + . ' and AbstractSchemaManager::createUniqueConstraint() instead.', + ); + + $this->tryMethod('dropConstraint', $constraint, $table); + $this->createConstraint($constraint, $table); + } + + /** + * Drops and creates a new index on a table. + * + * @deprecated Use {@see dropIndex()} and {@see createIndex()} instead. + * + * @param Table|string $table The name of the table on which the index is to be created. + * + * @return void + * + * @throws Exception + */ + public function dropAndCreateIndex(Index $index, $table) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4897', + 'AbstractSchemaManager::dropAndCreateIndex() is deprecated.' + . ' Use AbstractSchemaManager::dropIndex() and AbstractSchemaManager::createIndex() instead.', + ); + + $this->tryMethod('dropIndex', $index->getQuotedName($this->_platform), $table); + $this->createIndex($index, $table); + } + + /** + * Drops and creates a new foreign key. + * + * @deprecated Use {@see dropForeignKey()} and {@see createForeignKey()} instead. + * + * @param ForeignKeyConstraint $foreignKey An associative array that defines properties + * of the foreign key to be created. + * @param Table|string $table The name of the table on which the foreign key is to be created. + * + * @return void + * + * @throws Exception + */ + public function dropAndCreateForeignKey(ForeignKeyConstraint $foreignKey, $table) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4897', + 'AbstractSchemaManager::dropAndCreateForeignKey() is deprecated.' + . ' Use AbstractSchemaManager::dropForeignKey() and AbstractSchemaManager::createForeignKey() instead.', + ); + + $this->tryMethod('dropForeignKey', $foreignKey, $table); + $this->createForeignKey($foreignKey, $table); + } + + /** + * Drops and create a new sequence. + * + * @deprecated Use {@see dropSequence()} and {@see createSequence()} instead. + * + * @return void + * + * @throws Exception + */ + public function dropAndCreateSequence(Sequence $sequence) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4897', + 'AbstractSchemaManager::dropAndCreateSequence() is deprecated.' + . ' Use AbstractSchemaManager::dropSequence() and AbstractSchemaManager::createSequence() instead.', + ); + + $this->tryMethod('dropSequence', $sequence->getQuotedName($this->_platform)); + $this->createSequence($sequence); + } + + /** + * Drops and creates a new table. + * + * @deprecated Use {@see dropTable()} and {@see createTable()} instead. + * + * @return void + * + * @throws Exception + */ + public function dropAndCreateTable(Table $table) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4897', + 'AbstractSchemaManager::dropAndCreateTable() is deprecated.' + . ' Use AbstractSchemaManager::dropTable() and AbstractSchemaManager::createTable() instead.', + ); + + $this->tryMethod('dropTable', $table->getQuotedName($this->_platform)); + $this->createTable($table); + } + + /** + * Drops and creates a new database. + * + * @deprecated Use {@see dropDatabase()} and {@see createDatabase()} instead. + * + * @param string $database The name of the database to create. + * + * @return void + * + * @throws Exception + */ + public function dropAndCreateDatabase($database) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4897', + 'AbstractSchemaManager::dropAndCreateDatabase() is deprecated.' + . ' Use AbstractSchemaManager::dropDatabase() and AbstractSchemaManager::createDatabase() instead.', + ); + + $this->tryMethod('dropDatabase', $database); + $this->createDatabase($database); + } + + /** + * Drops and creates a new view. + * + * @deprecated Use {@see dropView()} and {@see createView()} instead. + * + * @return void + * + * @throws Exception + */ + public function dropAndCreateView(View $view) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4897', + 'AbstractSchemaManager::dropAndCreateView() is deprecated.' + . ' Use AbstractSchemaManager::dropView() and AbstractSchemaManager::createView() instead.', + ); + + $this->tryMethod('dropView', $view->getQuotedName($this->_platform)); + $this->createView($view); + } + + /** + * Alters an existing schema. + * + * @throws Exception + */ + public function alterSchema(SchemaDiff $schemaDiff): void + { + $this->_execSql($this->_platform->getAlterSchemaSQL($schemaDiff)); + } + + /** + * Migrates an existing schema to a new schema. + * + * @throws Exception + */ + public function migrateSchema(Schema $toSchema): void + { + $schemaDiff = $this->createComparator() + ->compareSchemas($this->introspectSchema(), $toSchema); + + $this->alterSchema($schemaDiff); + } + + /* alterTable() Methods */ + + /** + * Alters an existing tables schema. + * + * @return void + * + * @throws Exception + */ + public function alterTable(TableDiff $tableDiff) + { + $this->_execSql($this->_platform->getAlterTableSQL($tableDiff)); + } + + /** + * Renames a given table to another name. + * + * @param string $name The current name of the table. + * @param string $newName The new name of the table. + * + * @return void + * + * @throws Exception + */ + public function renameTable($name, $newName) + { + $this->_execSql($this->_platform->getRenameTableSQL($name, $newName)); + } + + /** + * Methods for filtering return values of list*() methods to convert + * the native DBMS data definition to a portable Doctrine definition + */ + + /** + * @param mixed[] $databases + * + * @return string[] + */ + protected function _getPortableDatabasesList($databases) + { + $list = []; + foreach ($databases as $value) { + $list[] = $this->_getPortableDatabaseDefinition($value); + } + + return $list; + } + + /** + * Converts a list of namespace names from the native DBMS data definition to a portable Doctrine definition. + * + * @deprecated Use {@see listSchemaNames()} instead. + * + * @param array> $namespaces The list of namespace names + * in the native DBMS data definition. + * + * @return string[] + */ + protected function getPortableNamespacesList(array $namespaces) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4503', + 'AbstractSchemaManager::getPortableNamespacesList() is deprecated,' + . ' use AbstractSchemaManager::listSchemaNames() instead.', + ); + + $namespacesList = []; + + foreach ($namespaces as $namespace) { + $namespacesList[] = $this->getPortableNamespaceDefinition($namespace); + } + + return $namespacesList; + } + + /** + * @param mixed $database + * + * @return mixed + */ + protected function _getPortableDatabaseDefinition($database) + { + return $database; + } + + /** + * Converts a namespace definition from the native DBMS data definition to a portable Doctrine definition. + * + * @deprecated Use {@see listSchemaNames()} instead. + * + * @param array $namespace The native DBMS namespace definition. + * + * @return mixed + */ + protected function getPortableNamespaceDefinition(array $namespace) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4503', + 'AbstractSchemaManager::getPortableNamespaceDefinition() is deprecated,' + . ' use AbstractSchemaManager::listSchemaNames() instead.', + ); + + return $namespace; + } + + /** + * @param mixed[][] $sequences + * + * @return Sequence[] + * + * @throws Exception + */ + protected function _getPortableSequencesList($sequences) + { + $list = []; + + foreach ($sequences as $value) { + $list[] = $this->_getPortableSequenceDefinition($value); + } + + return $list; + } + + /** + * @param mixed[] $sequence + * + * @return Sequence + * + * @throws Exception + */ + protected function _getPortableSequenceDefinition($sequence) + { + throw Exception::notSupported('Sequences'); + } + + /** + * Independent of the database the keys of the column list result are lowercased. + * + * The name of the created column instance however is kept in its case. + * + * @param string $table The name of the table. + * @param string $database + * @param mixed[][] $tableColumns + * + * @return Column[] + * + * @throws Exception + */ + protected function _getPortableTableColumnList($table, $database, $tableColumns) + { + $eventManager = $this->_platform->getEventManager(); + + $list = []; + foreach ($tableColumns as $tableColumn) { + $column = null; + $defaultPrevented = false; + + if ($eventManager !== null && $eventManager->hasListeners(Events::onSchemaColumnDefinition)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/5784', + 'Subscribing to %s events is deprecated. Use a custom schema manager instead.', + Events::onSchemaColumnDefinition, + ); + + $eventArgs = new SchemaColumnDefinitionEventArgs($tableColumn, $table, $database, $this->_conn); + $eventManager->dispatchEvent(Events::onSchemaColumnDefinition, $eventArgs); + + $defaultPrevented = $eventArgs->isDefaultPrevented(); + $column = $eventArgs->getColumn(); + } + + if (! $defaultPrevented) { + $column = $this->_getPortableTableColumnDefinition($tableColumn); + } + + if ($column === null) { + continue; + } + + $name = strtolower($column->getQuotedName($this->_platform)); + $list[$name] = $column; + } + + return $list; + } + + /** + * Gets Table Column Definition. + * + * @param mixed[] $tableColumn + * + * @return Column + * + * @throws Exception + */ + abstract protected function _getPortableTableColumnDefinition($tableColumn); + + /** + * Aggregates and groups the index results according to the required data result. + * + * @param mixed[][] $tableIndexes + * @param string|null $tableName + * + * @return Index[] + * + * @throws Exception + */ + protected function _getPortableTableIndexesList($tableIndexes, $tableName = null) + { + $result = []; + foreach ($tableIndexes as $tableIndex) { + $indexName = $keyName = $tableIndex['key_name']; + if ($tableIndex['primary']) { + $keyName = 'primary'; + } + + $keyName = strtolower($keyName); + + if (! isset($result[$keyName])) { + $options = [ + 'lengths' => [], + ]; + + if (isset($tableIndex['where'])) { + $options['where'] = $tableIndex['where']; + } + + $result[$keyName] = [ + 'name' => $indexName, + 'columns' => [], + 'unique' => ! $tableIndex['non_unique'], + 'primary' => $tableIndex['primary'], + 'flags' => $tableIndex['flags'] ?? [], + 'options' => $options, + ]; + } + + $result[$keyName]['columns'][] = $tableIndex['column_name']; + $result[$keyName]['options']['lengths'][] = $tableIndex['length'] ?? null; + } + + $eventManager = $this->_platform->getEventManager(); + + $indexes = []; + foreach ($result as $indexKey => $data) { + $index = null; + $defaultPrevented = false; + + if ($eventManager !== null && $eventManager->hasListeners(Events::onSchemaIndexDefinition)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/5784', + 'Subscribing to %s events is deprecated. Use a custom schema manager instead.', + Events::onSchemaColumnDefinition, + ); + + $eventArgs = new SchemaIndexDefinitionEventArgs($data, $tableName, $this->_conn); + $eventManager->dispatchEvent(Events::onSchemaIndexDefinition, $eventArgs); + + $defaultPrevented = $eventArgs->isDefaultPrevented(); + $index = $eventArgs->getIndex(); + } + + if (! $defaultPrevented) { + $index = new Index( + $data['name'], + $data['columns'], + $data['unique'], + $data['primary'], + $data['flags'], + $data['options'], + ); + } + + if ($index === null) { + continue; + } + + $indexes[$indexKey] = $index; + } + + return $indexes; + } + + /** + * @param mixed[][] $tables + * + * @return string[] + */ + protected function _getPortableTablesList($tables) + { + $list = []; + foreach ($tables as $value) { + $list[] = $this->_getPortableTableDefinition($value); + } + + return $list; + } + + /** + * @param mixed $table + * + * @return string + */ + protected function _getPortableTableDefinition($table) + { + return $table; + } + + /** + * @param mixed[][] $views + * + * @return View[] + */ + protected function _getPortableViewsList($views) + { + $list = []; + foreach ($views as $value) { + $view = $this->_getPortableViewDefinition($value); + + if ($view === false) { + continue; + } + + $viewName = strtolower($view->getQuotedName($this->_platform)); + $list[$viewName] = $view; + } + + return $list; + } + + /** + * @param mixed[] $view + * + * @return View|false + */ + protected function _getPortableViewDefinition($view) + { + return false; + } + + /** + * @param mixed[][] $tableForeignKeys + * + * @return ForeignKeyConstraint[] + */ + protected function _getPortableTableForeignKeysList($tableForeignKeys) + { + $list = []; + + foreach ($tableForeignKeys as $value) { + $list[] = $this->_getPortableTableForeignKeyDefinition($value); + } + + return $list; + } + + /** + * @param mixed $tableForeignKey + * + * @return ForeignKeyConstraint + * + * @abstract + */ + protected function _getPortableTableForeignKeyDefinition($tableForeignKey) + { + return $tableForeignKey; + } + + /** + * @internal + * + * @param string[]|string $sql + * + * @return void + * + * @throws Exception + */ + protected function _execSql($sql) + { + foreach ((array) $sql as $query) { + $this->_conn->executeStatement($query); + } + } + + /** + * Creates a schema instance for the current database. + * + * @deprecated Use {@link introspectSchema()} instead. + * + * @return Schema + * + * @throws Exception + */ + public function createSchema() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5613', + '%s is deprecated. Use introspectSchema() instead.', + __METHOD__, + ); + + $schemaNames = []; + + if ($this->_platform->supportsSchemas()) { + $schemaNames = $this->listNamespaceNames(); + } + + $sequences = []; + + if ($this->_platform->supportsSequences()) { + $sequences = $this->listSequences(); + } + + $tables = $this->listTables(); + + return new Schema($tables, $sequences, $this->createSchemaConfig(), $schemaNames); + } + + /** + * Returns a {@see Schema} instance representing the current database schema. + * + * @throws Exception + */ + public function introspectSchema(): Schema + { + return $this->createSchema(); + } + + /** + * Creates the configuration for this schema. + * + * @return SchemaConfig + * + * @throws Exception + */ + public function createSchemaConfig() + { + $schemaConfig = new SchemaConfig(); + $schemaConfig->setMaxIdentifierLength($this->_platform->getMaxIdentifierLength()); + + $searchPaths = $this->getSchemaSearchPaths(); + if (isset($searchPaths[0])) { + $schemaConfig->setName($searchPaths[0]); + } + + $params = $this->_conn->getParams(); + if (! isset($params['defaultTableOptions'])) { + $params['defaultTableOptions'] = []; + } + + if (! isset($params['defaultTableOptions']['charset']) && isset($params['charset'])) { + $params['defaultTableOptions']['charset'] = $params['charset']; + } + + $schemaConfig->setDefaultTableOptions($params['defaultTableOptions']); + + return $schemaConfig; + } + + /** + * The search path for namespaces in the currently connected database. + * + * The first entry is usually the default namespace in the Schema. All + * further namespaces contain tables/sequences which can also be addressed + * with a short, not full-qualified name. + * + * For databases that don't support subschema/namespaces this method + * returns the name of the currently connected database. + * + * @deprecated + * + * @return string[] + * + * @throws Exception + */ + public function getSchemaSearchPaths() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4821', + 'AbstractSchemaManager::getSchemaSearchPaths() is deprecated.', + ); + + $database = $this->_conn->getDatabase(); + + if ($database !== null) { + return [$database]; + } + + return []; + } + + /** + * Given a table comment this method tries to extract a typehint for Doctrine Type, or returns + * the type given as default. + * + * @internal This method should be only used from within the AbstractSchemaManager class hierarchy. + * + * @param string|null $comment + * @param string $currentType + * + * @return string + */ + public function extractDoctrineTypeFromComment($comment, $currentType) + { + if ($comment !== null && preg_match('(\(DC2Type:(((?!\)).)+)\))', $comment, $match) === 1) { + return $match[1]; + } + + return $currentType; + } + + /** + * @internal This method should be only used from within the AbstractSchemaManager class hierarchy. + * + * @param string|null $comment + * @param string|null $type + * + * @return string|null + */ + public function removeDoctrineTypeFromComment($comment, $type) + { + if ($comment === null) { + return null; + } + + return str_replace('(DC2Type:' . $type . ')', '', $comment); + } + + /** @throws Exception */ + private function getDatabase(string $methodName): string + { + $database = $this->_conn->getDatabase(); + + if ($database === null) { + throw DatabaseRequired::new($methodName); + } + + return $database; + } + + public function createComparator(): Comparator + { + return new Comparator($this->_platform); + } + + /** + * @return array>> + * + * @throws Exception + */ + private function fetchAllAssociativeGrouped(Result $result): array + { + $data = []; + + foreach ($result->fetchAllAssociative() as $row) { + $tableName = $this->_getPortableTableDefinition($row); + $data[$tableName][] = $row; + } + + return $data; + } +} diff --git a/vendor/doctrine/dbal/src/Schema/Column.php b/vendor/doctrine/dbal/src/Schema/Column.php new file mode 100644 index 00000000..8a5703c0 --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/Column.php @@ -0,0 +1,466 @@ +_setName($name); + $this->setType($type); + $this->setOptions($options); + } + + /** + * @param mixed[] $options + * + * @return Column + * + * @throws SchemaException + */ + public function setOptions(array $options) + { + foreach ($options as $name => $value) { + $method = 'set' . $name; + + if (! method_exists($this, $method)) { + throw UnknownColumnOption::new($name); + } + + $this->$method($value); + } + + return $this; + } + + /** @return Column */ + public function setType(Type $type) + { + $this->_type = $type; + + return $this; + } + + /** + * @param int|null $length + * + * @return Column + */ + public function setLength($length) + { + if ($length !== null) { + $this->_length = (int) $length; + } else { + $this->_length = null; + } + + return $this; + } + + /** + * @param int $precision + * + * @return Column + */ + public function setPrecision($precision) + { + if (! is_numeric($precision)) { + $precision = 10; // defaults to 10 when no valid precision is given. + } + + $this->_precision = (int) $precision; + + return $this; + } + + /** + * @param int $scale + * + * @return Column + */ + public function setScale($scale) + { + if (! is_numeric($scale)) { + $scale = 0; + } + + $this->_scale = (int) $scale; + + return $this; + } + + /** + * @param bool $unsigned + * + * @return Column + */ + public function setUnsigned($unsigned) + { + $this->_unsigned = (bool) $unsigned; + + return $this; + } + + /** + * @param bool $fixed + * + * @return Column + */ + public function setFixed($fixed) + { + $this->_fixed = (bool) $fixed; + + return $this; + } + + /** + * @param bool $notnull + * + * @return Column + */ + public function setNotnull($notnull) + { + $this->_notnull = (bool) $notnull; + + return $this; + } + + /** + * @param mixed $default + * + * @return Column + */ + public function setDefault($default) + { + $this->_default = $default; + + return $this; + } + + /** + * @param mixed[] $platformOptions + * + * @return Column + */ + public function setPlatformOptions(array $platformOptions) + { + $this->_platformOptions = $platformOptions; + + return $this; + } + + /** + * @param string $name + * @param mixed $value + * + * @return Column + */ + public function setPlatformOption($name, $value) + { + $this->_platformOptions[$name] = $value; + + return $this; + } + + /** + * @param string|null $value + * + * @return Column + */ + public function setColumnDefinition($value) + { + $this->_columnDefinition = $value; + + return $this; + } + + /** @return Type */ + public function getType() + { + return $this->_type; + } + + /** @return int|null */ + public function getLength() + { + return $this->_length; + } + + /** @return int */ + public function getPrecision() + { + return $this->_precision; + } + + /** @return int */ + public function getScale() + { + return $this->_scale; + } + + /** @return bool */ + public function getUnsigned() + { + return $this->_unsigned; + } + + /** @return bool */ + public function getFixed() + { + return $this->_fixed; + } + + /** @return bool */ + public function getNotnull() + { + return $this->_notnull; + } + + /** @return string|null */ + public function getDefault() + { + return $this->_default; + } + + /** @return mixed[] */ + public function getPlatformOptions() + { + return $this->_platformOptions; + } + + /** + * @param string $name + * + * @return bool + */ + public function hasPlatformOption($name) + { + return isset($this->_platformOptions[$name]); + } + + /** + * @param string $name + * + * @return mixed + */ + public function getPlatformOption($name) + { + return $this->_platformOptions[$name]; + } + + /** @return string|null */ + public function getColumnDefinition() + { + return $this->_columnDefinition; + } + + /** @return bool */ + public function getAutoincrement() + { + return $this->_autoincrement; + } + + /** + * @param bool $flag + * + * @return Column + */ + public function setAutoincrement($flag) + { + $this->_autoincrement = $flag; + + return $this; + } + + /** + * @param string|null $comment + * + * @return Column + */ + public function setComment($comment) + { + $this->_comment = $comment; + + return $this; + } + + /** @return string|null */ + public function getComment() + { + return $this->_comment; + } + + /** + * @deprecated Use {@link setPlatformOption() instead} + * + * @param string $name + * @param mixed $value + * + * @return Column + */ + public function setCustomSchemaOption($name, $value) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5476', + 'Column::setCustomSchemaOption() is deprecated. Use setPlatformOption() instead.', + ); + + $this->_customSchemaOptions[$name] = $value; + + return $this; + } + + /** + * @deprecated Use {@link hasPlatformOption() instead} + * + * @param string $name + * + * @return bool + */ + public function hasCustomSchemaOption($name) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5476', + 'Column::hasCustomSchemaOption() is deprecated. Use hasPlatformOption() instead.', + ); + + return isset($this->_customSchemaOptions[$name]); + } + + /** + * @deprecated Use {@link getPlatformOption() instead} + * + * @param string $name + * + * @return mixed + */ + public function getCustomSchemaOption($name) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5476', + 'Column::getCustomSchemaOption() is deprecated. Use getPlatformOption() instead.', + ); + + return $this->_customSchemaOptions[$name]; + } + + /** + * @deprecated Use {@link setPlatformOptions() instead} + * + * @param mixed[] $customSchemaOptions + * + * @return Column + */ + public function setCustomSchemaOptions(array $customSchemaOptions) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5476', + 'Column::setCustomSchemaOptions() is deprecated. Use setPlatformOptions() instead.', + ); + + $this->_customSchemaOptions = $customSchemaOptions; + + return $this; + } + + /** + * @deprecated Use {@link getPlatformOptions() instead} + * + * @return mixed[] + */ + public function getCustomSchemaOptions() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5476', + 'Column::getCustomSchemaOptions() is deprecated. Use getPlatformOptions() instead.', + ); + + return $this->_customSchemaOptions; + } + + /** @return mixed[] */ + public function toArray() + { + return array_merge([ + 'name' => $this->_name, + 'type' => $this->_type, + 'default' => $this->_default, + 'notnull' => $this->_notnull, + 'length' => $this->_length, + 'precision' => $this->_precision, + 'scale' => $this->_scale, + 'fixed' => $this->_fixed, + 'unsigned' => $this->_unsigned, + 'autoincrement' => $this->_autoincrement, + 'columnDefinition' => $this->_columnDefinition, + 'comment' => $this->_comment, + ], $this->_platformOptions, $this->_customSchemaOptions); + } +} diff --git a/vendor/doctrine/dbal/src/Schema/ColumnDiff.php b/vendor/doctrine/dbal/src/Schema/ColumnDiff.php new file mode 100644 index 00000000..bd1b0eee --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/ColumnDiff.php @@ -0,0 +1,169 @@ +oldColumnName = $oldColumnName; + $this->column = $column; + $this->changedProperties = $changedProperties; + $this->fromColumn = $fromColumn; + } + + public function getOldColumn(): ?Column + { + return $this->fromColumn; + } + + public function getNewColumn(): Column + { + return $this->column; + } + + public function hasTypeChanged(): bool + { + return $this->hasChanged('type'); + } + + public function hasLengthChanged(): bool + { + return $this->hasChanged('length'); + } + + public function hasPrecisionChanged(): bool + { + return $this->hasChanged('precision'); + } + + public function hasScaleChanged(): bool + { + return $this->hasChanged('scale'); + } + + public function hasUnsignedChanged(): bool + { + return $this->hasChanged('unsigned'); + } + + public function hasFixedChanged(): bool + { + return $this->hasChanged('fixed'); + } + + public function hasNotNullChanged(): bool + { + return $this->hasChanged('notnull'); + } + + public function hasDefaultChanged(): bool + { + return $this->hasChanged('default'); + } + + public function hasAutoIncrementChanged(): bool + { + return $this->hasChanged('autoincrement'); + } + + public function hasCommentChanged(): bool + { + return $this->hasChanged('comment'); + } + + /** + * @deprecated Use {@see hasTypeChanged()}, {@see hasLengthChanged()}, {@see hasPrecisionChanged()}, + * {@see hasScaleChanged()}, {@see hasUnsignedChanged()}, {@see hasFixedChanged()}, {@see hasNotNullChanged()}, + * {@see hasDefaultChanged()}, {@see hasAutoIncrementChanged()} or {@see hasCommentChanged()} instead. + * + * @param string $propertyName + * + * @return bool + */ + public function hasChanged($propertyName) + { + return in_array($propertyName, $this->changedProperties, true); + } + + /** + * @deprecated Use {@see $fromColumn} instead. + * + * @return Identifier + */ + public function getOldColumnName() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5622', + '%s is deprecated. Use $fromColumn instead.', + __METHOD__, + ); + + if ($this->fromColumn !== null) { + $name = $this->fromColumn->getName(); + $quote = $this->fromColumn->isQuoted(); + } else { + $name = $this->oldColumnName; + $quote = false; + } + + return new Identifier($name, $quote); + } +} diff --git a/vendor/doctrine/dbal/src/Schema/Comparator.php b/vendor/doctrine/dbal/src/Schema/Comparator.php new file mode 100644 index 00000000..01c0abcd --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/Comparator.php @@ -0,0 +1,716 @@ +platform = $platform; + } + + /** @param list $args */ + public function __call(string $method, array $args): SchemaDiff + { + if ($method !== 'compareSchemas') { + throw new BadMethodCallException(sprintf('Unknown method "%s"', $method)); + } + + return $this->doCompareSchemas(...$args); + } + + /** @param list $args */ + public static function __callStatic(string $method, array $args): SchemaDiff + { + if ($method !== 'compareSchemas') { + throw new BadMethodCallException(sprintf('Unknown method "%s"', $method)); + } + + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4707', + 'Calling %s::%s() statically is deprecated.', + self::class, + $method, + ); + + $comparator = new self(); + + return $comparator->doCompareSchemas(...$args); + } + + /** + * Returns a SchemaDiff object containing the differences between the schemas $fromSchema and $toSchema. + * + * This method should be called non-statically since it will be declared as non-static in the next major release. + * + * @return SchemaDiff + * + * @throws SchemaException + */ + private function doCompareSchemas( + Schema $fromSchema, + Schema $toSchema + ) { + $createdSchemas = []; + $droppedSchemas = []; + $createdTables = []; + $alteredTables = []; + $droppedTables = []; + $createdSequences = []; + $alteredSequences = []; + $droppedSequences = []; + + $orphanedForeignKeys = []; + + $foreignKeysToTable = []; + + foreach ($toSchema->getNamespaces() as $namespace) { + if ($fromSchema->hasNamespace($namespace)) { + continue; + } + + $createdSchemas[$namespace] = $namespace; + } + + foreach ($fromSchema->getNamespaces() as $namespace) { + if ($toSchema->hasNamespace($namespace)) { + continue; + } + + $droppedSchemas[$namespace] = $namespace; + } + + foreach ($toSchema->getTables() as $table) { + $tableName = $table->getShortestName($toSchema->getName()); + if (! $fromSchema->hasTable($tableName)) { + $createdTables[$tableName] = $toSchema->getTable($tableName); + } else { + $tableDifferences = $this->diffTable( + $fromSchema->getTable($tableName), + $toSchema->getTable($tableName), + ); + + if ($tableDifferences !== false) { + $alteredTables[$tableName] = $tableDifferences; + } + } + } + + /* Check if there are tables removed */ + foreach ($fromSchema->getTables() as $table) { + $tableName = $table->getShortestName($fromSchema->getName()); + + $table = $fromSchema->getTable($tableName); + if (! $toSchema->hasTable($tableName)) { + $droppedTables[$tableName] = $table; + } + + // also remember all foreign keys that point to a specific table + foreach ($table->getForeignKeys() as $foreignKey) { + $foreignTable = strtolower($foreignKey->getForeignTableName()); + if (! isset($foreignKeysToTable[$foreignTable])) { + $foreignKeysToTable[$foreignTable] = []; + } + + $foreignKeysToTable[$foreignTable][] = $foreignKey; + } + } + + foreach ($droppedTables as $tableName => $table) { + if (! isset($foreignKeysToTable[$tableName])) { + continue; + } + + foreach ($foreignKeysToTable[$tableName] as $foreignKey) { + if (isset($droppedTables[strtolower($foreignKey->getLocalTableName())])) { + continue; + } + + $orphanedForeignKeys[] = $foreignKey; + } + + // deleting duplicated foreign keys present on both on the orphanedForeignKey + // and the removedForeignKeys from changedTables + foreach ($foreignKeysToTable[$tableName] as $foreignKey) { + // strtolower the table name to make if compatible with getShortestName + $localTableName = strtolower($foreignKey->getLocalTableName()); + if (! isset($alteredTables[$localTableName])) { + continue; + } + + foreach ($alteredTables[$localTableName]->getDroppedForeignKeys() as $droppedForeignKey) { + assert($droppedForeignKey instanceof ForeignKeyConstraint); + + // We check if the key is from the removed table if not we skip. + if ($tableName !== strtolower($droppedForeignKey->getForeignTableName())) { + continue; + } + + $alteredTables[$localTableName]->unsetDroppedForeignKey($droppedForeignKey); + } + } + } + + foreach ($toSchema->getSequences() as $sequence) { + $sequenceName = $sequence->getShortestName($toSchema->getName()); + if (! $fromSchema->hasSequence($sequenceName)) { + if (! $this->isAutoIncrementSequenceInSchema($fromSchema, $sequence)) { + $createdSequences[] = $sequence; + } + } else { + if ($this->diffSequence($sequence, $fromSchema->getSequence($sequenceName))) { + $alteredSequences[] = $toSchema->getSequence($sequenceName); + } + } + } + + foreach ($fromSchema->getSequences() as $sequence) { + if ($this->isAutoIncrementSequenceInSchema($toSchema, $sequence)) { + continue; + } + + $sequenceName = $sequence->getShortestName($fromSchema->getName()); + + if ($toSchema->hasSequence($sequenceName)) { + continue; + } + + $droppedSequences[] = $sequence; + } + + $diff = new SchemaDiff( + $createdTables, + $alteredTables, + $droppedTables, + $fromSchema, + $createdSchemas, + $droppedSchemas, + $createdSequences, + $alteredSequences, + $droppedSequences, + ); + + $diff->orphanedForeignKeys = $orphanedForeignKeys; + + return $diff; + } + + /** + * @deprecated Use non-static call to {@see compareSchemas()} instead. + * + * @return SchemaDiff + * + * @throws SchemaException + */ + public function compare(Schema $fromSchema, Schema $toSchema) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4707', + 'Method compare() is deprecated. Use a non-static call to compareSchemas() instead.', + ); + + return $this->compareSchemas($fromSchema, $toSchema); + } + + /** + * @param Schema $schema + * @param Sequence $sequence + */ + private function isAutoIncrementSequenceInSchema($schema, $sequence): bool + { + foreach ($schema->getTables() as $table) { + if ($sequence->isAutoIncrementsFor($table)) { + return true; + } + } + + return false; + } + + /** @return bool */ + public function diffSequence(Sequence $sequence1, Sequence $sequence2) + { + if ($sequence1->getAllocationSize() !== $sequence2->getAllocationSize()) { + return true; + } + + return $sequence1->getInitialValue() !== $sequence2->getInitialValue(); + } + + /** + * Returns the difference between the tables $fromTable and $toTable. + * + * If there are no differences this method returns the boolean false. + * + * @deprecated Use {@see compareTables()} and, optionally, {@see TableDiff::isEmpty()} instead. + * + * @return TableDiff|false + * + * @throws Exception + */ + public function diffTable(Table $fromTable, Table $toTable) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5770', + '%s is deprecated. Use compareTables() instead.', + __METHOD__, + ); + + $diff = $this->compareTables($fromTable, $toTable); + + if ($diff->isEmpty()) { + return false; + } + + return $diff; + } + + /** + * Compares the tables and returns the difference between them. + * + * @throws Exception + */ + public function compareTables(Table $fromTable, Table $toTable): TableDiff + { + $addedColumns = []; + $modifiedColumns = []; + $droppedColumns = []; + $addedIndexes = []; + $modifiedIndexes = []; + $droppedIndexes = []; + $addedForeignKeys = []; + $modifiedForeignKeys = []; + $droppedForeignKeys = []; + + $fromTableColumns = $fromTable->getColumns(); + $toTableColumns = $toTable->getColumns(); + + /* See if all the columns in "from" table exist in "to" table */ + foreach ($toTableColumns as $columnName => $column) { + if ($fromTable->hasColumn($columnName)) { + continue; + } + + $addedColumns[$columnName] = $column; + } + + /* See if there are any removed columns in "to" table */ + foreach ($fromTableColumns as $columnName => $column) { + // See if column is removed in "to" table. + if (! $toTable->hasColumn($columnName)) { + $droppedColumns[$columnName] = $column; + + continue; + } + + $toColumn = $toTable->getColumn($columnName); + + // See if column has changed properties in "to" table. + $changedProperties = $this->diffColumn($column, $toColumn); + + if ($this->platform !== null) { + if ($this->columnsEqual($column, $toColumn)) { + continue; + } + } elseif (count($changedProperties) === 0) { + continue; + } + + $modifiedColumns[$column->getName()] = new ColumnDiff( + $column->getName(), + $toColumn, + $changedProperties, + $column, + ); + } + + $renamedColumns = $this->detectRenamedColumns($addedColumns, $droppedColumns); + + $fromTableIndexes = $fromTable->getIndexes(); + $toTableIndexes = $toTable->getIndexes(); + + /* See if all the indexes in "from" table exist in "to" table */ + foreach ($toTableIndexes as $indexName => $index) { + if (($index->isPrimary() && $fromTable->getPrimaryKey() !== null) || $fromTable->hasIndex($indexName)) { + continue; + } + + $addedIndexes[$indexName] = $index; + } + + /* See if there are any removed indexes in "to" table */ + foreach ($fromTableIndexes as $indexName => $index) { + // See if index is removed in "to" table. + if ( + ($index->isPrimary() && $toTable->getPrimaryKey() === null) || + ! $index->isPrimary() && ! $toTable->hasIndex($indexName) + ) { + $droppedIndexes[$indexName] = $index; + + continue; + } + + // See if index has changed in "to" table. + $toTableIndex = $index->isPrimary() ? $toTable->getPrimaryKey() : $toTable->getIndex($indexName); + assert($toTableIndex instanceof Index); + + if (! $this->diffIndex($index, $toTableIndex)) { + continue; + } + + $modifiedIndexes[$indexName] = $toTableIndex; + } + + $renamedIndexes = $this->detectRenamedIndexes($addedIndexes, $droppedIndexes); + + $fromForeignKeys = $fromTable->getForeignKeys(); + $toForeignKeys = $toTable->getForeignKeys(); + + foreach ($fromForeignKeys as $fromKey => $fromConstraint) { + foreach ($toForeignKeys as $toKey => $toConstraint) { + if ($this->diffForeignKey($fromConstraint, $toConstraint) === false) { + unset($fromForeignKeys[$fromKey], $toForeignKeys[$toKey]); + } else { + if (strtolower($fromConstraint->getName()) === strtolower($toConstraint->getName())) { + $modifiedForeignKeys[] = $toConstraint; + + unset($fromForeignKeys[$fromKey], $toForeignKeys[$toKey]); + } + } + } + } + + foreach ($fromForeignKeys as $fromConstraint) { + $droppedForeignKeys[] = $fromConstraint; + } + + foreach ($toForeignKeys as $toConstraint) { + $addedForeignKeys[] = $toConstraint; + } + + return new TableDiff( + $toTable->getName(), + $addedColumns, + $modifiedColumns, + $droppedColumns, + $addedIndexes, + $modifiedIndexes, + $droppedIndexes, + $fromTable, + $addedForeignKeys, + $modifiedForeignKeys, + $droppedForeignKeys, + $renamedColumns, + $renamedIndexes, + ); + } + + /** + * Try to find columns that only changed their name, rename operations maybe cheaper than add/drop + * however ambiguities between different possibilities should not lead to renaming at all. + * + * @param array $addedColumns + * @param array $removedColumns + * + * @return array + * + * @throws Exception + */ + private function detectRenamedColumns(array &$addedColumns, array &$removedColumns): array + { + $candidatesByName = []; + + foreach ($addedColumns as $addedColumnName => $addedColumn) { + foreach ($removedColumns as $removedColumn) { + if (! $this->columnsEqual($addedColumn, $removedColumn)) { + continue; + } + + $candidatesByName[$addedColumn->getName()][] = [$removedColumn, $addedColumn, $addedColumnName]; + } + } + + $renamedColumns = []; + + foreach ($candidatesByName as $candidates) { + if (count($candidates) !== 1) { + continue; + } + + [$removedColumn, $addedColumn] = $candidates[0]; + $removedColumnName = $removedColumn->getName(); + $addedColumnName = strtolower($addedColumn->getName()); + + if (isset($renamedColumns[$removedColumnName])) { + continue; + } + + $renamedColumns[$removedColumnName] = $addedColumn; + unset( + $addedColumns[$addedColumnName], + $removedColumns[strtolower($removedColumnName)], + ); + } + + return $renamedColumns; + } + + /** + * Try to find indexes that only changed their name, rename operations maybe cheaper than add/drop + * however ambiguities between different possibilities should not lead to renaming at all. + * + * @param array $addedIndexes + * @param array $removedIndexes + * + * @return array + */ + private function detectRenamedIndexes(array &$addedIndexes, array &$removedIndexes): array + { + $candidatesByName = []; + + // Gather possible rename candidates by comparing each added and removed index based on semantics. + foreach ($addedIndexes as $addedIndexName => $addedIndex) { + foreach ($removedIndexes as $removedIndex) { + if ($this->diffIndex($addedIndex, $removedIndex)) { + continue; + } + + $candidatesByName[$addedIndex->getName()][] = [$removedIndex, $addedIndex, $addedIndexName]; + } + } + + $renamedIndexes = []; + + foreach ($candidatesByName as $candidates) { + // If the current rename candidate contains exactly one semantically equal index, + // we can safely rename it. + // Otherwise, it is unclear if a rename action is really intended, + // therefore we let those ambiguous indexes be added/dropped. + if (count($candidates) !== 1) { + continue; + } + + [$removedIndex, $addedIndex] = $candidates[0]; + + $removedIndexName = strtolower($removedIndex->getName()); + $addedIndexName = strtolower($addedIndex->getName()); + + if (isset($renamedIndexes[$removedIndexName])) { + continue; + } + + $renamedIndexes[$removedIndexName] = $addedIndex; + unset( + $addedIndexes[$addedIndexName], + $removedIndexes[$removedIndexName], + ); + } + + return $renamedIndexes; + } + + /** + * @internal The method should be only used from within the {@see Comparator} class hierarchy. + * + * @return bool + */ + public function diffForeignKey(ForeignKeyConstraint $key1, ForeignKeyConstraint $key2) + { + if ( + array_map('strtolower', $key1->getUnquotedLocalColumns()) + !== array_map('strtolower', $key2->getUnquotedLocalColumns()) + ) { + return true; + } + + if ( + array_map('strtolower', $key1->getUnquotedForeignColumns()) + !== array_map('strtolower', $key2->getUnquotedForeignColumns()) + ) { + return true; + } + + if ($key1->getUnqualifiedForeignTableName() !== $key2->getUnqualifiedForeignTableName()) { + return true; + } + + if ($key1->onUpdate() !== $key2->onUpdate()) { + return true; + } + + return $key1->onDelete() !== $key2->onDelete(); + } + + /** + * Compares the definitions of the given columns + * + * @internal The method should be only used from within the {@see Comparator} class hierarchy. + * + * @throws Exception + */ + public function columnsEqual(Column $column1, Column $column2): bool + { + if ($this->platform === null) { + return $this->diffColumn($column1, $column2) === []; + } + + return $this->platform->columnsEqual($column1, $column2); + } + + /** + * Returns the difference between the columns + * + * If there are differences this method returns the changed properties as a + * string array, otherwise an empty array gets returned. + * + * @deprecated Use {@see columnsEqual()} instead. + * + * @return string[] + */ + public function diffColumn(Column $column1, Column $column2) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5650', + '%s is deprecated. Use diffTable() instead.', + __METHOD__, + ); + + $properties1 = $column1->toArray(); + $properties2 = $column2->toArray(); + + $changedProperties = []; + + if (get_class($properties1['type']) !== get_class($properties2['type'])) { + $changedProperties[] = 'type'; + } + + foreach (['notnull', 'unsigned', 'autoincrement'] as $property) { + if ($properties1[$property] === $properties2[$property]) { + continue; + } + + $changedProperties[] = $property; + } + + // Null values need to be checked additionally as they tell whether to create or drop a default value. + // null != 0, null != false, null != '' etc. This affects platform's table alteration SQL generation. + if ( + ($properties1['default'] === null) !== ($properties2['default'] === null) + || $properties1['default'] != $properties2['default'] + ) { + $changedProperties[] = 'default'; + } + + if ( + ($properties1['type'] instanceof Types\StringType && ! $properties1['type'] instanceof Types\GuidType) || + $properties1['type'] instanceof Types\BinaryType + ) { + // check if value of length is set at all, default value assumed otherwise. + $length1 = $properties1['length'] ?? 255; + $length2 = $properties2['length'] ?? 255; + if ($length1 !== $length2) { + $changedProperties[] = 'length'; + } + + if ($properties1['fixed'] !== $properties2['fixed']) { + $changedProperties[] = 'fixed'; + } + } elseif ($properties1['type'] instanceof Types\DecimalType) { + if (($properties1['precision'] ?? 10) !== ($properties2['precision'] ?? 10)) { + $changedProperties[] = 'precision'; + } + + if ($properties1['scale'] !== $properties2['scale']) { + $changedProperties[] = 'scale'; + } + } + + // A null value and an empty string are actually equal for a comment so they should not trigger a change. + if ( + $properties1['comment'] !== $properties2['comment'] && + ! ($properties1['comment'] === null && $properties2['comment'] === '') && + ! ($properties2['comment'] === null && $properties1['comment'] === '') + ) { + $changedProperties[] = 'comment'; + } + + $customOptions1 = $column1->getCustomSchemaOptions(); + $customOptions2 = $column2->getCustomSchemaOptions(); + + foreach (array_merge(array_keys($customOptions1), array_keys($customOptions2)) as $key) { + if (! array_key_exists($key, $properties1) || ! array_key_exists($key, $properties2)) { + $changedProperties[] = $key; + } elseif ($properties1[$key] !== $properties2[$key]) { + $changedProperties[] = $key; + } + } + + $platformOptions1 = $column1->getPlatformOptions(); + $platformOptions2 = $column2->getPlatformOptions(); + + foreach (array_keys(array_intersect_key($platformOptions1, $platformOptions2)) as $key) { + if ($properties1[$key] === $properties2[$key]) { + continue; + } + + $changedProperties[] = $key; + } + + return array_unique($changedProperties); + } + + /** + * Finds the difference between the indexes $index1 and $index2. + * + * Compares $index1 with $index2 and returns $index2 if there are any + * differences or false in case there are no differences. + * + * @internal The method should be only used from within the {@see Comparator} class hierarchy. + * + * @return bool + */ + public function diffIndex(Index $index1, Index $index2) + { + return ! ($index1->isFulfilledBy($index2) && $index2->isFulfilledBy($index1)); + } +} diff --git a/vendor/doctrine/dbal/src/Schema/Constraint.php b/vendor/doctrine/dbal/src/Schema/Constraint.php new file mode 100644 index 00000000..f47ee1fd --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/Constraint.php @@ -0,0 +1,41 @@ + + */ +class DB2SchemaManager extends AbstractSchemaManager +{ + /** + * {@inheritDoc} + */ + public function listTableNames() + { + return $this->doListTableNames(); + } + + /** + * {@inheritDoc} + */ + public function listTables() + { + return $this->doListTables(); + } + + /** + * {@inheritDoc} + * + * @deprecated Use {@see introspectTable()} instead. + */ + public function listTableDetails($name) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5595', + '%s is deprecated. Use introspectTable() instead.', + __METHOD__, + ); + + return $this->doListTableDetails($name); + } + + /** + * {@inheritDoc} + */ + public function listTableColumns($table, $database = null) + { + return $this->doListTableColumns($table, $database); + } + + /** + * {@inheritDoc} + */ + public function listTableIndexes($table) + { + return $this->doListTableIndexes($table); + } + + /** + * {@inheritDoc} + */ + public function listTableForeignKeys($table, $database = null) + { + return $this->doListTableForeignKeys($table, $database); + } + + /** + * {@inheritdoc} + * + * @throws Exception + */ + protected function _getPortableTableColumnDefinition($tableColumn) + { + $tableColumn = array_change_key_case($tableColumn, CASE_LOWER); + + $length = null; + $fixed = null; + $scale = false; + $precision = false; + + $default = null; + + if ($tableColumn['default'] !== null && $tableColumn['default'] !== 'NULL') { + $default = $tableColumn['default']; + + if (preg_match('/^\'(.*)\'$/s', $default, $matches) === 1) { + $default = str_replace("''", "'", $matches[1]); + } + } + + $type = $this->_platform->getDoctrineTypeMapping($tableColumn['typename']); + + if (isset($tableColumn['comment'])) { + $type = $this->extractDoctrineTypeFromComment($tableColumn['comment'], $type); + $tableColumn['comment'] = $this->removeDoctrineTypeFromComment($tableColumn['comment'], $type); + } + + switch (strtolower($tableColumn['typename'])) { + case 'varchar': + if ($tableColumn['codepage'] === 0) { + $type = Types::BINARY; + } + + $length = $tableColumn['length']; + $fixed = false; + break; + + case 'character': + if ($tableColumn['codepage'] === 0) { + $type = Types::BINARY; + } + + $length = $tableColumn['length']; + $fixed = true; + break; + + case 'clob': + $length = $tableColumn['length']; + break; + + case 'decimal': + case 'double': + case 'real': + $scale = $tableColumn['scale']; + $precision = $tableColumn['length']; + break; + } + + $options = [ + 'length' => $length, + 'unsigned' => false, + 'fixed' => (bool) $fixed, + 'default' => $default, + 'autoincrement' => (bool) $tableColumn['autoincrement'], + 'notnull' => $tableColumn['nulls'] === 'N', + 'scale' => null, + 'precision' => null, + 'comment' => isset($tableColumn['comment']) && $tableColumn['comment'] !== '' + ? $tableColumn['comment'] + : null, + 'platformOptions' => [], + ]; + + if ($scale !== null && $precision !== null) { + $options['scale'] = $scale; + $options['precision'] = $precision; + } + + return new Column($tableColumn['colname'], Type::getType($type), $options); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableDefinition($table) + { + $table = array_change_key_case($table, CASE_LOWER); + + return $table['name']; + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableIndexesList($tableIndexes, $tableName = null) + { + foreach ($tableIndexes as &$tableIndexRow) { + $tableIndexRow = array_change_key_case($tableIndexRow, CASE_LOWER); + $tableIndexRow['primary'] = (bool) $tableIndexRow['primary']; + } + + return parent::_getPortableTableIndexesList($tableIndexes, $tableName); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableForeignKeyDefinition($tableForeignKey) + { + return new ForeignKeyConstraint( + $tableForeignKey['local_columns'], + $tableForeignKey['foreign_table'], + $tableForeignKey['foreign_columns'], + $tableForeignKey['name'], + $tableForeignKey['options'], + ); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableForeignKeysList($tableForeignKeys) + { + $foreignKeys = []; + + foreach ($tableForeignKeys as $tableForeignKey) { + $tableForeignKey = array_change_key_case($tableForeignKey, CASE_LOWER); + + if (! isset($foreignKeys[$tableForeignKey['index_name']])) { + $foreignKeys[$tableForeignKey['index_name']] = [ + 'local_columns' => [$tableForeignKey['local_column']], + 'foreign_table' => $tableForeignKey['foreign_table'], + 'foreign_columns' => [$tableForeignKey['foreign_column']], + 'name' => $tableForeignKey['index_name'], + 'options' => [ + 'onUpdate' => $tableForeignKey['on_update'], + 'onDelete' => $tableForeignKey['on_delete'], + ], + ]; + } else { + $foreignKeys[$tableForeignKey['index_name']]['local_columns'][] = $tableForeignKey['local_column']; + $foreignKeys[$tableForeignKey['index_name']]['foreign_columns'][] = $tableForeignKey['foreign_column']; + } + } + + return parent::_getPortableTableForeignKeysList($foreignKeys); + } + + /** + * @param string $def + * + * @return string|null + */ + protected function _getPortableForeignKeyRuleDef($def) + { + if ($def === 'C') { + return 'CASCADE'; + } + + if ($def === 'N') { + return 'SET NULL'; + } + + return null; + } + + /** + * {@inheritdoc} + */ + protected function _getPortableViewDefinition($view) + { + $view = array_change_key_case($view, CASE_LOWER); + + $sql = ''; + $pos = strpos($view['text'], ' AS '); + + if ($pos !== false) { + $sql = substr($view['text'], $pos + 4); + } + + return new View($view['name'], $sql); + } + + protected function normalizeName(string $name): string + { + $identifier = new Identifier($name); + + return $identifier->isQuoted() ? $identifier->getName() : strtoupper($name); + } + + protected function selectTableNames(string $databaseName): Result + { + $sql = <<<'SQL' +SELECT NAME +FROM SYSIBM.SYSTABLES +WHERE TYPE = 'T' + AND CREATOR = ? +SQL; + + return $this->_conn->executeQuery($sql, [$databaseName]); + } + + protected function selectTableColumns(string $databaseName, ?string $tableName = null): Result + { + $sql = 'SELECT'; + + if ($tableName === null) { + $sql .= ' C.TABNAME AS NAME,'; + } + + $sql .= <<<'SQL' + C.COLNAME, + C.TYPENAME, + C.CODEPAGE, + C.NULLS, + C.LENGTH, + C.SCALE, + C.REMARKS AS COMMENT, + CASE + WHEN C.GENERATED = 'D' THEN 1 + ELSE 0 + END AS AUTOINCREMENT, + C.DEFAULT +FROM SYSCAT.COLUMNS C + JOIN SYSCAT.TABLES AS T + ON T.TABSCHEMA = C.TABSCHEMA + AND T.TABNAME = C.TABNAME +SQL; + + $conditions = ['C.TABSCHEMA = ?', "T.TYPE = 'T'"]; + $params = [$databaseName]; + + if ($tableName !== null) { + $conditions[] = 'C.TABNAME = ?'; + $params[] = $tableName; + } + + $sql .= ' WHERE ' . implode(' AND ', $conditions) . ' ORDER BY C.TABNAME, C.COLNO'; + + return $this->_conn->executeQuery($sql, $params); + } + + protected function selectIndexColumns(string $databaseName, ?string $tableName = null): Result + { + $sql = 'SELECT'; + + if ($tableName === null) { + $sql .= ' IDX.TABNAME AS NAME,'; + } + + $sql .= <<<'SQL' + IDX.INDNAME AS KEY_NAME, + IDXCOL.COLNAME AS COLUMN_NAME, + CASE + WHEN IDX.UNIQUERULE = 'P' THEN 1 + ELSE 0 + END AS PRIMARY, + CASE + WHEN IDX.UNIQUERULE = 'D' THEN 1 + ELSE 0 + END AS NON_UNIQUE + FROM SYSCAT.INDEXES AS IDX + JOIN SYSCAT.TABLES AS T + ON IDX.TABSCHEMA = T.TABSCHEMA AND IDX.TABNAME = T.TABNAME + JOIN SYSCAT.INDEXCOLUSE AS IDXCOL + ON IDX.INDSCHEMA = IDXCOL.INDSCHEMA AND IDX.INDNAME = IDXCOL.INDNAME +SQL; + + $conditions = ['IDX.TABSCHEMA = ?', "T.TYPE = 'T'"]; + $params = [$databaseName]; + + if ($tableName !== null) { + $conditions[] = 'IDX.TABNAME = ?'; + $params[] = $tableName; + } + + $sql .= ' WHERE ' . implode(' AND ', $conditions) . ' ORDER BY IDX.INDNAME, IDXCOL.COLSEQ'; + + return $this->_conn->executeQuery($sql, $params); + } + + protected function selectForeignKeyColumns(string $databaseName, ?string $tableName = null): Result + { + $sql = 'SELECT'; + + if ($tableName === null) { + $sql .= ' R.TABNAME AS NAME,'; + } + + $sql .= <<<'SQL' + FKCOL.COLNAME AS LOCAL_COLUMN, + R.REFTABNAME AS FOREIGN_TABLE, + PKCOL.COLNAME AS FOREIGN_COLUMN, + R.CONSTNAME AS INDEX_NAME, + CASE + WHEN R.UPDATERULE = 'R' THEN 'RESTRICT' + END AS ON_UPDATE, + CASE + WHEN R.DELETERULE = 'C' THEN 'CASCADE' + WHEN R.DELETERULE = 'N' THEN 'SET NULL' + WHEN R.DELETERULE = 'R' THEN 'RESTRICT' + END AS ON_DELETE + FROM SYSCAT.REFERENCES AS R + JOIN SYSCAT.TABLES AS T + ON T.TABSCHEMA = R.TABSCHEMA + AND T.TABNAME = R.TABNAME + JOIN SYSCAT.KEYCOLUSE AS FKCOL + ON FKCOL.CONSTNAME = R.CONSTNAME + AND FKCOL.TABSCHEMA = R.TABSCHEMA + AND FKCOL.TABNAME = R.TABNAME + JOIN SYSCAT.KEYCOLUSE AS PKCOL + ON PKCOL.CONSTNAME = R.REFKEYNAME + AND PKCOL.TABSCHEMA = R.REFTABSCHEMA + AND PKCOL.TABNAME = R.REFTABNAME + AND PKCOL.COLSEQ = FKCOL.COLSEQ +SQL; + + $conditions = ['R.TABSCHEMA = ?', "T.TYPE = 'T'"]; + $params = [$databaseName]; + + if ($tableName !== null) { + $conditions[] = 'R.TABNAME = ?'; + $params[] = $tableName; + } + + $sql .= ' WHERE ' . implode(' AND ', $conditions) . ' ORDER BY R.CONSTNAME, FKCOL.COLSEQ'; + + return $this->_conn->executeQuery($sql, $params); + } + + /** + * {@inheritDoc} + */ + protected function fetchTableOptionsByTable(string $databaseName, ?string $tableName = null): array + { + $sql = 'SELECT NAME, REMARKS'; + + $conditions = []; + $params = []; + + if ($tableName !== null) { + $conditions[] = 'NAME = ?'; + $params[] = $tableName; + } + + $sql .= ' FROM SYSIBM.SYSTABLES'; + + if ($conditions !== []) { + $sql .= ' WHERE ' . implode(' AND ', $conditions); + } + + /** @var array> $metadata */ + $metadata = $this->_conn->executeQuery($sql, $params) + ->fetchAllAssociativeIndexed(); + + $tableOptions = []; + foreach ($metadata as $table => $data) { + $data = array_change_key_case($data, CASE_LOWER); + + $tableOptions[$table] = ['comment' => $data['remarks']]; + } + + return $tableOptions; + } +} diff --git a/vendor/doctrine/dbal/src/Schema/Exception/ColumnAlreadyExists.php b/vendor/doctrine/dbal/src/Schema/Exception/ColumnAlreadyExists.php new file mode 100644 index 00000000..cc7acea0 --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/Exception/ColumnAlreadyExists.php @@ -0,0 +1,21 @@ +getName(), + implode(', ', $foreignKey->getColumns()), + $foreignKey->getForeignTableName(), + implode(', ', $foreignKey->getForeignColumns()), + ), + ); + } +} diff --git a/vendor/doctrine/dbal/src/Schema/Exception/NamespaceAlreadyExists.php b/vendor/doctrine/dbal/src/Schema/Exception/NamespaceAlreadyExists.php new file mode 100644 index 00000000..008bd5f0 --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/Exception/NamespaceAlreadyExists.php @@ -0,0 +1,21 @@ + Identifier) + * + * @var Identifier[] + */ + protected $_localColumnNames; + + /** + * Table or asset identifier instance of the referenced table name the foreign key constraint is associated with. + * + * @var Table|Identifier + */ + protected $_foreignTableName; + + /** + * Asset identifier instances of the referenced table column names the foreign key constraint is associated with. + * array($columnName => Identifier) + * + * @var Identifier[] + */ + protected $_foreignColumnNames; + + /** + * Options associated with the foreign key constraint. + * + * @var mixed[] + */ + protected $_options; + + /** + * Initializes the foreign key constraint. + * + * @param string[] $localColumnNames Names of the referencing table columns. + * @param Table|string $foreignTableName Referenced table. + * @param string[] $foreignColumnNames Names of the referenced table columns. + * @param string|null $name Name of the foreign key constraint. + * @param mixed[] $options Options associated with the foreign key constraint. + */ + public function __construct( + array $localColumnNames, + $foreignTableName, + array $foreignColumnNames, + $name = null, + array $options = [] + ) { + if ($name !== null) { + $this->_setName($name); + } + + $this->_localColumnNames = $this->createIdentifierMap($localColumnNames); + + if ($foreignTableName instanceof Table) { + $this->_foreignTableName = $foreignTableName; + } else { + $this->_foreignTableName = new Identifier($foreignTableName); + } + + $this->_foreignColumnNames = $this->createIdentifierMap($foreignColumnNames); + $this->_options = $options; + } + + /** + * @param string[] $names + * + * @return Identifier[] + */ + private function createIdentifierMap(array $names): array + { + $identifiers = []; + + foreach ($names as $name) { + $identifiers[$name] = new Identifier($name); + } + + return $identifiers; + } + + /** + * Returns the name of the referencing table + * the foreign key constraint is associated with. + * + * @deprecated Use the table that contains the foreign key as part of its {@see Table::$_fkConstraints} instead. + * + * @return string + */ + public function getLocalTableName() + { + return $this->_localTable->getName(); + } + + /** + * Sets the Table instance of the referencing table + * the foreign key constraint is associated with. + * + * @deprecated Use the table that contains the foreign key as part of its {@see Table::$_fkConstraints} instead. + * + * @param Table $table Instance of the referencing table. + * + * @return void + */ + public function setLocalTable(Table $table) + { + $this->_localTable = $table; + } + + /** + * @deprecated Use the table that contains the foreign key as part of its {@see Table::$_fkConstraints} instead. + * + * @return Table + */ + public function getLocalTable() + { + return $this->_localTable; + } + + /** + * Returns the names of the referencing table columns + * the foreign key constraint is associated with. + * + * @return string[] + */ + public function getLocalColumns() + { + return array_keys($this->_localColumnNames); + } + + /** + * Returns the quoted representation of the referencing table column names + * the foreign key constraint is associated with. + * + * But only if they were defined with one or the referencing table column name + * is a keyword reserved by the platform. + * Otherwise the plain unquoted value as inserted is returned. + * + * @param AbstractPlatform $platform The platform to use for quotation. + * + * @return string[] + */ + public function getQuotedLocalColumns(AbstractPlatform $platform) + { + $columns = []; + + foreach ($this->_localColumnNames as $column) { + $columns[] = $column->getQuotedName($platform); + } + + return $columns; + } + + /** + * Returns unquoted representation of local table column names for comparison with other FK + * + * @return string[] + */ + public function getUnquotedLocalColumns() + { + return array_map([$this, 'trimQuotes'], $this->getLocalColumns()); + } + + /** + * Returns unquoted representation of foreign table column names for comparison with other FK + * + * @return string[] + */ + public function getUnquotedForeignColumns() + { + return array_map([$this, 'trimQuotes'], $this->getForeignColumns()); + } + + /** + * {@inheritdoc} + * + * @deprecated Use {@see getLocalColumns()} instead. + * + * @see getLocalColumns + */ + public function getColumns() + { + return $this->getLocalColumns(); + } + + /** + * Returns the quoted representation of the referencing table column names + * the foreign key constraint is associated with. + * + * But only if they were defined with one or the referencing table column name + * is a keyword reserved by the platform. + * Otherwise the plain unquoted value as inserted is returned. + * + * @deprecated Use {@see getQuotedLocalColumns()} instead. + * + * @see getQuotedLocalColumns + * + * @param AbstractPlatform $platform The platform to use for quotation. + * + * @return string[] + */ + public function getQuotedColumns(AbstractPlatform $platform) + { + return $this->getQuotedLocalColumns($platform); + } + + /** + * Returns the name of the referenced table + * the foreign key constraint is associated with. + * + * @return string + */ + public function getForeignTableName() + { + return $this->_foreignTableName->getName(); + } + + /** + * Returns the non-schema qualified foreign table name. + * + * @return string + */ + public function getUnqualifiedForeignTableName() + { + $name = $this->_foreignTableName->getName(); + $position = strrpos($name, '.'); + + if ($position !== false) { + $name = substr($name, $position + 1); + } + + return strtolower($name); + } + + /** + * Returns the quoted representation of the referenced table name + * the foreign key constraint is associated with. + * + * But only if it was defined with one or the referenced table name + * is a keyword reserved by the platform. + * Otherwise the plain unquoted value as inserted is returned. + * + * @param AbstractPlatform $platform The platform to use for quotation. + * + * @return string + */ + public function getQuotedForeignTableName(AbstractPlatform $platform) + { + return $this->_foreignTableName->getQuotedName($platform); + } + + /** + * Returns the names of the referenced table columns + * the foreign key constraint is associated with. + * + * @return string[] + */ + public function getForeignColumns() + { + return array_keys($this->_foreignColumnNames); + } + + /** + * Returns the quoted representation of the referenced table column names + * the foreign key constraint is associated with. + * + * But only if they were defined with one or the referenced table column name + * is a keyword reserved by the platform. + * Otherwise the plain unquoted value as inserted is returned. + * + * @param AbstractPlatform $platform The platform to use for quotation. + * + * @return string[] + */ + public function getQuotedForeignColumns(AbstractPlatform $platform) + { + $columns = []; + + foreach ($this->_foreignColumnNames as $column) { + $columns[] = $column->getQuotedName($platform); + } + + return $columns; + } + + /** + * Returns whether or not a given option + * is associated with the foreign key constraint. + * + * @param string $name Name of the option to check. + * + * @return bool + */ + public function hasOption($name) + { + return isset($this->_options[$name]); + } + + /** + * Returns an option associated with the foreign key constraint. + * + * @param string $name Name of the option the foreign key constraint is associated with. + * + * @return mixed + */ + public function getOption($name) + { + return $this->_options[$name]; + } + + /** + * Returns the options associated with the foreign key constraint. + * + * @return mixed[] + */ + public function getOptions() + { + return $this->_options; + } + + /** + * Returns the referential action for UPDATE operations + * on the referenced table the foreign key constraint is associated with. + * + * @return string|null + */ + public function onUpdate() + { + return $this->onEvent('onUpdate'); + } + + /** + * Returns the referential action for DELETE operations + * on the referenced table the foreign key constraint is associated with. + * + * @return string|null + */ + public function onDelete() + { + return $this->onEvent('onDelete'); + } + + /** + * Returns the referential action for a given database operation + * on the referenced table the foreign key constraint is associated with. + * + * @param string $event Name of the database operation/event to return the referential action for. + */ + private function onEvent($event): ?string + { + if (isset($this->_options[$event])) { + $onEvent = strtoupper($this->_options[$event]); + + if ($onEvent !== 'NO ACTION' && $onEvent !== 'RESTRICT') { + return $onEvent; + } + } + + return null; + } + + /** + * Checks whether this foreign key constraint intersects the given index columns. + * + * Returns `true` if at least one of this foreign key's local columns + * matches one of the given index's columns, `false` otherwise. + * + * @param Index $index The index to be checked against. + * + * @return bool + */ + public function intersectsIndexColumns(Index $index) + { + foreach ($index->getColumns() as $indexColumn) { + foreach ($this->_localColumnNames as $localColumn) { + if (strtolower($indexColumn) === strtolower($localColumn->getName())) { + return true; + } + } + } + + return false; + } +} diff --git a/vendor/doctrine/dbal/src/Schema/Identifier.php b/vendor/doctrine/dbal/src/Schema/Identifier.php new file mode 100644 index 00000000..f34465e9 --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/Identifier.php @@ -0,0 +1,27 @@ +_setName($identifier); + + if (! $quote || $this->_quoted) { + return; + } + + $this->_setName('"' . $this->getName() . '"'); + } +} diff --git a/vendor/doctrine/dbal/src/Schema/Index.php b/vendor/doctrine/dbal/src/Schema/Index.php new file mode 100644 index 00000000..6c2d7cd5 --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/Index.php @@ -0,0 +1,365 @@ + Identifier) + * + * @var Identifier[] + */ + protected $_columns = []; + + /** @var bool */ + protected $_isUnique = false; + + /** @var bool */ + protected $_isPrimary = false; + + /** + * Platform specific flags for indexes. + * array($flagName => true) + * + * @var true[] + */ + protected $_flags = []; + + /** + * Platform specific options + * + * @todo $_flags should eventually be refactored into options + * @var mixed[] + */ + private array $options; + + /** + * @param string $name + * @param string[] $columns + * @param bool $isUnique + * @param bool $isPrimary + * @param string[] $flags + * @param mixed[] $options + */ + public function __construct( + $name, + array $columns, + $isUnique = false, + $isPrimary = false, + array $flags = [], + array $options = [] + ) { + $isUnique = $isUnique || $isPrimary; + + $this->_setName($name); + $this->_isUnique = $isUnique; + $this->_isPrimary = $isPrimary; + $this->options = $options; + + foreach ($columns as $column) { + $this->_addColumn($column); + } + + foreach ($flags as $flag) { + $this->addFlag($flag); + } + } + + /** @throws InvalidArgumentException */ + protected function _addColumn(string $column): void + { + $this->_columns[$column] = new Identifier($column); + } + + /** + * {@inheritdoc} + */ + public function getColumns() + { + return array_keys($this->_columns); + } + + /** + * {@inheritdoc} + */ + public function getQuotedColumns(AbstractPlatform $platform) + { + $subParts = $platform->supportsColumnLengthIndexes() && $this->hasOption('lengths') + ? $this->getOption('lengths') : []; + + $columns = []; + + foreach ($this->_columns as $column) { + $length = array_shift($subParts); + + $quotedColumn = $column->getQuotedName($platform); + + if ($length !== null) { + $quotedColumn .= '(' . $length . ')'; + } + + $columns[] = $quotedColumn; + } + + return $columns; + } + + /** @return string[] */ + public function getUnquotedColumns() + { + return array_map([$this, 'trimQuotes'], $this->getColumns()); + } + + /** + * Is the index neither unique nor primary key? + * + * @return bool + */ + public function isSimpleIndex() + { + return ! $this->_isPrimary && ! $this->_isUnique; + } + + /** @return bool */ + public function isUnique() + { + return $this->_isUnique; + } + + /** @return bool */ + public function isPrimary() + { + return $this->_isPrimary; + } + + /** + * @param string $name + * @param int $pos + * + * @return bool + */ + public function hasColumnAtPosition($name, $pos = 0) + { + $name = $this->trimQuotes(strtolower($name)); + $indexColumns = array_map('strtolower', $this->getUnquotedColumns()); + + return array_search($name, $indexColumns, true) === $pos; + } + + /** + * Checks if this index exactly spans the given column names in the correct order. + * + * @param string[] $columnNames + * + * @return bool + */ + public function spansColumns(array $columnNames) + { + $columns = $this->getColumns(); + $numberOfColumns = count($columns); + $sameColumns = true; + + for ($i = 0; $i < $numberOfColumns; $i++) { + if ( + isset($columnNames[$i]) + && $this->trimQuotes(strtolower($columns[$i])) === $this->trimQuotes(strtolower($columnNames[$i])) + ) { + continue; + } + + $sameColumns = false; + } + + return $sameColumns; + } + + /** + * Keeping misspelled function name for backwards compatibility + * + * @deprecated Use {@see isFulfilledBy()} instead. + * + * @return bool + */ + public function isFullfilledBy(Index $other) + { + return $this->isFulfilledBy($other); + } + + /** + * Checks if the other index already fulfills all the indexing and constraint needs of the current one. + */ + public function isFulfilledBy(Index $other): bool + { + // allow the other index to be equally large only. It being larger is an option + // but it creates a problem with scenarios of the kind PRIMARY KEY(foo,bar) UNIQUE(foo) + if (count($other->getColumns()) !== count($this->getColumns())) { + return false; + } + + // Check if columns are the same, and even in the same order + $sameColumns = $this->spansColumns($other->getColumns()); + + if ($sameColumns) { + if (! $this->samePartialIndex($other)) { + return false; + } + + if (! $this->hasSameColumnLengths($other)) { + return false; + } + + if (! $this->isUnique() && ! $this->isPrimary()) { + // this is a special case: If the current key is neither primary or unique, any unique or + // primary key will always have the same effect for the index and there cannot be any constraint + // overlaps. This means a primary or unique index can always fulfill the requirements of just an + // index that has no constraints. + return true; + } + + if ($other->isPrimary() !== $this->isPrimary()) { + return false; + } + + return $other->isUnique() === $this->isUnique(); + } + + return false; + } + + /** + * Detects if the other index is a non-unique, non primary index that can be overwritten by this one. + * + * @return bool + */ + public function overrules(Index $other) + { + if ($other->isPrimary()) { + return false; + } + + if ($this->isSimpleIndex() && $other->isUnique()) { + return false; + } + + return $this->spansColumns($other->getColumns()) + && ($this->isPrimary() || $this->isUnique()) + && $this->samePartialIndex($other); + } + + /** + * Returns platform specific flags for indexes. + * + * @return string[] + */ + public function getFlags() + { + return array_keys($this->_flags); + } + + /** + * Adds Flag for an index that translates to platform specific handling. + * + * @param string $flag + * + * @return Index + * + * @example $index->addFlag('CLUSTERED') + */ + public function addFlag($flag) + { + $this->_flags[strtolower($flag)] = true; + + return $this; + } + + /** + * Does this index have a specific flag? + * + * @param string $flag + * + * @return bool + */ + public function hasFlag($flag) + { + return isset($this->_flags[strtolower($flag)]); + } + + /** + * Removes a flag. + * + * @param string $flag + * + * @return void + */ + public function removeFlag($flag) + { + unset($this->_flags[strtolower($flag)]); + } + + /** + * @param string $name + * + * @return bool + */ + public function hasOption($name) + { + return isset($this->options[strtolower($name)]); + } + + /** + * @param string $name + * + * @return mixed + */ + public function getOption($name) + { + return $this->options[strtolower($name)]; + } + + /** @return mixed[] */ + public function getOptions() + { + return $this->options; + } + + /** + * Return whether the two indexes have the same partial index + */ + private function samePartialIndex(Index $other): bool + { + if ( + $this->hasOption('where') + && $other->hasOption('where') + && $this->getOption('where') === $other->getOption('where') + ) { + return true; + } + + return ! $this->hasOption('where') && ! $other->hasOption('where'); + } + + /** + * Returns whether the index has the same column lengths as the other + */ + private function hasSameColumnLengths(self $other): bool + { + $filter = static function (?int $length): bool { + return $length !== null; + }; + + return array_filter($this->options['lengths'] ?? [], $filter) + === array_filter($other->options['lengths'] ?? [], $filter); + } +} diff --git a/vendor/doctrine/dbal/src/Schema/MySQLSchemaManager.php b/vendor/doctrine/dbal/src/Schema/MySQLSchemaManager.php new file mode 100644 index 00000000..f2305098 --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/MySQLSchemaManager.php @@ -0,0 +1,587 @@ + + */ +class MySQLSchemaManager extends AbstractSchemaManager +{ + /** @see https://mariadb.com/kb/en/library/string-literals/#escape-sequences */ + private const MARIADB_ESCAPE_SEQUENCES = [ + '\\0' => "\0", + "\\'" => "'", + '\\"' => '"', + '\\b' => "\b", + '\\n' => "\n", + '\\r' => "\r", + '\\t' => "\t", + '\\Z' => "\x1a", + '\\\\' => '\\', + '\\%' => '%', + '\\_' => '_', + + // Internally, MariaDB escapes single quotes using the standard syntax + "''" => "'", + ]; + + /** + * {@inheritDoc} + */ + public function listTableNames() + { + return $this->doListTableNames(); + } + + /** + * {@inheritDoc} + */ + public function listTables() + { + return $this->doListTables(); + } + + /** + * {@inheritDoc} + * + * @deprecated Use {@see introspectTable()} instead. + */ + public function listTableDetails($name) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5595', + '%s is deprecated. Use introspectTable() instead.', + __METHOD__, + ); + + return $this->doListTableDetails($name); + } + + /** + * {@inheritDoc} + */ + public function listTableColumns($table, $database = null) + { + return $this->doListTableColumns($table, $database); + } + + /** + * {@inheritDoc} + */ + public function listTableIndexes($table) + { + return $this->doListTableIndexes($table); + } + + /** + * {@inheritDoc} + */ + public function listTableForeignKeys($table, $database = null) + { + return $this->doListTableForeignKeys($table, $database); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableViewDefinition($view) + { + return new View($view['TABLE_NAME'], $view['VIEW_DEFINITION']); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableDefinition($table) + { + return array_shift($table); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableIndexesList($tableIndexes, $tableName = null) + { + foreach ($tableIndexes as $k => $v) { + $v = array_change_key_case($v, CASE_LOWER); + if ($v['key_name'] === 'PRIMARY') { + $v['primary'] = true; + } else { + $v['primary'] = false; + } + + if (strpos($v['index_type'], 'FULLTEXT') !== false) { + $v['flags'] = ['FULLTEXT']; + } elseif (strpos($v['index_type'], 'SPATIAL') !== false) { + $v['flags'] = ['SPATIAL']; + } + + // Ignore prohibited prefix `length` for spatial index + if (strpos($v['index_type'], 'SPATIAL') === false) { + $v['length'] = isset($v['sub_part']) ? (int) $v['sub_part'] : null; + } + + $tableIndexes[$k] = $v; + } + + return parent::_getPortableTableIndexesList($tableIndexes, $tableName); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableDatabaseDefinition($database) + { + return $database['Database']; + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableColumnDefinition($tableColumn) + { + $tableColumn = array_change_key_case($tableColumn, CASE_LOWER); + + $dbType = strtolower($tableColumn['type']); + $dbType = strtok($dbType, '(), '); + assert(is_string($dbType)); + + $length = $tableColumn['length'] ?? strtok('(), '); + + $fixed = null; + + if (! isset($tableColumn['name'])) { + $tableColumn['name'] = ''; + } + + $scale = null; + $precision = null; + + $type = $this->_platform->getDoctrineTypeMapping($dbType); + + // In cases where not connected to a database DESCRIBE $table does not return 'Comment' + if (isset($tableColumn['comment'])) { + $type = $this->extractDoctrineTypeFromComment($tableColumn['comment'], $type); + $tableColumn['comment'] = $this->removeDoctrineTypeFromComment($tableColumn['comment'], $type); + } + + switch ($dbType) { + case 'char': + case 'binary': + $fixed = true; + break; + + case 'float': + case 'double': + case 'real': + case 'numeric': + case 'decimal': + if ( + preg_match( + '([A-Za-z]+\(([0-9]+),([0-9]+)\))', + $tableColumn['type'], + $match, + ) === 1 + ) { + $precision = $match[1]; + $scale = $match[2]; + $length = null; + } + + break; + + case 'tinytext': + $length = AbstractMySQLPlatform::LENGTH_LIMIT_TINYTEXT; + break; + + case 'text': + $length = AbstractMySQLPlatform::LENGTH_LIMIT_TEXT; + break; + + case 'mediumtext': + $length = AbstractMySQLPlatform::LENGTH_LIMIT_MEDIUMTEXT; + break; + + case 'tinyblob': + $length = AbstractMySQLPlatform::LENGTH_LIMIT_TINYBLOB; + break; + + case 'blob': + $length = AbstractMySQLPlatform::LENGTH_LIMIT_BLOB; + break; + + case 'mediumblob': + $length = AbstractMySQLPlatform::LENGTH_LIMIT_MEDIUMBLOB; + break; + + case 'tinyint': + case 'smallint': + case 'mediumint': + case 'int': + case 'integer': + case 'bigint': + case 'year': + $length = null; + break; + } + + if ($this->_platform instanceof MariaDb1027Platform) { + $columnDefault = $this->getMariaDb1027ColumnDefault($this->_platform, $tableColumn['default']); + } else { + $columnDefault = $tableColumn['default']; + } + + $options = [ + 'length' => $length !== null ? (int) $length : null, + 'unsigned' => strpos($tableColumn['type'], 'unsigned') !== false, + 'fixed' => (bool) $fixed, + 'default' => $columnDefault, + 'notnull' => $tableColumn['null'] !== 'YES', + 'scale' => null, + 'precision' => null, + 'autoincrement' => strpos($tableColumn['extra'], 'auto_increment') !== false, + 'comment' => isset($tableColumn['comment']) && $tableColumn['comment'] !== '' + ? $tableColumn['comment'] + : null, + ]; + + if ($scale !== null && $precision !== null) { + $options['scale'] = (int) $scale; + $options['precision'] = (int) $precision; + } + + $column = new Column($tableColumn['field'], Type::getType($type), $options); + + if (isset($tableColumn['characterset'])) { + $column->setPlatformOption('charset', $tableColumn['characterset']); + } + + if (isset($tableColumn['collation'])) { + $column->setPlatformOption('collation', $tableColumn['collation']); + } + + return $column; + } + + /** + * Return Doctrine/Mysql-compatible column default values for MariaDB 10.2.7+ servers. + * + * - Since MariaDb 10.2.7 column defaults stored in information_schema are now quoted + * to distinguish them from expressions (see MDEV-10134). + * - CURRENT_TIMESTAMP, CURRENT_TIME, CURRENT_DATE are stored in information_schema + * as current_timestamp(), currdate(), currtime() + * - Quoted 'NULL' is not enforced by Maria, it is technically possible to have + * null in some circumstances (see https://jira.mariadb.org/browse/MDEV-14053) + * - \' is always stored as '' in information_schema (normalized) + * + * @link https://mariadb.com/kb/en/library/information-schema-columns-table/ + * @link https://jira.mariadb.org/browse/MDEV-13132 + * + * @param string|null $columnDefault default value as stored in information_schema for MariaDB >= 10.2.7 + */ + private function getMariaDb1027ColumnDefault(MariaDb1027Platform $platform, ?string $columnDefault): ?string + { + if ($columnDefault === 'NULL' || $columnDefault === null) { + return null; + } + + if (preg_match('/^\'(.*)\'$/', $columnDefault, $matches) === 1) { + return strtr($matches[1], self::MARIADB_ESCAPE_SEQUENCES); + } + + switch ($columnDefault) { + case 'current_timestamp()': + return $platform->getCurrentTimestampSQL(); + + case 'curdate()': + return $platform->getCurrentDateSQL(); + + case 'curtime()': + return $platform->getCurrentTimeSQL(); + } + + return $columnDefault; + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableForeignKeysList($tableForeignKeys) + { + $list = []; + foreach ($tableForeignKeys as $value) { + $value = array_change_key_case($value, CASE_LOWER); + if (! isset($list[$value['constraint_name']])) { + if (! isset($value['delete_rule']) || $value['delete_rule'] === 'RESTRICT') { + $value['delete_rule'] = null; + } + + if (! isset($value['update_rule']) || $value['update_rule'] === 'RESTRICT') { + $value['update_rule'] = null; + } + + $list[$value['constraint_name']] = [ + 'name' => $value['constraint_name'], + 'local' => [], + 'foreign' => [], + 'foreignTable' => $value['referenced_table_name'], + 'onDelete' => $value['delete_rule'], + 'onUpdate' => $value['update_rule'], + ]; + } + + $list[$value['constraint_name']]['local'][] = $value['column_name']; + $list[$value['constraint_name']]['foreign'][] = $value['referenced_column_name']; + } + + return parent::_getPortableTableForeignKeysList($list); + } + + /** + * {@inheritDoc} + */ + protected function _getPortableTableForeignKeyDefinition($tableForeignKey): ForeignKeyConstraint + { + return new ForeignKeyConstraint( + $tableForeignKey['local'], + $tableForeignKey['foreignTable'], + $tableForeignKey['foreign'], + $tableForeignKey['name'], + [ + 'onDelete' => $tableForeignKey['onDelete'], + 'onUpdate' => $tableForeignKey['onUpdate'], + ], + ); + } + + public function createComparator(): Comparator + { + return new MySQL\Comparator( + $this->_platform, + new CachingCollationMetadataProvider( + new ConnectionCollationMetadataProvider($this->_conn), + ), + ); + } + + protected function selectTableNames(string $databaseName): Result + { + $sql = <<<'SQL' +SELECT TABLE_NAME +FROM information_schema.TABLES +WHERE TABLE_SCHEMA = ? + AND TABLE_TYPE = 'BASE TABLE' +ORDER BY TABLE_NAME +SQL; + + return $this->_conn->executeQuery($sql, [$databaseName]); + } + + protected function selectTableColumns(string $databaseName, ?string $tableName = null): Result + { + $sql = 'SELECT'; + + if ($tableName === null) { + $sql .= ' c.TABLE_NAME,'; + } + + $sql .= <<<'SQL' + c.COLUMN_NAME AS field, + c.COLUMN_TYPE AS type, + c.IS_NULLABLE AS `null`, + c.COLUMN_KEY AS `key`, + c.COLUMN_DEFAULT AS `default`, + c.EXTRA, + c.COLUMN_COMMENT AS comment, + c.CHARACTER_SET_NAME AS characterset, + c.COLLATION_NAME AS collation +FROM information_schema.COLUMNS c + INNER JOIN information_schema.TABLES t + ON t.TABLE_NAME = c.TABLE_NAME +SQL; + + // The schema name is passed multiple times as a literal in the WHERE clause instead of using a JOIN condition + // in order to avoid performance issues on MySQL older than 8.0 and the corresponding MariaDB versions + // caused by https://bugs.mysql.com/bug.php?id=81347 + $conditions = ['c.TABLE_SCHEMA = ?', 't.TABLE_SCHEMA = ?', "t.TABLE_TYPE = 'BASE TABLE'"]; + $params = [$databaseName, $databaseName]; + + if ($tableName !== null) { + $conditions[] = 't.TABLE_NAME = ?'; + $params[] = $tableName; + } + + $sql .= ' WHERE ' . implode(' AND ', $conditions) . ' ORDER BY ORDINAL_POSITION'; + + return $this->_conn->executeQuery($sql, $params); + } + + protected function selectIndexColumns(string $databaseName, ?string $tableName = null): Result + { + $sql = 'SELECT'; + + if ($tableName === null) { + $sql .= ' TABLE_NAME,'; + } + + $sql .= <<<'SQL' + NON_UNIQUE AS Non_Unique, + INDEX_NAME AS Key_name, + COLUMN_NAME AS Column_Name, + SUB_PART AS Sub_Part, + INDEX_TYPE AS Index_Type +FROM information_schema.STATISTICS +SQL; + + $conditions = ['TABLE_SCHEMA = ?']; + $params = [$databaseName]; + + if ($tableName !== null) { + $conditions[] = 'TABLE_NAME = ?'; + $params[] = $tableName; + } + + $sql .= ' WHERE ' . implode(' AND ', $conditions) . ' ORDER BY SEQ_IN_INDEX'; + + return $this->_conn->executeQuery($sql, $params); + } + + protected function selectForeignKeyColumns(string $databaseName, ?string $tableName = null): Result + { + $sql = 'SELECT DISTINCT'; + + if ($tableName === null) { + $sql .= ' k.TABLE_NAME,'; + } + + $sql .= <<<'SQL' + k.CONSTRAINT_NAME, + k.COLUMN_NAME, + k.REFERENCED_TABLE_NAME, + k.REFERENCED_COLUMN_NAME, + k.ORDINAL_POSITION /*!50116, + c.UPDATE_RULE, + c.DELETE_RULE */ +FROM information_schema.key_column_usage k /*!50116 +INNER JOIN information_schema.referential_constraints c +ON c.CONSTRAINT_NAME = k.CONSTRAINT_NAME +AND c.TABLE_NAME = k.TABLE_NAME */ +SQL; + + $conditions = ['k.TABLE_SCHEMA = ?']; + $params = [$databaseName]; + + if ($tableName !== null) { + $conditions[] = 'k.TABLE_NAME = ?'; + $params[] = $tableName; + } + + $conditions[] = 'k.REFERENCED_COLUMN_NAME IS NOT NULL'; + + $sql .= ' WHERE ' . implode(' AND ', $conditions) + // The schema name is passed multiple times in the WHERE clause instead of using a JOIN condition + // in order to avoid performance issues on MySQL older than 8.0 and the corresponding MariaDB versions + // caused by https://bugs.mysql.com/bug.php?id=81347. + // Use a string literal for the database name since the internal PDO SQL parser + // cannot recognize parameter placeholders inside conditional comments + . ' /*!50116 AND c.CONSTRAINT_SCHEMA = ' . $this->_conn->quote($databaseName) . ' */' + . ' ORDER BY k.ORDINAL_POSITION'; + + return $this->_conn->executeQuery($sql, $params); + } + + /** + * {@inheritDoc} + */ + protected function fetchTableOptionsByTable(string $databaseName, ?string $tableName = null): array + { + $sql = <<<'SQL' + SELECT t.TABLE_NAME, + t.ENGINE, + t.AUTO_INCREMENT, + t.TABLE_COMMENT, + t.CREATE_OPTIONS, + t.TABLE_COLLATION, + ccsa.CHARACTER_SET_NAME + FROM information_schema.TABLES t + INNER JOIN information_schema.COLLATION_CHARACTER_SET_APPLICABILITY ccsa + ON ccsa.COLLATION_NAME = t.TABLE_COLLATION +SQL; + + $conditions = ['t.TABLE_SCHEMA = ?']; + $params = [$databaseName]; + + if ($tableName !== null) { + $conditions[] = 't.TABLE_NAME = ?'; + $params[] = $tableName; + } + + $conditions[] = "t.TABLE_TYPE = 'BASE TABLE'"; + + $sql .= ' WHERE ' . implode(' AND ', $conditions); + + /** @var array> $metadata */ + $metadata = $this->_conn->executeQuery($sql, $params) + ->fetchAllAssociativeIndexed(); + + $tableOptions = []; + foreach ($metadata as $table => $data) { + $data = array_change_key_case($data, CASE_LOWER); + + $tableOptions[$table] = [ + 'engine' => $data['engine'], + 'collation' => $data['table_collation'], + 'charset' => $data['character_set_name'], + 'autoincrement' => $data['auto_increment'], + 'comment' => $data['table_comment'], + 'create_options' => $this->parseCreateOptions($data['create_options']), + ]; + } + + return $tableOptions; + } + + /** @return string[]|true[] */ + private function parseCreateOptions(?string $string): array + { + $options = []; + + if ($string === null || $string === '') { + return $options; + } + + foreach (explode(' ', $string) as $pair) { + $parts = explode('=', $pair, 2); + + $options[$parts[0]] = $parts[1] ?? true; + } + + return $options; + } +} diff --git a/vendor/doctrine/dbal/src/Schema/OracleSchemaManager.php b/vendor/doctrine/dbal/src/Schema/OracleSchemaManager.php new file mode 100644 index 00000000..8b0d8e3c --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/OracleSchemaManager.php @@ -0,0 +1,539 @@ + + */ +class OracleSchemaManager extends AbstractSchemaManager +{ + /** + * {@inheritDoc} + */ + public function listTableNames() + { + return $this->doListTableNames(); + } + + /** + * {@inheritDoc} + */ + public function listTables() + { + return $this->doListTables(); + } + + /** + * {@inheritDoc} + * + * @deprecated Use {@see introspectTable()} instead. + */ + public function listTableDetails($name) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5595', + '%s is deprecated. Use introspectTable() instead.', + __METHOD__, + ); + + return $this->doListTableDetails($name); + } + + /** + * {@inheritDoc} + */ + public function listTableColumns($table, $database = null) + { + return $this->doListTableColumns($table, $database); + } + + /** + * {@inheritDoc} + */ + public function listTableIndexes($table) + { + return $this->doListTableIndexes($table); + } + + /** + * {@inheritDoc} + */ + public function listTableForeignKeys($table, $database = null) + { + return $this->doListTableForeignKeys($table, $database); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableViewDefinition($view) + { + $view = array_change_key_case($view, CASE_LOWER); + + return new View($this->getQuotedIdentifierName($view['view_name']), $view['text']); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableDefinition($table) + { + $table = array_change_key_case($table, CASE_LOWER); + + return $this->getQuotedIdentifierName($table['table_name']); + } + + /** + * {@inheritdoc} + * + * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaPgsqlReader.html + */ + protected function _getPortableTableIndexesList($tableIndexes, $tableName = null) + { + $indexBuffer = []; + foreach ($tableIndexes as $tableIndex) { + $tableIndex = array_change_key_case($tableIndex, CASE_LOWER); + + $keyName = strtolower($tableIndex['name']); + $buffer = []; + + if ($tableIndex['is_primary'] === 'P') { + $keyName = 'primary'; + $buffer['primary'] = true; + $buffer['non_unique'] = false; + } else { + $buffer['primary'] = false; + $buffer['non_unique'] = ! $tableIndex['is_unique']; + } + + $buffer['key_name'] = $keyName; + $buffer['column_name'] = $this->getQuotedIdentifierName($tableIndex['column_name']); + $indexBuffer[] = $buffer; + } + + return parent::_getPortableTableIndexesList($indexBuffer, $tableName); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableColumnDefinition($tableColumn) + { + $tableColumn = array_change_key_case($tableColumn, CASE_LOWER); + + $dbType = strtolower($tableColumn['data_type']); + if (strpos($dbType, 'timestamp(') === 0) { + if (strpos($dbType, 'with time zone') !== false) { + $dbType = 'timestamptz'; + } else { + $dbType = 'timestamp'; + } + } + + $unsigned = $fixed = $precision = $scale = $length = null; + + if (! isset($tableColumn['column_name'])) { + $tableColumn['column_name'] = ''; + } + + // Default values returned from database sometimes have trailing spaces. + if (is_string($tableColumn['data_default'])) { + $tableColumn['data_default'] = trim($tableColumn['data_default']); + } + + if ($tableColumn['data_default'] === '' || $tableColumn['data_default'] === 'NULL') { + $tableColumn['data_default'] = null; + } + + if ($tableColumn['data_default'] !== null) { + // Default values returned from database are represented as literal expressions + if (preg_match('/^\'(.*)\'$/s', $tableColumn['data_default'], $matches) === 1) { + $tableColumn['data_default'] = str_replace("''", "'", $matches[1]); + } + } + + if ($tableColumn['data_precision'] !== null) { + $precision = (int) $tableColumn['data_precision']; + } + + if ($tableColumn['data_scale'] !== null) { + $scale = (int) $tableColumn['data_scale']; + } + + $type = $this->_platform->getDoctrineTypeMapping($dbType); + $type = $this->extractDoctrineTypeFromComment($tableColumn['comments'], $type); + $tableColumn['comments'] = $this->removeDoctrineTypeFromComment($tableColumn['comments'], $type); + + switch ($dbType) { + case 'number': + if ($precision === 20 && $scale === 0) { + $type = 'bigint'; + } elseif ($precision === 5 && $scale === 0) { + $type = 'smallint'; + } elseif ($precision === 1 && $scale === 0) { + $type = 'boolean'; + } elseif ($scale > 0) { + $type = 'decimal'; + } + + break; + + case 'varchar': + case 'varchar2': + case 'nvarchar2': + $length = $tableColumn['char_length']; + $fixed = false; + break; + + case 'raw': + $length = $tableColumn['data_length']; + $fixed = true; + break; + + case 'char': + case 'nchar': + $length = $tableColumn['char_length']; + $fixed = true; + break; + } + + $options = [ + 'notnull' => $tableColumn['nullable'] === 'N', + 'fixed' => (bool) $fixed, + 'unsigned' => (bool) $unsigned, + 'default' => $tableColumn['data_default'], + 'length' => $length, + 'precision' => $precision, + 'scale' => $scale, + 'comment' => isset($tableColumn['comments']) && $tableColumn['comments'] !== '' + ? $tableColumn['comments'] + : null, + ]; + + return new Column($this->getQuotedIdentifierName($tableColumn['column_name']), Type::getType($type), $options); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableForeignKeysList($tableForeignKeys) + { + $list = []; + foreach ($tableForeignKeys as $value) { + $value = array_change_key_case($value, CASE_LOWER); + if (! isset($list[$value['constraint_name']])) { + if ($value['delete_rule'] === 'NO ACTION') { + $value['delete_rule'] = null; + } + + $list[$value['constraint_name']] = [ + 'name' => $this->getQuotedIdentifierName($value['constraint_name']), + 'local' => [], + 'foreign' => [], + 'foreignTable' => $value['references_table'], + 'onDelete' => $value['delete_rule'], + ]; + } + + $localColumn = $this->getQuotedIdentifierName($value['local_column']); + $foreignColumn = $this->getQuotedIdentifierName($value['foreign_column']); + + $list[$value['constraint_name']]['local'][$value['position']] = $localColumn; + $list[$value['constraint_name']]['foreign'][$value['position']] = $foreignColumn; + } + + return parent::_getPortableTableForeignKeysList($list); + } + + /** + * {@inheritDoc} + */ + protected function _getPortableTableForeignKeyDefinition($tableForeignKey): ForeignKeyConstraint + { + return new ForeignKeyConstraint( + array_values($tableForeignKey['local']), + $this->getQuotedIdentifierName($tableForeignKey['foreignTable']), + array_values($tableForeignKey['foreign']), + $this->getQuotedIdentifierName($tableForeignKey['name']), + ['onDelete' => $tableForeignKey['onDelete']], + ); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableSequenceDefinition($sequence) + { + $sequence = array_change_key_case($sequence, CASE_LOWER); + + return new Sequence( + $this->getQuotedIdentifierName($sequence['sequence_name']), + (int) $sequence['increment_by'], + (int) $sequence['min_value'], + ); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableDatabaseDefinition($database) + { + $database = array_change_key_case($database, CASE_LOWER); + + return $database['username']; + } + + /** + * {@inheritdoc} + */ + public function createDatabase($database) + { + $statement = $this->_platform->getCreateDatabaseSQL($database); + + $params = $this->_conn->getParams(); + + if (isset($params['password'])) { + $statement .= ' IDENTIFIED BY ' . $params['password']; + } + + $this->_conn->executeStatement($statement); + + $statement = 'GRANT DBA TO ' . $database; + $this->_conn->executeStatement($statement); + } + + /** + * @internal The method should be only used from within the OracleSchemaManager class hierarchy. + * + * @param string $table + * + * @return bool + * + * @throws Exception + */ + public function dropAutoincrement($table) + { + $sql = $this->_platform->getDropAutoincrementSql($table); + foreach ($sql as $query) { + $this->_conn->executeStatement($query); + } + + return true; + } + + /** + * {@inheritdoc} + */ + public function dropTable($name) + { + $this->tryMethod('dropAutoincrement', $name); + + parent::dropTable($name); + } + + /** + * Returns the quoted representation of the given identifier name. + * + * Quotes non-uppercase identifiers explicitly to preserve case + * and thus make references to the particular identifier work. + * + * @param string $identifier The identifier to quote. + */ + private function getQuotedIdentifierName($identifier): string + { + if (preg_match('/[a-z]/', $identifier) === 1) { + return $this->_platform->quoteIdentifier($identifier); + } + + return $identifier; + } + + protected function selectTableNames(string $databaseName): Result + { + $sql = <<<'SQL' +SELECT TABLE_NAME +FROM ALL_TABLES +WHERE OWNER = :OWNER +ORDER BY TABLE_NAME +SQL; + + return $this->_conn->executeQuery($sql, ['OWNER' => $databaseName]); + } + + protected function selectTableColumns(string $databaseName, ?string $tableName = null): Result + { + $sql = 'SELECT'; + + if ($tableName === null) { + $sql .= ' C.TABLE_NAME,'; + } + + $sql .= <<<'SQL' + C.COLUMN_NAME, + C.DATA_TYPE, + C.DATA_DEFAULT, + C.DATA_PRECISION, + C.DATA_SCALE, + C.CHAR_LENGTH, + C.DATA_LENGTH, + C.NULLABLE, + D.COMMENTS + FROM ALL_TAB_COLUMNS C + INNER JOIN ALL_TABLES T + ON T.OWNER = C.OWNER + AND T.TABLE_NAME = C.TABLE_NAME + LEFT JOIN ALL_COL_COMMENTS D + ON D.OWNER = C.OWNER + AND D.TABLE_NAME = C.TABLE_NAME + AND D.COLUMN_NAME = C.COLUMN_NAME +SQL; + + $conditions = ['C.OWNER = :OWNER']; + $params = ['OWNER' => $databaseName]; + + if ($tableName !== null) { + $conditions[] = 'C.TABLE_NAME = :TABLE_NAME'; + $params['TABLE_NAME'] = $tableName; + } + + $sql .= ' WHERE ' . implode(' AND ', $conditions) . ' ORDER BY C.COLUMN_ID'; + + return $this->_conn->executeQuery($sql, $params); + } + + protected function selectIndexColumns(string $databaseName, ?string $tableName = null): Result + { + $sql = 'SELECT'; + + if ($tableName === null) { + $sql .= ' IND_COL.TABLE_NAME,'; + } + + $sql .= <<<'SQL' + IND_COL.INDEX_NAME AS NAME, + IND.INDEX_TYPE AS TYPE, + DECODE(IND.UNIQUENESS, 'NONUNIQUE', 0, 'UNIQUE', 1) AS IS_UNIQUE, + IND_COL.COLUMN_NAME, + IND_COL.COLUMN_POSITION AS COLUMN_POS, + CON.CONSTRAINT_TYPE AS IS_PRIMARY + FROM ALL_IND_COLUMNS IND_COL + LEFT JOIN ALL_INDEXES IND + ON IND.OWNER = IND_COL.INDEX_OWNER + AND IND.INDEX_NAME = IND_COL.INDEX_NAME + LEFT JOIN ALL_CONSTRAINTS CON + ON CON.OWNER = IND_COL.INDEX_OWNER + AND CON.INDEX_NAME = IND_COL.INDEX_NAME +SQL; + + $conditions = ['IND_COL.INDEX_OWNER = :OWNER']; + $params = ['OWNER' => $databaseName]; + + if ($tableName !== null) { + $conditions[] = 'IND_COL.TABLE_NAME = :TABLE_NAME'; + $params['TABLE_NAME'] = $tableName; + } + + $sql .= ' WHERE ' . implode(' AND ', $conditions) . ' ORDER BY IND_COL.TABLE_NAME, IND_COL.INDEX_NAME' + . ', IND_COL.COLUMN_POSITION'; + + return $this->_conn->executeQuery($sql, $params); + } + + protected function selectForeignKeyColumns(string $databaseName, ?string $tableName = null): Result + { + $sql = 'SELECT'; + + if ($tableName === null) { + $sql .= ' COLS.TABLE_NAME,'; + } + + $sql .= <<<'SQL' + ALC.CONSTRAINT_NAME, + ALC.DELETE_RULE, + COLS.COLUMN_NAME LOCAL_COLUMN, + COLS.POSITION, + R_COLS.TABLE_NAME REFERENCES_TABLE, + R_COLS.COLUMN_NAME FOREIGN_COLUMN + FROM ALL_CONS_COLUMNS COLS + LEFT JOIN ALL_CONSTRAINTS ALC ON ALC.OWNER = COLS.OWNER AND ALC.CONSTRAINT_NAME = COLS.CONSTRAINT_NAME + LEFT JOIN ALL_CONS_COLUMNS R_COLS ON R_COLS.OWNER = ALC.R_OWNER AND + R_COLS.CONSTRAINT_NAME = ALC.R_CONSTRAINT_NAME AND + R_COLS.POSITION = COLS.POSITION +SQL; + + $conditions = ["ALC.CONSTRAINT_TYPE = 'R'", 'COLS.OWNER = :OWNER']; + $params = ['OWNER' => $databaseName]; + + if ($tableName !== null) { + $conditions[] = 'COLS.TABLE_NAME = :TABLE_NAME'; + $params['TABLE_NAME'] = $tableName; + } + + $sql .= ' WHERE ' . implode(' AND ', $conditions) . ' ORDER BY COLS.TABLE_NAME, COLS.CONSTRAINT_NAME' + . ', COLS.POSITION'; + + return $this->_conn->executeQuery($sql, $params); + } + + /** + * {@inheritDoc} + */ + protected function fetchTableOptionsByTable(string $databaseName, ?string $tableName = null): array + { + $sql = 'SELECT TABLE_NAME, COMMENTS'; + + $conditions = ['OWNER = :OWNER']; + $params = ['OWNER' => $databaseName]; + + if ($tableName !== null) { + $conditions[] = 'TABLE_NAME = :TABLE_NAME'; + $params['TABLE_NAME'] = $tableName; + } + + $sql .= ' FROM ALL_TAB_COMMENTS WHERE ' . implode(' AND ', $conditions); + + /** @var array> $metadata */ + $metadata = $this->_conn->executeQuery($sql, $params) + ->fetchAllAssociativeIndexed(); + + $tableOptions = []; + foreach ($metadata as $table => $data) { + $data = array_change_key_case($data, CASE_LOWER); + + $tableOptions[$table] = [ + 'comment' => $data['comments'], + ]; + } + + return $tableOptions; + } + + protected function normalizeName(string $name): string + { + $identifier = new Identifier($name); + + return $identifier->isQuoted() ? $identifier->getName() : strtoupper($name); + } +} diff --git a/vendor/doctrine/dbal/src/Schema/PostgreSQLSchemaManager.php b/vendor/doctrine/dbal/src/Schema/PostgreSQLSchemaManager.php new file mode 100644 index 00000000..7583c4d0 --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/PostgreSQLSchemaManager.php @@ -0,0 +1,773 @@ + + */ +class PostgreSQLSchemaManager extends AbstractSchemaManager +{ + /** @var string[]|null */ + private ?array $existingSchemaPaths = null; + + /** + * {@inheritDoc} + */ + public function listTableNames() + { + return $this->doListTableNames(); + } + + /** + * {@inheritDoc} + */ + public function listTables() + { + return $this->doListTables(); + } + + /** + * {@inheritDoc} + * + * @deprecated Use {@see introspectTable()} instead. + */ + public function listTableDetails($name) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5595', + '%s is deprecated. Use introspectTable() instead.', + __METHOD__, + ); + + return $this->doListTableDetails($name); + } + + /** + * {@inheritDoc} + */ + public function listTableColumns($table, $database = null) + { + return $this->doListTableColumns($table, $database); + } + + /** + * {@inheritDoc} + */ + public function listTableIndexes($table) + { + return $this->doListTableIndexes($table); + } + + /** + * {@inheritDoc} + */ + public function listTableForeignKeys($table, $database = null) + { + return $this->doListTableForeignKeys($table, $database); + } + + /** + * Gets all the existing schema names. + * + * @deprecated Use {@see listSchemaNames()} instead. + * + * @return string[] + * + * @throws Exception + */ + public function getSchemaNames() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4503', + 'PostgreSQLSchemaManager::getSchemaNames() is deprecated,' + . ' use PostgreSQLSchemaManager::listSchemaNames() instead.', + ); + + return $this->listNamespaceNames(); + } + + /** + * {@inheritDoc} + */ + public function listSchemaNames(): array + { + return $this->_conn->fetchFirstColumn( + <<<'SQL' +SELECT schema_name +FROM information_schema.schemata +WHERE schema_name NOT LIKE 'pg\_%' +AND schema_name != 'information_schema' +SQL, + ); + } + + /** + * {@inheritDoc} + * + * @deprecated + */ + public function getSchemaSearchPaths() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4821', + 'PostgreSQLSchemaManager::getSchemaSearchPaths() is deprecated.', + ); + + $params = $this->_conn->getParams(); + + $searchPaths = $this->_conn->fetchOne('SHOW search_path'); + assert($searchPaths !== false); + + $schema = explode(',', $searchPaths); + + if (isset($params['user'])) { + $schema = str_replace('"$user"', $params['user'], $schema); + } + + return array_map('trim', $schema); + } + + /** + * Gets names of all existing schemas in the current users search path. + * + * This is a PostgreSQL only function. + * + * @internal The method should be only used from within the PostgreSQLSchemaManager class hierarchy. + * + * @return string[] + * + * @throws Exception + */ + public function getExistingSchemaSearchPaths() + { + if ($this->existingSchemaPaths === null) { + $this->determineExistingSchemaSearchPaths(); + } + + assert($this->existingSchemaPaths !== null); + + return $this->existingSchemaPaths; + } + + /** + * Returns the name of the current schema. + * + * @return string|null + * + * @throws Exception + */ + protected function getCurrentSchema() + { + $schemas = $this->getExistingSchemaSearchPaths(); + + return array_shift($schemas); + } + + /** + * Sets or resets the order of the existing schemas in the current search path of the user. + * + * This is a PostgreSQL only function. + * + * @internal The method should be only used from within the PostgreSQLSchemaManager class hierarchy. + * + * @return void + * + * @throws Exception + */ + public function determineExistingSchemaSearchPaths() + { + $names = $this->listSchemaNames(); + $paths = $this->getSchemaSearchPaths(); + + $this->existingSchemaPaths = array_filter($paths, static function ($v) use ($names): bool { + return in_array($v, $names, true); + }); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableForeignKeyDefinition($tableForeignKey) + { + $onUpdate = null; + $onDelete = null; + + if ( + preg_match( + '(ON UPDATE ([a-zA-Z0-9]+( (NULL|ACTION|DEFAULT))?))', + $tableForeignKey['condef'], + $match, + ) === 1 + ) { + $onUpdate = $match[1]; + } + + if ( + preg_match( + '(ON DELETE ([a-zA-Z0-9]+( (NULL|ACTION|DEFAULT))?))', + $tableForeignKey['condef'], + $match, + ) === 1 + ) { + $onDelete = $match[1]; + } + + $result = preg_match('/FOREIGN KEY \((.+)\) REFERENCES (.+)\((.+)\)/', $tableForeignKey['condef'], $values); + assert($result === 1); + + // PostgreSQL returns identifiers that are keywords with quotes, we need them later, don't get + // the idea to trim them here. + $localColumns = array_map('trim', explode(',', $values[1])); + $foreignColumns = array_map('trim', explode(',', $values[3])); + $foreignTable = $values[2]; + + return new ForeignKeyConstraint( + $localColumns, + $foreignTable, + $foreignColumns, + $tableForeignKey['conname'], + ['onUpdate' => $onUpdate, 'onDelete' => $onDelete], + ); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableViewDefinition($view) + { + return new View($view['schemaname'] . '.' . $view['viewname'], $view['definition']); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableDefinition($table) + { + $currentSchema = $this->getCurrentSchema(); + + if ($table['schema_name'] === $currentSchema) { + return $table['table_name']; + } + + return $table['schema_name'] . '.' . $table['table_name']; + } + + /** + * {@inheritdoc} + * + * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaPgsqlReader.html + */ + protected function _getPortableTableIndexesList($tableIndexes, $tableName = null) + { + $buffer = []; + foreach ($tableIndexes as $row) { + $colNumbers = array_map('intval', explode(' ', $row['indkey'])); + $columnNameSql = sprintf( + 'SELECT attnum, attname FROM pg_attribute WHERE attrelid=%d AND attnum IN (%s) ORDER BY attnum ASC', + $row['indrelid'], + implode(' ,', $colNumbers), + ); + + $indexColumns = $this->_conn->fetchAllAssociative($columnNameSql); + + // required for getting the order of the columns right. + foreach ($colNumbers as $colNum) { + foreach ($indexColumns as $colRow) { + if ($colNum !== $colRow['attnum']) { + continue; + } + + $buffer[] = [ + 'key_name' => $row['relname'], + 'column_name' => trim($colRow['attname']), + 'non_unique' => ! $row['indisunique'], + 'primary' => $row['indisprimary'], + 'where' => $row['where'], + ]; + } + } + } + + return parent::_getPortableTableIndexesList($buffer, $tableName); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableDatabaseDefinition($database) + { + return $database['datname']; + } + + /** + * {@inheritdoc} + * + * @deprecated Use {@see listSchemaNames()} instead. + */ + protected function getPortableNamespaceDefinition(array $namespace) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4503', + 'PostgreSQLSchemaManager::getPortableNamespaceDefinition() is deprecated,' + . ' use PostgreSQLSchemaManager::listSchemaNames() instead.', + ); + + return $namespace['nspname']; + } + + /** + * {@inheritdoc} + */ + protected function _getPortableSequenceDefinition($sequence) + { + if ($sequence['schemaname'] !== 'public') { + $sequenceName = $sequence['schemaname'] . '.' . $sequence['relname']; + } else { + $sequenceName = $sequence['relname']; + } + + return new Sequence($sequenceName, (int) $sequence['increment_by'], (int) $sequence['min_value']); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableColumnDefinition($tableColumn) + { + $tableColumn = array_change_key_case($tableColumn, CASE_LOWER); + + if (strtolower($tableColumn['type']) === 'varchar' || strtolower($tableColumn['type']) === 'bpchar') { + // get length from varchar definition + $length = preg_replace('~.*\(([0-9]*)\).*~', '$1', $tableColumn['complete_type']); + $tableColumn['length'] = $length; + } + + $matches = []; + + $autoincrement = false; + + if ( + $tableColumn['default'] !== null + && preg_match("/^nextval\('(.*)'(::.*)?\)$/", $tableColumn['default'], $matches) === 1 + ) { + $tableColumn['sequence'] = $matches[1]; + $tableColumn['default'] = null; + $autoincrement = true; + } + + if ($tableColumn['default'] !== null) { + if (preg_match("/^['(](.*)[')]::/", $tableColumn['default'], $matches) === 1) { + $tableColumn['default'] = $matches[1]; + } elseif (preg_match('/^NULL::/', $tableColumn['default']) === 1) { + $tableColumn['default'] = null; + } + } + + $length = $tableColumn['length'] ?? null; + if ($length === '-1' && isset($tableColumn['atttypmod'])) { + $length = $tableColumn['atttypmod'] - 4; + } + + if ((int) $length <= 0) { + $length = null; + } + + $fixed = null; + + if (! isset($tableColumn['name'])) { + $tableColumn['name'] = ''; + } + + $precision = null; + $scale = null; + $jsonb = null; + + $dbType = strtolower($tableColumn['type']); + if ( + $tableColumn['domain_type'] !== null + && $tableColumn['domain_type'] !== '' + && ! $this->_platform->hasDoctrineTypeMappingFor($tableColumn['type']) + ) { + $dbType = strtolower($tableColumn['domain_type']); + $tableColumn['complete_type'] = $tableColumn['domain_complete_type']; + } + + $type = $this->_platform->getDoctrineTypeMapping($dbType); + $type = $this->extractDoctrineTypeFromComment($tableColumn['comment'], $type); + $tableColumn['comment'] = $this->removeDoctrineTypeFromComment($tableColumn['comment'], $type); + + switch ($dbType) { + case 'smallint': + case 'int2': + $tableColumn['default'] = $this->fixVersion94NegativeNumericDefaultValue($tableColumn['default']); + $length = null; + break; + + case 'int': + case 'int4': + case 'integer': + $tableColumn['default'] = $this->fixVersion94NegativeNumericDefaultValue($tableColumn['default']); + $length = null; + break; + + case 'bigint': + case 'int8': + $tableColumn['default'] = $this->fixVersion94NegativeNumericDefaultValue($tableColumn['default']); + $length = null; + break; + + case 'bool': + case 'boolean': + if ($tableColumn['default'] === 'true') { + $tableColumn['default'] = true; + } + + if ($tableColumn['default'] === 'false') { + $tableColumn['default'] = false; + } + + $length = null; + break; + + case 'text': + case '_varchar': + case 'varchar': + $tableColumn['default'] = $this->parseDefaultExpression($tableColumn['default']); + $fixed = false; + break; + case 'interval': + $fixed = false; + break; + + case 'char': + case 'bpchar': + $fixed = true; + break; + + case 'float': + case 'float4': + case 'float8': + case 'double': + case 'double precision': + case 'real': + case 'decimal': + case 'money': + case 'numeric': + $tableColumn['default'] = $this->fixVersion94NegativeNumericDefaultValue($tableColumn['default']); + + if ( + preg_match( + '([A-Za-z]+\(([0-9]+),([0-9]+)\))', + $tableColumn['complete_type'], + $match, + ) === 1 + ) { + $precision = $match[1]; + $scale = $match[2]; + $length = null; + } + + break; + + case 'year': + $length = null; + break; + + // PostgreSQL 9.4+ only + case 'jsonb': + $jsonb = true; + break; + } + + if ( + $tableColumn['default'] !== null && preg_match( + "('([^']+)'::)", + $tableColumn['default'], + $match, + ) === 1 + ) { + $tableColumn['default'] = $match[1]; + } + + $options = [ + 'length' => $length, + 'notnull' => (bool) $tableColumn['isnotnull'], + 'default' => $tableColumn['default'], + 'precision' => $precision, + 'scale' => $scale, + 'fixed' => $fixed, + 'unsigned' => false, + 'autoincrement' => $autoincrement, + 'comment' => isset($tableColumn['comment']) && $tableColumn['comment'] !== '' + ? $tableColumn['comment'] + : null, + ]; + + $column = new Column($tableColumn['field'], Type::getType($type), $options); + + if (isset($tableColumn['collation']) && ! empty($tableColumn['collation'])) { + $column->setPlatformOption('collation', $tableColumn['collation']); + } + + if ($column->getType()->getName() === Types::JSON) { + if (! $column->getType() instanceof JsonType) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5049', + <<<'DEPRECATION' + %s not extending %s while being named %s is deprecated, + and will lead to jsonb never to being used in 4.0., + DEPRECATION, + get_class($column->getType()), + JsonType::class, + Types::JSON, + ); + } + + $column->setPlatformOption('jsonb', $jsonb); + } + + return $column; + } + + /** + * PostgreSQL 9.4 puts parentheses around negative numeric default values that need to be stripped eventually. + * + * @param mixed $defaultValue + * + * @return mixed + */ + private function fixVersion94NegativeNumericDefaultValue($defaultValue) + { + if ($defaultValue !== null && strpos($defaultValue, '(') === 0) { + return trim($defaultValue, '()'); + } + + return $defaultValue; + } + + /** + * Parses a default value expression as given by PostgreSQL + */ + private function parseDefaultExpression(?string $default): ?string + { + if ($default === null) { + return $default; + } + + return str_replace("''", "'", $default); + } + + protected function selectTableNames(string $databaseName): Result + { + $sql = <<<'SQL' +SELECT quote_ident(table_name) AS table_name, + table_schema AS schema_name +FROM information_schema.tables +WHERE table_catalog = ? + AND table_schema NOT LIKE 'pg\_%' + AND table_schema != 'information_schema' + AND table_name != 'geometry_columns' + AND table_name != 'spatial_ref_sys' + AND table_type = 'BASE TABLE' +SQL; + + return $this->_conn->executeQuery($sql, [$databaseName]); + } + + protected function selectTableColumns(string $databaseName, ?string $tableName = null): Result + { + $sql = 'SELECT'; + + if ($tableName === null) { + $sql .= ' c.relname AS table_name, n.nspname AS schema_name,'; + } + + $sql .= <<<'SQL' + a.attnum, + quote_ident(a.attname) AS field, + t.typname AS type, + format_type(a.atttypid, a.atttypmod) AS complete_type, + (SELECT tc.collcollate FROM pg_catalog.pg_collation tc WHERE tc.oid = a.attcollation) AS collation, + (SELECT t1.typname FROM pg_catalog.pg_type t1 WHERE t1.oid = t.typbasetype) AS domain_type, + (SELECT format_type(t2.typbasetype, t2.typtypmod) FROM + pg_catalog.pg_type t2 WHERE t2.typtype = 'd' AND t2.oid = a.atttypid) AS domain_complete_type, + a.attnotnull AS isnotnull, + (SELECT 't' + FROM pg_index + WHERE c.oid = pg_index.indrelid + AND pg_index.indkey[0] = a.attnum + AND pg_index.indisprimary = 't' + ) AS pri, + (SELECT pg_get_expr(adbin, adrelid) + FROM pg_attrdef + WHERE c.oid = pg_attrdef.adrelid + AND pg_attrdef.adnum=a.attnum + ) AS default, + (SELECT pg_description.description + FROM pg_description WHERE pg_description.objoid = c.oid AND a.attnum = pg_description.objsubid + ) AS comment + FROM pg_attribute a + INNER JOIN pg_class c + ON c.oid = a.attrelid + INNER JOIN pg_type t + ON t.oid = a.atttypid + INNER JOIN pg_namespace n + ON n.oid = c.relnamespace + LEFT JOIN pg_depend d + ON d.objid = c.oid + AND d.deptype = 'e' +SQL; + + $conditions = array_merge([ + 'a.attnum > 0', + "c.relkind = 'r'", + 'd.refobjid IS NULL', + ], $this->buildQueryConditions($tableName)); + + $sql .= ' WHERE ' . implode(' AND ', $conditions) . ' ORDER BY a.attnum'; + + return $this->_conn->executeQuery($sql); + } + + protected function selectIndexColumns(string $databaseName, ?string $tableName = null): Result + { + $sql = 'SELECT'; + + if ($tableName === null) { + $sql .= ' tc.relname AS table_name, tn.nspname AS schema_name,'; + } + + $sql .= <<<'SQL' + quote_ident(ic.relname) AS relname, + i.indisunique, + i.indisprimary, + i.indkey, + i.indrelid, + pg_get_expr(indpred, indrelid) AS "where" + FROM pg_index i + JOIN pg_class AS tc ON tc.oid = i.indrelid + JOIN pg_namespace tn ON tn.oid = tc.relnamespace + JOIN pg_class AS ic ON ic.oid = i.indexrelid + WHERE ic.oid IN ( + SELECT indexrelid + FROM pg_index i, pg_class c, pg_namespace n +SQL; + + $conditions = array_merge([ + 'c.oid = i.indrelid', + 'c.relnamespace = n.oid', + ], $this->buildQueryConditions($tableName)); + + $sql .= ' WHERE ' . implode(' AND ', $conditions) . ')'; + + return $this->_conn->executeQuery($sql); + } + + protected function selectForeignKeyColumns(string $databaseName, ?string $tableName = null): Result + { + $sql = 'SELECT'; + + if ($tableName === null) { + $sql .= ' tc.relname AS table_name, tn.nspname AS schema_name,'; + } + + $sql .= <<<'SQL' + quote_ident(r.conname) as conname, + pg_get_constraintdef(r.oid, true) as condef + FROM pg_constraint r + JOIN pg_class AS tc ON tc.oid = r.conrelid + JOIN pg_namespace tn ON tn.oid = tc.relnamespace + WHERE r.conrelid IN + ( + SELECT c.oid + FROM pg_class c, pg_namespace n +SQL; + + $conditions = array_merge(['n.oid = c.relnamespace'], $this->buildQueryConditions($tableName)); + + $sql .= ' WHERE ' . implode(' AND ', $conditions) . ") AND r.contype = 'f'"; + + return $this->_conn->executeQuery($sql); + } + + /** + * {@inheritDoc} + */ + protected function fetchTableOptionsByTable(string $databaseName, ?string $tableName = null): array + { + $sql = <<<'SQL' +SELECT c.relname, + obj_description(c.oid, 'pg_class') AS comment +FROM pg_class c + INNER JOIN pg_namespace n + ON n.oid = c.relnamespace +SQL; + + $conditions = array_merge(["c.relkind = 'r'"], $this->buildQueryConditions($tableName)); + + $sql .= ' WHERE ' . implode(' AND ', $conditions); + + return $this->_conn->fetchAllAssociativeIndexed($sql); + } + + /** + * @param string|null $tableName + * + * @return list + */ + private function buildQueryConditions($tableName): array + { + $conditions = []; + + if ($tableName !== null) { + if (strpos($tableName, '.') !== false) { + [$schemaName, $tableName] = explode('.', $tableName); + $conditions[] = 'n.nspname = ' . $this->_platform->quoteStringLiteral($schemaName); + } else { + $conditions[] = 'n.nspname = ANY(current_schemas(false))'; + } + + $identifier = new Identifier($tableName); + $conditions[] = 'c.relname = ' . $this->_platform->quoteStringLiteral($identifier->getName()); + } + + $conditions[] = "n.nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast')"; + + return $conditions; + } +} diff --git a/vendor/doctrine/dbal/src/Schema/SQLServerSchemaManager.php b/vendor/doctrine/dbal/src/Schema/SQLServerSchemaManager.php new file mode 100644 index 00000000..657e3651 --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/SQLServerSchemaManager.php @@ -0,0 +1,603 @@ + + */ +class SQLServerSchemaManager extends AbstractSchemaManager +{ + private ?string $databaseCollation = null; + + /** + * {@inheritDoc} + */ + public function listTableNames() + { + return $this->doListTableNames(); + } + + /** + * {@inheritDoc} + */ + public function listTables() + { + return $this->doListTables(); + } + + /** + * {@inheritDoc} + * + * @deprecated Use {@see introspectTable()} instead. + */ + public function listTableDetails($name) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5595', + '%s is deprecated. Use introspectTable() instead.', + __METHOD__, + ); + + return $this->doListTableDetails($name); + } + + /** + * {@inheritDoc} + */ + public function listTableColumns($table, $database = null) + { + return $this->doListTableColumns($table, $database); + } + + /** + * {@inheritDoc} + */ + public function listTableIndexes($table) + { + return $this->doListTableIndexes($table); + } + + /** + * {@inheritDoc} + */ + public function listTableForeignKeys($table, $database = null) + { + return $this->doListTableForeignKeys($table, $database); + } + + /** + * {@inheritDoc} + */ + public function listSchemaNames(): array + { + return $this->_conn->fetchFirstColumn( + <<<'SQL' +SELECT name +FROM sys.schemas +WHERE name NOT IN('guest', 'INFORMATION_SCHEMA', 'sys') +SQL, + ); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableSequenceDefinition($sequence) + { + return new Sequence($sequence['name'], (int) $sequence['increment'], (int) $sequence['start_value']); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableColumnDefinition($tableColumn) + { + $dbType = strtok($tableColumn['type'], '(), '); + assert(is_string($dbType)); + + $fixed = null; + $length = (int) $tableColumn['length']; + $default = $tableColumn['default']; + + if (! isset($tableColumn['name'])) { + $tableColumn['name'] = ''; + } + + if ($default !== null) { + $default = $this->parseDefaultExpression($default); + } + + switch ($dbType) { + case 'nchar': + case 'nvarchar': + case 'ntext': + // Unicode data requires 2 bytes per character + $length /= 2; + break; + + case 'varchar': + // TEXT type is returned as VARCHAR(MAX) with a length of -1 + if ($length === -1) { + $dbType = 'text'; + } + + break; + + case 'varbinary': + if ($length === -1) { + $dbType = 'blob'; + } + + break; + } + + if ($dbType === 'char' || $dbType === 'nchar' || $dbType === 'binary') { + $fixed = true; + } + + $type = $this->_platform->getDoctrineTypeMapping($dbType); + $type = $this->extractDoctrineTypeFromComment($tableColumn['comment'], $type); + $tableColumn['comment'] = $this->removeDoctrineTypeFromComment($tableColumn['comment'], $type); + + $options = [ + 'unsigned' => false, + 'fixed' => (bool) $fixed, + 'default' => $default, + 'notnull' => (bool) $tableColumn['notnull'], + 'scale' => $tableColumn['scale'], + 'precision' => $tableColumn['precision'], + 'autoincrement' => (bool) $tableColumn['autoincrement'], + 'comment' => $tableColumn['comment'] !== '' ? $tableColumn['comment'] : null, + ]; + + if ($length !== 0 && ($type === 'text' || $type === 'string' || $type === 'binary')) { + $options['length'] = $length; + } + + $column = new Column($tableColumn['name'], Type::getType($type), $options); + + if (isset($tableColumn['collation']) && $tableColumn['collation'] !== 'NULL') { + $column->setPlatformOption('collation', $tableColumn['collation']); + } + + return $column; + } + + private function parseDefaultExpression(string $value): ?string + { + while (preg_match('/^\((.*)\)$/s', $value, $matches)) { + $value = $matches[1]; + } + + if ($value === 'NULL') { + return null; + } + + if (preg_match('/^\'(.*)\'$/s', $value, $matches) === 1) { + $value = str_replace("''", "'", $matches[1]); + } + + if ($value === 'getdate()') { + return $this->_platform->getCurrentTimestampSQL(); + } + + return $value; + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableForeignKeysList($tableForeignKeys) + { + $foreignKeys = []; + + foreach ($tableForeignKeys as $tableForeignKey) { + $name = $tableForeignKey['ForeignKey']; + + if (! isset($foreignKeys[$name])) { + $foreignKeys[$name] = [ + 'local_columns' => [$tableForeignKey['ColumnName']], + 'foreign_table' => $tableForeignKey['ReferenceTableName'], + 'foreign_columns' => [$tableForeignKey['ReferenceColumnName']], + 'name' => $name, + 'options' => [ + 'onUpdate' => str_replace('_', ' ', $tableForeignKey['update_referential_action_desc']), + 'onDelete' => str_replace('_', ' ', $tableForeignKey['delete_referential_action_desc']), + ], + ]; + } else { + $foreignKeys[$name]['local_columns'][] = $tableForeignKey['ColumnName']; + $foreignKeys[$name]['foreign_columns'][] = $tableForeignKey['ReferenceColumnName']; + } + } + + return parent::_getPortableTableForeignKeysList($foreignKeys); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableIndexesList($tableIndexes, $tableName = null) + { + foreach ($tableIndexes as &$tableIndex) { + $tableIndex['non_unique'] = (bool) $tableIndex['non_unique']; + $tableIndex['primary'] = (bool) $tableIndex['primary']; + $tableIndex['flags'] = $tableIndex['flags'] ? [$tableIndex['flags']] : null; + } + + return parent::_getPortableTableIndexesList($tableIndexes, $tableName); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableForeignKeyDefinition($tableForeignKey) + { + return new ForeignKeyConstraint( + $tableForeignKey['local_columns'], + $tableForeignKey['foreign_table'], + $tableForeignKey['foreign_columns'], + $tableForeignKey['name'], + $tableForeignKey['options'], + ); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableDefinition($table) + { + if ($table['schema_name'] !== 'dbo') { + return $table['schema_name'] . '.' . $table['table_name']; + } + + return $table['table_name']; + } + + /** + * {@inheritdoc} + */ + protected function _getPortableDatabaseDefinition($database) + { + return $database['name']; + } + + /** + * {@inheritdoc} + * + * @deprecated Use {@see listSchemaNames()} instead. + */ + protected function getPortableNamespaceDefinition(array $namespace) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4503', + 'SQLServerSchemaManager::getPortableNamespaceDefinition() is deprecated,' + . ' use SQLServerSchemaManager::listSchemaNames() instead.', + ); + + return $namespace['name']; + } + + /** + * {@inheritdoc} + */ + protected function _getPortableViewDefinition($view) + { + // @todo + return new View($view['name'], $view['definition']); + } + + /** + * {@inheritdoc} + */ + public function alterTable(TableDiff $tableDiff) + { + $droppedColumns = $tableDiff->getDroppedColumns(); + + if (count($droppedColumns) > 0) { + $tableName = ($tableDiff->getOldTable() ?? $tableDiff->getName($this->_platform))->getName(); + + foreach ($droppedColumns as $col) { + foreach ($this->getColumnConstraints($tableName, $col->getName()) as $constraint) { + $this->_conn->executeStatement( + sprintf( + 'ALTER TABLE %s DROP CONSTRAINT %s', + $tableName, + $constraint, + ), + ); + } + } + } + + parent::alterTable($tableDiff); + } + + /** + * Returns the names of the constraints for a given column. + * + * @return iterable + * + * @throws Exception + */ + private function getColumnConstraints(string $table, string $column): iterable + { + return $this->_conn->iterateColumn( + <<<'SQL' +SELECT o.name +FROM sys.objects o + INNER JOIN sys.objects t + ON t.object_id = o.parent_object_id + AND t.type = 'U' + INNER JOIN sys.default_constraints dc + ON dc.object_id = o.object_id + INNER JOIN sys.columns c + ON c.column_id = dc.parent_column_id + AND c.object_id = t.object_id +WHERE t.name = ? + AND c.name = ? +SQL + , + [$table, $column], + ); + } + + /** @throws Exception */ + public function createComparator(): Comparator + { + return new SQLServer\Comparator($this->_platform, $this->getDatabaseCollation()); + } + + /** @throws Exception */ + private function getDatabaseCollation(): string + { + if ($this->databaseCollation === null) { + $databaseCollation = $this->_conn->fetchOne( + 'SELECT collation_name FROM sys.databases WHERE name = ' + . $this->_platform->getCurrentDatabaseExpression(), + ); + + // a database is always selected, even if omitted in the connection parameters + assert(is_string($databaseCollation)); + + $this->databaseCollation = $databaseCollation; + } + + return $this->databaseCollation; + } + + protected function selectTableNames(string $databaseName): Result + { + // The "sysdiagrams" table must be ignored as it's internal SQL Server table for Database Diagrams + $sql = <<<'SQL' +SELECT name AS table_name, + SCHEMA_NAME(schema_id) AS schema_name +FROM sys.objects +WHERE type = 'U' + AND name != 'sysdiagrams' +ORDER BY name +SQL; + + return $this->_conn->executeQuery($sql, [$databaseName]); + } + + protected function selectTableColumns(string $databaseName, ?string $tableName = null): Result + { + $sql = 'SELECT'; + + if ($tableName === null) { + $sql .= ' obj.name AS table_name, scm.name AS schema_name,'; + } + + $sql .= <<<'SQL' + col.name, + type.name AS type, + col.max_length AS length, + ~col.is_nullable AS notnull, + def.definition AS [default], + col.scale, + col.precision, + col.is_identity AS autoincrement, + col.collation_name AS collation, + -- CAST avoids driver error for sql_variant type + CAST(prop.value AS NVARCHAR(MAX)) AS comment + FROM sys.columns AS col + JOIN sys.types AS type + ON col.user_type_id = type.user_type_id + JOIN sys.objects AS obj + ON col.object_id = obj.object_id + JOIN sys.schemas AS scm + ON obj.schema_id = scm.schema_id + LEFT JOIN sys.default_constraints def + ON col.default_object_id = def.object_id + AND col.object_id = def.parent_object_id + LEFT JOIN sys.extended_properties AS prop + ON obj.object_id = prop.major_id + AND col.column_id = prop.minor_id + AND prop.name = 'MS_Description' +SQL; + + // The "sysdiagrams" table must be ignored as it's internal SQL Server table for Database Diagrams + $conditions = ["obj.type = 'U'", "obj.name != 'sysdiagrams'"]; + $params = []; + + if ($tableName !== null) { + $conditions[] = $this->getTableWhereClause($tableName, 'scm.name', 'obj.name'); + } + + $sql .= ' WHERE ' . implode(' AND ', $conditions); + + return $this->_conn->executeQuery($sql, $params); + } + + protected function selectIndexColumns(string $databaseName, ?string $tableName = null): Result + { + $sql = 'SELECT'; + + if ($tableName === null) { + $sql .= ' tbl.name AS table_name, scm.name AS schema_name,'; + } + + $sql .= <<<'SQL' + idx.name AS key_name, + col.name AS column_name, + ~idx.is_unique AS non_unique, + idx.is_primary_key AS [primary], + CASE idx.type + WHEN '1' THEN 'clustered' + WHEN '2' THEN 'nonclustered' + ELSE NULL + END AS flags + FROM sys.tables AS tbl + JOIN sys.schemas AS scm + ON tbl.schema_id = scm.schema_id + JOIN sys.indexes AS idx + ON tbl.object_id = idx.object_id + JOIN sys.index_columns AS idxcol + ON idx.object_id = idxcol.object_id + AND idx.index_id = idxcol.index_id + JOIN sys.columns AS col + ON idxcol.object_id = col.object_id + AND idxcol.column_id = col.column_id +SQL; + + $conditions = []; + $params = []; + + if ($tableName !== null) { + $conditions[] = $this->getTableWhereClause($tableName, 'scm.name', 'tbl.name'); + $sql .= ' WHERE ' . implode(' AND ', $conditions); + } + + $sql .= ' ORDER BY idx.index_id, idxcol.key_ordinal'; + + return $this->_conn->executeQuery($sql, $params); + } + + protected function selectForeignKeyColumns(string $databaseName, ?string $tableName = null): Result + { + $sql = 'SELECT'; + + if ($tableName === null) { + $sql .= ' OBJECT_NAME (f.parent_object_id) AS table_name, SCHEMA_NAME(f.schema_id) AS schema_name,'; + } + + $sql .= <<<'SQL' + f.name AS ForeignKey, + SCHEMA_NAME (f.SCHEMA_ID) AS SchemaName, + OBJECT_NAME (f.parent_object_id) AS TableName, + COL_NAME (fc.parent_object_id,fc.parent_column_id) AS ColumnName, + SCHEMA_NAME (o.SCHEMA_ID) ReferenceSchemaName, + OBJECT_NAME (f.referenced_object_id) AS ReferenceTableName, + COL_NAME(fc.referenced_object_id,fc.referenced_column_id) AS ReferenceColumnName, + f.delete_referential_action_desc, + f.update_referential_action_desc + FROM sys.foreign_keys AS f + INNER JOIN sys.foreign_key_columns AS fc + INNER JOIN sys.objects AS o ON o.OBJECT_ID = fc.referenced_object_id + ON f.OBJECT_ID = fc.constraint_object_id +SQL; + + $conditions = []; + $params = []; + + if ($tableName !== null) { + $conditions[] = $this->getTableWhereClause( + $tableName, + 'SCHEMA_NAME(f.schema_id)', + 'OBJECT_NAME(f.parent_object_id)', + ); + + $sql .= ' WHERE ' . implode(' AND ', $conditions); + } + + $sql .= ' ORDER BY fc.constraint_column_id'; + + return $this->_conn->executeQuery($sql, $params); + } + + /** + * {@inheritDoc} + */ + protected function fetchTableOptionsByTable(string $databaseName, ?string $tableName = null): array + { + $sql = <<<'SQL' + SELECT + tbl.name, + p.value AS [table_comment] + FROM + sys.tables AS tbl + INNER JOIN sys.extended_properties AS p ON p.major_id=tbl.object_id AND p.minor_id=0 AND p.class=1 +SQL; + + $conditions = ["SCHEMA_NAME(tbl.schema_id) = N'dbo'", "p.name = N'MS_Description'"]; + $params = []; + + if ($tableName !== null) { + $conditions[] = "tbl.name = N'" . $tableName . "'"; + } + + $sql .= ' WHERE ' . implode(' AND ', $conditions); + + /** @var array> $metadata */ + $metadata = $this->_conn->executeQuery($sql, $params) + ->fetchAllAssociativeIndexed(); + + $tableOptions = []; + foreach ($metadata as $table => $data) { + $data = array_change_key_case($data, CASE_LOWER); + + $tableOptions[$table] = [ + 'comment' => $data['table_comment'], + ]; + } + + return $tableOptions; + } + + /** + * Returns the where clause to filter schema and table name in a query. + * + * @param string $table The full qualified name of the table. + * @param string $schemaColumn The name of the column to compare the schema to in the where clause. + * @param string $tableColumn The name of the column to compare the table to in the where clause. + */ + private function getTableWhereClause($table, $schemaColumn, $tableColumn): string + { + if (strpos($table, '.') !== false) { + [$schema, $table] = explode('.', $table); + $schema = $this->_platform->quoteStringLiteral($schema); + $table = $this->_platform->quoteStringLiteral($table); + } else { + $schema = 'SCHEMA_NAME()'; + $table = $this->_platform->quoteStringLiteral($table); + } + + return sprintf('(%s = %s AND %s = %s)', $tableColumn, $table, $schemaColumn, $schema); + } +} diff --git a/vendor/doctrine/dbal/src/Schema/Schema.php b/vendor/doctrine/dbal/src/Schema/Schema.php new file mode 100644 index 00000000..703c83c5 --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/Schema.php @@ -0,0 +1,523 @@ +_schemaConfig = $schemaConfig; + $this->_setName($schemaConfig->getName() ?? 'public'); + + foreach ($namespaces as $namespace) { + $this->createNamespace($namespace); + } + + foreach ($tables as $table) { + $this->_addTable($table); + } + + foreach ($sequences as $sequence) { + $this->_addSequence($sequence); + } + } + + /** + * @deprecated + * + * @return bool + */ + public function hasExplicitForeignKeyIndexes() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4822', + 'Schema::hasExplicitForeignKeyIndexes() is deprecated.', + ); + + return $this->_schemaConfig->hasExplicitForeignKeyIndexes(); + } + + /** + * @return void + * + * @throws SchemaException + */ + protected function _addTable(Table $table) + { + $namespaceName = $table->getNamespaceName(); + $tableName = $this->normalizeName($table); + + if (isset($this->_tables[$tableName])) { + throw SchemaException::tableAlreadyExists($tableName); + } + + if ( + $namespaceName !== null + && ! $table->isInDefaultNamespace($this->getName()) + && ! $this->hasNamespace($namespaceName) + ) { + $this->createNamespace($namespaceName); + } + + $this->_tables[$tableName] = $table; + $table->setSchemaConfig($this->_schemaConfig); + } + + /** + * @return void + * + * @throws SchemaException + */ + protected function _addSequence(Sequence $sequence) + { + $namespaceName = $sequence->getNamespaceName(); + $seqName = $this->normalizeName($sequence); + + if (isset($this->_sequences[$seqName])) { + throw SchemaException::sequenceAlreadyExists($seqName); + } + + if ( + $namespaceName !== null + && ! $sequence->isInDefaultNamespace($this->getName()) + && ! $this->hasNamespace($namespaceName) + ) { + $this->createNamespace($namespaceName); + } + + $this->_sequences[$seqName] = $sequence; + } + + /** + * Returns the namespaces of this schema. + * + * @return string[] A list of namespace names. + */ + public function getNamespaces() + { + return $this->namespaces; + } + + /** + * Gets all tables of this schema. + * + * @return Table[] + */ + public function getTables() + { + return $this->_tables; + } + + /** + * @param string $name + * + * @return Table + * + * @throws SchemaException + */ + public function getTable($name) + { + $name = $this->getFullQualifiedAssetName($name); + if (! isset($this->_tables[$name])) { + throw SchemaException::tableDoesNotExist($name); + } + + return $this->_tables[$name]; + } + + /** @param string $name */ + private function getFullQualifiedAssetName($name): string + { + $name = $this->getUnquotedAssetName($name); + + if (strpos($name, '.') === false) { + $name = $this->getName() . '.' . $name; + } + + return strtolower($name); + } + + private function normalizeName(AbstractAsset $asset): string + { + return $asset->getFullQualifiedName($this->getName()); + } + + /** + * Returns the unquoted representation of a given asset name. + * + * @param string $assetName Quoted or unquoted representation of an asset name. + */ + private function getUnquotedAssetName($assetName): string + { + if ($this->isIdentifierQuoted($assetName)) { + return $this->trimQuotes($assetName); + } + + return $assetName; + } + + /** + * Does this schema have a namespace with the given name? + * + * @param string $name + * + * @return bool + */ + public function hasNamespace($name) + { + $name = strtolower($this->getUnquotedAssetName($name)); + + return isset($this->namespaces[$name]); + } + + /** + * Does this schema have a table with the given name? + * + * @param string $name + * + * @return bool + */ + public function hasTable($name) + { + $name = $this->getFullQualifiedAssetName($name); + + return isset($this->_tables[$name]); + } + + /** + * Gets all table names, prefixed with a schema name, even the default one if present. + * + * @deprecated Use {@see getTables()} and {@see Table::getName()} instead. + * + * @return string[] + */ + public function getTableNames() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4800', + 'Schema::getTableNames() is deprecated.' + . ' Use Schema::getTables() and Table::getName() instead.', + __METHOD__, + ); + + return array_keys($this->_tables); + } + + /** + * @param string $name + * + * @return bool + */ + public function hasSequence($name) + { + $name = $this->getFullQualifiedAssetName($name); + + return isset($this->_sequences[$name]); + } + + /** + * @param string $name + * + * @return Sequence + * + * @throws SchemaException + */ + public function getSequence($name) + { + $name = $this->getFullQualifiedAssetName($name); + if (! $this->hasSequence($name)) { + throw SchemaException::sequenceDoesNotExist($name); + } + + return $this->_sequences[$name]; + } + + /** @return Sequence[] */ + public function getSequences() + { + return $this->_sequences; + } + + /** + * Creates a new namespace. + * + * @param string $name The name of the namespace to create. + * + * @return Schema This schema instance. + * + * @throws SchemaException + */ + public function createNamespace($name) + { + $unquotedName = strtolower($this->getUnquotedAssetName($name)); + + if (isset($this->namespaces[$unquotedName])) { + throw SchemaException::namespaceAlreadyExists($unquotedName); + } + + $this->namespaces[$unquotedName] = $name; + + return $this; + } + + /** + * Creates a new table. + * + * @param string $name + * + * @return Table + * + * @throws SchemaException + */ + public function createTable($name) + { + $table = new Table($name); + $this->_addTable($table); + + foreach ($this->_schemaConfig->getDefaultTableOptions() as $option => $value) { + $table->addOption($option, $value); + } + + return $table; + } + + /** + * Renames a table. + * + * @param string $oldName + * @param string $newName + * + * @return Schema + * + * @throws SchemaException + */ + public function renameTable($oldName, $newName) + { + $table = $this->getTable($oldName); + $table->_setName($newName); + + $this->dropTable($oldName); + $this->_addTable($table); + + return $this; + } + + /** + * Drops a table from the schema. + * + * @param string $name + * + * @return Schema + * + * @throws SchemaException + */ + public function dropTable($name) + { + $name = $this->getFullQualifiedAssetName($name); + $this->getTable($name); + unset($this->_tables[$name]); + + return $this; + } + + /** + * Creates a new sequence. + * + * @param string $name + * @param int $allocationSize + * @param int $initialValue + * + * @return Sequence + * + * @throws SchemaException + */ + public function createSequence($name, $allocationSize = 1, $initialValue = 1) + { + $seq = new Sequence($name, $allocationSize, $initialValue); + $this->_addSequence($seq); + + return $seq; + } + + /** + * @param string $name + * + * @return Schema + */ + public function dropSequence($name) + { + $name = $this->getFullQualifiedAssetName($name); + unset($this->_sequences[$name]); + + return $this; + } + + /** + * Returns an array of necessary SQL queries to create the schema on the given platform. + * + * @return list + * + * @throws Exception + */ + public function toSql(AbstractPlatform $platform) + { + $builder = new CreateSchemaObjectsSQLBuilder($platform); + + return $builder->buildSQL($this); + } + + /** + * Return an array of necessary SQL queries to drop the schema on the given platform. + * + * @return list + * + * @throws Exception + */ + public function toDropSql(AbstractPlatform $platform) + { + $builder = new DropSchemaObjectsSQLBuilder($platform); + + return $builder->buildSQL($this); + } + + /** + * @deprecated + * + * @return string[] + * + * @throws SchemaException + */ + public function getMigrateToSql(Schema $toSchema, AbstractPlatform $platform) + { + $schemaDiff = (new Comparator())->compareSchemas($this, $toSchema); + + return $schemaDiff->toSql($platform); + } + + /** + * @deprecated + * + * @return string[] + * + * @throws SchemaException + */ + public function getMigrateFromSql(Schema $fromSchema, AbstractPlatform $platform) + { + $schemaDiff = (new Comparator())->compareSchemas($fromSchema, $this); + + return $schemaDiff->toSql($platform); + } + + /** + * @deprecated + * + * @return void + */ + public function visit(Visitor $visitor) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5435', + 'Schema::visit() is deprecated.', + ); + + $visitor->acceptSchema($this); + + if ($visitor instanceof NamespaceVisitor) { + foreach ($this->namespaces as $namespace) { + $visitor->acceptNamespace($namespace); + } + } + + foreach ($this->_tables as $table) { + $table->visit($visitor); + } + + foreach ($this->_sequences as $sequence) { + $sequence->visit($visitor); + } + } + + /** + * Cloning a Schema triggers a deep clone of all related assets. + * + * @return void + */ + public function __clone() + { + foreach ($this->_tables as $k => $table) { + $this->_tables[$k] = clone $table; + } + + foreach ($this->_sequences as $k => $sequence) { + $this->_sequences[$k] = clone $sequence; + } + } +} diff --git a/vendor/doctrine/dbal/src/Schema/SchemaConfig.php b/vendor/doctrine/dbal/src/Schema/SchemaConfig.php new file mode 100644 index 00000000..5e394514 --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/SchemaConfig.php @@ -0,0 +1,120 @@ +hasExplicitForeignKeyIndexes; + } + + /** + * @deprecated + * + * @param bool $flag + * + * @return void + */ + public function setExplicitForeignKeyIndexes($flag) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4822', + 'SchemaConfig::setExplicitForeignKeyIndexes() is deprecated.', + ); + + $this->hasExplicitForeignKeyIndexes = (bool) $flag; + } + + /** + * @param int $length + * + * @return void + */ + public function setMaxIdentifierLength($length) + { + $this->maxIdentifierLength = (int) $length; + } + + /** @return int */ + public function getMaxIdentifierLength() + { + return $this->maxIdentifierLength; + } + + /** + * Gets the default namespace of schema objects. + * + * @return string|null + */ + public function getName() + { + return $this->name; + } + + /** + * Sets the default namespace name of schema objects. + * + * @param string $name The value to set. + * + * @return void + */ + public function setName($name) + { + $this->name = $name; + } + + /** + * Gets the default options that are passed to Table instances created with + * Schema#createTable(). + * + * @return mixed[] + */ + public function getDefaultTableOptions() + { + return $this->defaultTableOptions; + } + + /** + * @param mixed[] $defaultTableOptions + * + * @return void + */ + public function setDefaultTableOptions(array $defaultTableOptions) + { + $this->defaultTableOptions = $defaultTableOptions; + } +} diff --git a/vendor/doctrine/dbal/src/Schema/SchemaDiff.php b/vendor/doctrine/dbal/src/Schema/SchemaDiff.php new file mode 100644 index 00000000..a6a86657 --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/SchemaDiff.php @@ -0,0 +1,294 @@ + $createdSchemas + * @param array $droppedSchemas + * @param array $createdSequences + * @param array $alteredSequences + * @param array $droppedSequences + */ + public function __construct( + $newTables = [], + $changedTables = [], + $removedTables = [], + ?Schema $fromSchema = null, + $createdSchemas = [], + $droppedSchemas = [], + $createdSequences = [], + $alteredSequences = [], + $droppedSequences = [] + ) { + $this->newTables = $newTables; + + $this->changedTables = array_filter($changedTables, static function (TableDiff $diff): bool { + return ! $diff->isEmpty(); + }); + + $this->removedTables = $removedTables; + $this->fromSchema = $fromSchema; + $this->newNamespaces = $createdSchemas; + $this->removedNamespaces = $droppedSchemas; + $this->newSequences = $createdSequences; + $this->changedSequences = $alteredSequences; + $this->removedSequences = $droppedSequences; + } + + /** @return array */ + public function getCreatedSchemas(): array + { + return $this->newNamespaces; + } + + /** @return array */ + public function getDroppedSchemas(): array + { + return $this->removedNamespaces; + } + + /** @return array
*/ + public function getCreatedTables(): array + { + return $this->newTables; + } + + /** @return array */ + public function getAlteredTables(): array + { + return $this->changedTables; + } + + /** @return array
*/ + public function getDroppedTables(): array + { + return $this->removedTables; + } + + /** @return array */ + public function getCreatedSequences(): array + { + return $this->newSequences; + } + + /** @return array */ + public function getAlteredSequences(): array + { + return $this->changedSequences; + } + + /** @return array */ + public function getDroppedSequences(): array + { + return $this->removedSequences; + } + + /** + * Returns whether the diff is empty (contains no changes). + */ + public function isEmpty(): bool + { + return count($this->newNamespaces) === 0 + && count($this->removedNamespaces) === 0 + && count($this->newTables) === 0 + && count($this->changedTables) === 0 + && count($this->removedTables) === 0 + && count($this->newSequences) === 0 + && count($this->changedSequences) === 0 + && count($this->removedSequences) === 0; + } + + /** + * The to save sql mode ensures that the following things don't happen: + * + * 1. Tables are deleted + * 2. Sequences are deleted + * 3. Foreign Keys which reference tables that would otherwise be deleted. + * + * This way it is ensured that assets are deleted which might not be relevant to the metadata schema at all. + * + * @deprecated + * + * @return list + */ + public function toSaveSql(AbstractPlatform $platform) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5766', + '%s is deprecated.', + __METHOD__, + ); + + return $this->_toSql($platform, true); + } + + /** + * @deprecated Use {@link AbstractPlatform::getAlterSchemaSQL()} instead. + * + * @return list + */ + public function toSql(AbstractPlatform $platform) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5766', + '%s is deprecated. Use AbstractPlatform::getAlterSchemaSQL() instead.', + __METHOD__, + ); + + return $this->_toSql($platform, false); + } + + /** + * @param bool $saveMode + * + * @return list + */ + protected function _toSql(AbstractPlatform $platform, $saveMode = false) + { + $sql = []; + + if ($platform->supportsSchemas()) { + foreach ($this->getCreatedSchemas() as $schema) { + $sql[] = $platform->getCreateSchemaSQL($schema); + } + } + + if ($platform->supportsForeignKeyConstraints() && $saveMode === false) { + foreach ($this->orphanedForeignKeys as $orphanedForeignKey) { + $sql[] = $platform->getDropForeignKeySQL($orphanedForeignKey, $orphanedForeignKey->getLocalTable()); + } + } + + if ($platform->supportsSequences() === true) { + foreach ($this->getAlteredSequences() as $sequence) { + $sql[] = $platform->getAlterSequenceSQL($sequence); + } + + if ($saveMode === false) { + foreach ($this->getDroppedSequences() as $sequence) { + $sql[] = $platform->getDropSequenceSQL($sequence); + } + } + + foreach ($this->getCreatedSequences() as $sequence) { + $sql[] = $platform->getCreateSequenceSQL($sequence); + } + } + + $sql = array_merge($sql, $platform->getCreateTablesSQL($this->getCreatedTables())); + + if ($saveMode === false) { + $sql = array_merge($sql, $platform->getDropTablesSQL($this->getDroppedTables())); + } + + foreach ($this->getAlteredTables() as $tableDiff) { + $sql = array_merge($sql, $platform->getAlterTableSQL($tableDiff)); + } + + return $sql; + } +} diff --git a/vendor/doctrine/dbal/src/Schema/SchemaException.php b/vendor/doctrine/dbal/src/Schema/SchemaException.php new file mode 100644 index 00000000..4ec091f8 --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/SchemaException.php @@ -0,0 +1,204 @@ +_setName($name); + $this->setAllocationSize($allocationSize); + $this->setInitialValue($initialValue); + $this->cache = $cache; + } + + /** @return int */ + public function getAllocationSize() + { + return $this->allocationSize; + } + + /** @return int */ + public function getInitialValue() + { + return $this->initialValue; + } + + /** @return int|null */ + public function getCache() + { + return $this->cache; + } + + /** + * @param int $allocationSize + * + * @return Sequence + */ + public function setAllocationSize($allocationSize) + { + if ($allocationSize > 0) { + $this->allocationSize = $allocationSize; + } else { + $this->allocationSize = 1; + } + + return $this; + } + + /** + * @param int $initialValue + * + * @return Sequence + */ + public function setInitialValue($initialValue) + { + if ($initialValue > 0) { + $this->initialValue = $initialValue; + } else { + $this->initialValue = 1; + } + + return $this; + } + + /** + * @param int $cache + * + * @return Sequence + */ + public function setCache($cache) + { + $this->cache = $cache; + + return $this; + } + + /** + * Checks if this sequence is an autoincrement sequence for a given table. + * + * This is used inside the comparator to not report sequences as missing, + * when the "from" schema implicitly creates the sequences. + * + * @return bool + */ + public function isAutoIncrementsFor(Table $table) + { + $primaryKey = $table->getPrimaryKey(); + + if ($primaryKey === null) { + return false; + } + + $pkColumns = $primaryKey->getColumns(); + + if (count($pkColumns) !== 1) { + return false; + } + + $column = $table->getColumn($pkColumns[0]); + + if (! $column->getAutoincrement()) { + return false; + } + + $sequenceName = $this->getShortestName($table->getNamespaceName()); + $tableName = $table->getShortestName($table->getNamespaceName()); + $tableSequenceName = sprintf('%s_%s_seq', $tableName, $column->getShortestName($table->getNamespaceName())); + + return $tableSequenceName === $sequenceName; + } + + /** + * @deprecated + * + * @return void + */ + public function visit(Visitor $visitor) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5435', + 'Sequence::visit() is deprecated.', + ); + + $visitor->acceptSequence($this); + } +} diff --git a/vendor/doctrine/dbal/src/Schema/SqliteSchemaManager.php b/vendor/doctrine/dbal/src/Schema/SqliteSchemaManager.php new file mode 100644 index 00000000..c240ce21 --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/SqliteSchemaManager.php @@ -0,0 +1,781 @@ + + */ +class SqliteSchemaManager extends AbstractSchemaManager +{ + /** + * {@inheritDoc} + */ + public function listTableNames() + { + return $this->doListTableNames(); + } + + /** + * {@inheritDoc} + */ + public function listTables() + { + return $this->doListTables(); + } + + /** + * {@inheritDoc} + * + * @deprecated Use {@see introspectTable()} instead. + */ + public function listTableDetails($name) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5595', + '%s is deprecated. Use introspectTable() instead.', + __METHOD__, + ); + + return $this->doListTableDetails($name); + } + + /** + * {@inheritDoc} + */ + public function listTableColumns($table, $database = null) + { + return $this->doListTableColumns($table, $database); + } + + /** + * {@inheritDoc} + */ + public function listTableIndexes($table) + { + return $this->doListTableIndexes($table); + } + + /** + * {@inheritDoc} + */ + protected function fetchForeignKeyColumnsByTable(string $databaseName): array + { + $columnsByTable = parent::fetchForeignKeyColumnsByTable($databaseName); + + if (count($columnsByTable) > 0) { + foreach ($columnsByTable as $table => $columns) { + $columnsByTable[$table] = $this->addDetailsToTableForeignKeyColumns($table, $columns); + } + } + + return $columnsByTable; + } + + /** + * {@inheritdoc} + * + * @deprecated Delete the database file using the filesystem. + */ + public function dropDatabase($database) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4963', + 'SqliteSchemaManager::dropDatabase() is deprecated. Delete the database file using the filesystem.', + ); + + if (! file_exists($database)) { + return; + } + + unlink($database); + } + + /** + * {@inheritdoc} + * + * @deprecated The engine will create the database file automatically. + */ + public function createDatabase($database) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4963', + 'SqliteSchemaManager::createDatabase() is deprecated.' + . ' The engine will create the database file automatically.', + ); + + $params = $this->_conn->getParams(); + + $params['path'] = $database; + unset($params['memory']); + + $conn = DriverManager::getConnection($params); + $conn->connect(); + $conn->close(); + } + + /** + * {@inheritdoc} + */ + public function createForeignKey(ForeignKeyConstraint $foreignKey, $table) + { + if (! $table instanceof Table) { + $table = $this->listTableDetails($table); + } + + $this->alterTable(new TableDiff($table->getName(), [], [], [], [], [], [], $table, [$foreignKey])); + } + + /** + * {@inheritdoc} + * + * @deprecated Use {@see dropForeignKey()} and {@see createForeignKey()} instead. + */ + public function dropAndCreateForeignKey(ForeignKeyConstraint $foreignKey, $table) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4897', + 'SqliteSchemaManager::dropAndCreateForeignKey() is deprecated.' + . ' Use SqliteSchemaManager::dropForeignKey() and SqliteSchemaManager::createForeignKey() instead.', + ); + + if (! $table instanceof Table) { + $table = $this->listTableDetails($table); + } + + $this->alterTable(new TableDiff($table->getName(), [], [], [], [], [], [], $table, [], [$foreignKey])); + } + + /** + * {@inheritdoc} + */ + public function dropForeignKey($foreignKey, $table) + { + if (! $table instanceof Table) { + $table = $this->listTableDetails($table); + } + + $this->alterTable(new TableDiff($table->getName(), [], [], [], [], [], [], $table, [], [], [$foreignKey])); + } + + /** + * {@inheritdoc} + */ + public function listTableForeignKeys($table, $database = null) + { + $table = $this->normalizeName($table); + + $columns = $this->selectForeignKeyColumns('', $table) + ->fetchAllAssociative(); + + if (count($columns) > 0) { + $columns = $this->addDetailsToTableForeignKeyColumns($table, $columns); + } + + return $this->_getPortableTableForeignKeysList($columns); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableDefinition($table) + { + return $table['table_name']; + } + + /** + * {@inheritdoc} + * + * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaPgsqlReader.html + */ + protected function _getPortableTableIndexesList($tableIndexes, $tableName = null) + { + $indexBuffer = []; + + // fetch primary + $indexArray = $this->_conn->fetchAllAssociative('SELECT * FROM PRAGMA_TABLE_INFO (?)', [$tableName]); + + usort( + $indexArray, + /** + * @param array $a + * @param array $b + */ + static function (array $a, array $b): int { + if ($a['pk'] === $b['pk']) { + return $a['cid'] - $b['cid']; + } + + return $a['pk'] - $b['pk']; + }, + ); + + foreach ($indexArray as $indexColumnRow) { + if ($indexColumnRow['pk'] === 0 || $indexColumnRow['pk'] === '0') { + continue; + } + + $indexBuffer[] = [ + 'key_name' => 'primary', + 'primary' => true, + 'non_unique' => false, + 'column_name' => $indexColumnRow['name'], + ]; + } + + // fetch regular indexes + foreach ($tableIndexes as $tableIndex) { + // Ignore indexes with reserved names, e.g. autoindexes + if (strpos($tableIndex['name'], 'sqlite_') === 0) { + continue; + } + + $keyName = $tableIndex['name']; + $idx = []; + $idx['key_name'] = $keyName; + $idx['primary'] = false; + $idx['non_unique'] = ! $tableIndex['unique']; + + $indexArray = $this->_conn->fetchAllAssociative('SELECT * FROM PRAGMA_INDEX_INFO (?)', [$keyName]); + + foreach ($indexArray as $indexColumnRow) { + $idx['column_name'] = $indexColumnRow['name']; + $indexBuffer[] = $idx; + } + } + + return parent::_getPortableTableIndexesList($indexBuffer, $tableName); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableColumnList($table, $database, $tableColumns) + { + $list = parent::_getPortableTableColumnList($table, $database, $tableColumns); + + // find column with autoincrement + $autoincrementColumn = null; + $autoincrementCount = 0; + + foreach ($tableColumns as $tableColumn) { + if ($tableColumn['pk'] === 0 || $tableColumn['pk'] === '0') { + continue; + } + + $autoincrementCount++; + if ($autoincrementColumn !== null || strtolower($tableColumn['type']) !== 'integer') { + continue; + } + + $autoincrementColumn = $tableColumn['name']; + } + + if ($autoincrementCount === 1 && $autoincrementColumn !== null) { + foreach ($list as $column) { + if ($autoincrementColumn !== $column->getName()) { + continue; + } + + $column->setAutoincrement(true); + } + } + + // inspect column collation and comments + $createSql = $this->getCreateTableSQL($table); + + foreach ($list as $columnName => $column) { + $type = $column->getType(); + + if ($type instanceof StringType || $type instanceof TextType) { + $column->setPlatformOption( + 'collation', + $this->parseColumnCollationFromSQL($columnName, $createSql) ?? 'BINARY', + ); + } + + $comment = $this->parseColumnCommentFromSQL($columnName, $createSql); + + if ($comment === null) { + continue; + } + + $type = $this->extractDoctrineTypeFromComment($comment, ''); + + if ($type !== '') { + $column->setType(Type::getType($type)); + + $comment = $this->removeDoctrineTypeFromComment($comment, $type); + } + + $column->setComment($comment); + } + + return $list; + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableColumnDefinition($tableColumn) + { + $parts = explode('(', $tableColumn['type']); + $tableColumn['type'] = trim($parts[0]); + if (isset($parts[1])) { + $length = trim($parts[1], ')'); + $tableColumn['length'] = $length; + } + + $dbType = strtolower($tableColumn['type']); + $length = $tableColumn['length'] ?? null; + $unsigned = false; + + if (strpos($dbType, ' unsigned') !== false) { + $dbType = str_replace(' unsigned', '', $dbType); + $unsigned = true; + } + + $fixed = false; + $type = $this->_platform->getDoctrineTypeMapping($dbType); + $default = $tableColumn['dflt_value']; + if ($default === 'NULL') { + $default = null; + } + + if ($default !== null) { + // SQLite returns the default value as a literal expression, so we need to parse it + if (preg_match('/^\'(.*)\'$/s', $default, $matches) === 1) { + $default = str_replace("''", "'", $matches[1]); + } + } + + $notnull = (bool) $tableColumn['notnull']; + + if (! isset($tableColumn['name'])) { + $tableColumn['name'] = ''; + } + + $precision = null; + $scale = null; + + switch ($dbType) { + case 'char': + $fixed = true; + break; + case 'float': + case 'double': + case 'real': + case 'decimal': + case 'numeric': + if (isset($tableColumn['length'])) { + if (strpos($tableColumn['length'], ',') === false) { + $tableColumn['length'] .= ',0'; + } + + [$precision, $scale] = array_map('trim', explode(',', $tableColumn['length'])); + } + + $length = null; + break; + } + + $options = [ + 'length' => $length, + 'unsigned' => $unsigned, + 'fixed' => $fixed, + 'notnull' => $notnull, + 'default' => $default, + 'precision' => $precision, + 'scale' => $scale, + 'autoincrement' => false, + ]; + + return new Column($tableColumn['name'], Type::getType($type), $options); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableViewDefinition($view) + { + return new View($view['name'], $view['sql']); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableForeignKeysList($tableForeignKeys) + { + $list = []; + foreach ($tableForeignKeys as $value) { + $value = array_change_key_case($value, CASE_LOWER); + $id = $value['id']; + if (! isset($list[$id])) { + if (! isset($value['on_delete']) || $value['on_delete'] === 'RESTRICT') { + $value['on_delete'] = null; + } + + if (! isset($value['on_update']) || $value['on_update'] === 'RESTRICT') { + $value['on_update'] = null; + } + + $list[$id] = [ + 'name' => $value['constraint_name'], + 'local' => [], + 'foreign' => [], + 'foreignTable' => $value['table'], + 'onDelete' => $value['on_delete'], + 'onUpdate' => $value['on_update'], + 'deferrable' => $value['deferrable'], + 'deferred' => $value['deferred'], + ]; + } + + $list[$id]['local'][] = $value['from']; + + if ($value['to'] === null) { + continue; + } + + $list[$id]['foreign'][] = $value['to']; + } + + return parent::_getPortableTableForeignKeysList($list); + } + + /** + * {@inheritDoc} + */ + protected function _getPortableTableForeignKeyDefinition($tableForeignKey): ForeignKeyConstraint + { + return new ForeignKeyConstraint( + $tableForeignKey['local'], + $tableForeignKey['foreignTable'], + $tableForeignKey['foreign'], + $tableForeignKey['name'], + [ + 'onDelete' => $tableForeignKey['onDelete'], + 'onUpdate' => $tableForeignKey['onUpdate'], + 'deferrable' => $tableForeignKey['deferrable'], + 'deferred' => $tableForeignKey['deferred'], + ], + ); + } + + private function parseColumnCollationFromSQL(string $column, string $sql): ?string + { + $pattern = '{(?:\W' . preg_quote($column) . '\W|\W' + . preg_quote($this->_platform->quoteSingleIdentifier($column)) + . '\W)[^,(]+(?:\([^()]+\)[^,]*)?(?:(?:DEFAULT|CHECK)\s*(?:\(.*?\))?[^,]*)*COLLATE\s+["\']?([^\s,"\')]+)}is'; + + if (preg_match($pattern, $sql, $match) !== 1) { + return null; + } + + return $match[1]; + } + + private function parseTableCommentFromSQL(string $table, string $sql): ?string + { + $pattern = '/\s* # Allow whitespace characters at start of line +CREATE\sTABLE # Match "CREATE TABLE" +(?:\W"' . preg_quote($this->_platform->quoteSingleIdentifier($table), '/') . '"\W|\W' . preg_quote($table, '/') + . '\W) # Match table name (quoted and unquoted) +( # Start capture + (?:\s*--[^\n]*\n?)+ # Capture anything that starts with whitespaces followed by -- until the end of the line(s) +)/ix'; + + if (preg_match($pattern, $sql, $match) !== 1) { + return null; + } + + $comment = preg_replace('{^\s*--}m', '', rtrim($match[1], "\n")); + + return $comment === '' ? null : $comment; + } + + private function parseColumnCommentFromSQL(string $column, string $sql): ?string + { + $pattern = '{[\s(,](?:\W' . preg_quote($this->_platform->quoteSingleIdentifier($column)) + . '\W|\W' . preg_quote($column) . '\W)(?:\([^)]*?\)|[^,(])*?,?((?:(?!\n))(?:\s*--[^\n]*\n?)+)}i'; + + if (preg_match($pattern, $sql, $match) !== 1) { + return null; + } + + $comment = preg_replace('{^\s*--}m', '', rtrim($match[1], "\n")); + + return $comment === '' ? null : $comment; + } + + /** @throws Exception */ + private function getCreateTableSQL(string $table): string + { + $sql = $this->_conn->fetchOne( + <<<'SQL' +SELECT sql + FROM ( + SELECT * + FROM sqlite_master + UNION ALL + SELECT * + FROM sqlite_temp_master + ) +WHERE type = 'table' +AND name = ? +SQL + , + [$table], + ); + + if ($sql !== false) { + return $sql; + } + + return ''; + } + + /** + * @param list> $columns + * + * @return list> + * + * @throws Exception + */ + private function addDetailsToTableForeignKeyColumns(string $table, array $columns): array + { + $foreignKeyDetails = $this->getForeignKeyDetails($table); + $foreignKeyCount = count($foreignKeyDetails); + + foreach ($columns as $i => $column) { + // SQLite identifies foreign keys in reverse order of appearance in SQL + $columns[$i] = array_merge($column, $foreignKeyDetails[$foreignKeyCount - $column['id'] - 1]); + } + + return $columns; + } + + /** + * @param string $table + * + * @return list> + * + * @throws Exception + */ + private function getForeignKeyDetails($table) + { + $createSql = $this->getCreateTableSQL($table); + + if ( + preg_match_all( + '# + (?:CONSTRAINT\s+(\S+)\s+)? + (?:FOREIGN\s+KEY[^)]+\)\s*)? + REFERENCES\s+\S+\s*(?:\([^)]+\))? + (?: + [^,]*? + (NOT\s+DEFERRABLE|DEFERRABLE) + (?:\s+INITIALLY\s+(DEFERRED|IMMEDIATE))? + )?#isx', + $createSql, + $match, + ) === 0 + ) { + return []; + } + + $names = $match[1]; + $deferrable = $match[2]; + $deferred = $match[3]; + $details = []; + + for ($i = 0, $count = count($match[0]); $i < $count; $i++) { + $details[] = [ + 'constraint_name' => isset($names[$i]) && $names[$i] !== '' ? $names[$i] : null, + 'deferrable' => isset($deferrable[$i]) && strcasecmp($deferrable[$i], 'deferrable') === 0, + 'deferred' => isset($deferred[$i]) && strcasecmp($deferred[$i], 'deferred') === 0, + ]; + } + + return $details; + } + + public function createComparator(): Comparator + { + return new SQLite\Comparator($this->_platform); + } + + /** + * {@inheritDoc} + * + * @deprecated + */ + public function getSchemaSearchPaths() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4821', + 'SqliteSchemaManager::getSchemaSearchPaths() is deprecated.', + ); + + // SQLite does not support schemas or databases + return []; + } + + protected function selectTableNames(string $databaseName): Result + { + $sql = <<<'SQL' +SELECT name AS table_name +FROM sqlite_master +WHERE type = 'table' + AND name != 'sqlite_sequence' + AND name != 'geometry_columns' + AND name != 'spatial_ref_sys' +UNION ALL +SELECT name +FROM sqlite_temp_master +WHERE type = 'table' +ORDER BY name +SQL; + + return $this->_conn->executeQuery($sql); + } + + protected function selectTableColumns(string $databaseName, ?string $tableName = null): Result + { + $sql = <<<'SQL' + SELECT t.name AS table_name, + c.* + FROM sqlite_master t + JOIN pragma_table_info(t.name) c +SQL; + + $conditions = [ + "t.type = 'table'", + "t.name NOT IN ('geometry_columns', 'spatial_ref_sys', 'sqlite_sequence')", + ]; + $params = []; + + if ($tableName !== null) { + $conditions[] = 't.name = ?'; + $params[] = str_replace('.', '__', $tableName); + } + + $sql .= ' WHERE ' . implode(' AND ', $conditions) . ' ORDER BY t.name, c.cid'; + + return $this->_conn->executeQuery($sql, $params); + } + + protected function selectIndexColumns(string $databaseName, ?string $tableName = null): Result + { + $sql = <<<'SQL' + SELECT t.name AS table_name, + i.* + FROM sqlite_master t + JOIN pragma_index_list(t.name) i +SQL; + + $conditions = [ + "t.type = 'table'", + "t.name NOT IN ('geometry_columns', 'spatial_ref_sys', 'sqlite_sequence')", + ]; + $params = []; + + if ($tableName !== null) { + $conditions[] = 't.name = ?'; + $params[] = str_replace('.', '__', $tableName); + } + + $sql .= ' WHERE ' . implode(' AND ', $conditions) . ' ORDER BY t.name, i.seq'; + + return $this->_conn->executeQuery($sql, $params); + } + + protected function selectForeignKeyColumns(string $databaseName, ?string $tableName = null): Result + { + $sql = <<<'SQL' + SELECT t.name AS table_name, + p.* + FROM sqlite_master t + JOIN pragma_foreign_key_list(t.name) p + ON p."seq" != "-1" +SQL; + + $conditions = [ + "t.type = 'table'", + "t.name NOT IN ('geometry_columns', 'spatial_ref_sys', 'sqlite_sequence')", + ]; + $params = []; + + if ($tableName !== null) { + $conditions[] = 't.name = ?'; + $params[] = str_replace('.', '__', $tableName); + } + + $sql .= ' WHERE ' . implode(' AND ', $conditions) . ' ORDER BY t.name, p.id DESC, p.seq'; + + return $this->_conn->executeQuery($sql, $params); + } + + /** + * {@inheritDoc} + */ + protected function fetchTableOptionsByTable(string $databaseName, ?string $tableName = null): array + { + if ($tableName === null) { + $tables = $this->listTableNames(); + } else { + $tables = [$tableName]; + } + + $tableOptions = []; + foreach ($tables as $table) { + $comment = $this->parseTableCommentFromSQL($table, $this->getCreateTableSQL($table)); + + if ($comment === null) { + continue; + } + + $tableOptions[$table]['comment'] = $comment; + } + + return $tableOptions; + } +} diff --git a/vendor/doctrine/dbal/src/Schema/Table.php b/vendor/doctrine/dbal/src/Schema/Table.php new file mode 100644 index 00000000..7fbd6091 --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/Table.php @@ -0,0 +1,1041 @@ + [], + ]; + + /** @var SchemaConfig|null */ + protected $_schemaConfig; + + /** @var Index[] */ + private array $implicitIndexes = []; + + /** + * @param Column[] $columns + * @param Index[] $indexes + * @param UniqueConstraint[] $uniqueConstraints + * @param ForeignKeyConstraint[] $fkConstraints + * @param mixed[] $options + * + * @throws SchemaException + * @throws Exception + */ + public function __construct( + string $name, + array $columns = [], + array $indexes = [], + array $uniqueConstraints = [], + array $fkConstraints = [], + array $options = [] + ) { + if ($name === '') { + throw InvalidTableName::new($name); + } + + $this->_setName($name); + + foreach ($columns as $column) { + $this->_addColumn($column); + } + + foreach ($indexes as $idx) { + $this->_addIndex($idx); + } + + foreach ($uniqueConstraints as $uniqueConstraint) { + $this->_addUniqueConstraint($uniqueConstraint); + } + + foreach ($fkConstraints as $constraint) { + $this->_addForeignKeyConstraint($constraint); + } + + $this->_options = array_merge($this->_options, $options); + } + + /** @return void */ + public function setSchemaConfig(SchemaConfig $schemaConfig) + { + $this->_schemaConfig = $schemaConfig; + } + + /** @return int */ + protected function _getMaxIdentifierLength() + { + if ($this->_schemaConfig instanceof SchemaConfig) { + return $this->_schemaConfig->getMaxIdentifierLength(); + } + + return 63; + } + + /** + * Sets the Primary Key. + * + * @param string[] $columnNames + * @param string|false $indexName + * + * @return self + * + * @throws SchemaException + */ + public function setPrimaryKey(array $columnNames, $indexName = false) + { + if ($indexName === false) { + $indexName = 'primary'; + } + + $this->_addIndex($this->_createIndex($columnNames, $indexName, true, true)); + + foreach ($columnNames as $columnName) { + $column = $this->getColumn($columnName); + $column->setNotnull(true); + } + + return $this; + } + + /** + * @param string[] $columnNames + * @param string[] $flags + * @param mixed[] $options + * + * @return self + * + * @throws SchemaException + */ + public function addIndex(array $columnNames, ?string $indexName = null, array $flags = [], array $options = []) + { + $indexName ??= $this->_generateIdentifierName( + array_merge([$this->getName()], $columnNames), + 'idx', + $this->_getMaxIdentifierLength(), + ); + + return $this->_addIndex($this->_createIndex($columnNames, $indexName, false, false, $flags, $options)); + } + + /** + * @param string[] $columnNames + * @param string[] $flags + * @param mixed[] $options + * + * @return self + */ + public function addUniqueConstraint( + array $columnNames, + ?string $indexName = null, + array $flags = [], + array $options = [] + ): Table { + $indexName ??= $this->_generateIdentifierName( + array_merge([$this->getName()], $columnNames), + 'uniq', + $this->_getMaxIdentifierLength(), + ); + + return $this->_addUniqueConstraint($this->_createUniqueConstraint($columnNames, $indexName, $flags, $options)); + } + + /** + * Drops the primary key from this table. + * + * @return void + * + * @throws SchemaException + */ + public function dropPrimaryKey() + { + if ($this->_primaryKeyName === null) { + return; + } + + $this->dropIndex($this->_primaryKeyName); + $this->_primaryKeyName = null; + } + + /** + * Drops an index from this table. + * + * @param string $name The index name. + * + * @return void + * + * @throws SchemaException If the index does not exist. + */ + public function dropIndex($name) + { + $name = $this->normalizeIdentifier($name); + + if (! $this->hasIndex($name)) { + throw SchemaException::indexDoesNotExist($name, $this->_name); + } + + unset($this->_indexes[$name]); + } + + /** + * @param string[] $columnNames + * @param string|null $indexName + * @param mixed[] $options + * + * @return self + * + * @throws SchemaException + */ + public function addUniqueIndex(array $columnNames, $indexName = null, array $options = []) + { + $indexName ??= $this->_generateIdentifierName( + array_merge([$this->getName()], $columnNames), + 'uniq', + $this->_getMaxIdentifierLength(), + ); + + return $this->_addIndex($this->_createIndex($columnNames, $indexName, true, false, [], $options)); + } + + /** + * Renames an index. + * + * @param string $oldName The name of the index to rename from. + * @param string|null $newName The name of the index to rename to. + * If null is given, the index name will be auto-generated. + * + * @return self This table instance. + * + * @throws SchemaException If no index exists for the given current name + * or if an index with the given new name already exists on this table. + */ + public function renameIndex($oldName, $newName = null) + { + $oldName = $this->normalizeIdentifier($oldName); + $normalizedNewName = $this->normalizeIdentifier($newName); + + if ($oldName === $normalizedNewName) { + return $this; + } + + if (! $this->hasIndex($oldName)) { + throw SchemaException::indexDoesNotExist($oldName, $this->_name); + } + + if ($this->hasIndex($normalizedNewName)) { + throw SchemaException::indexAlreadyExists($normalizedNewName, $this->_name); + } + + $oldIndex = $this->_indexes[$oldName]; + + if ($oldIndex->isPrimary()) { + $this->dropPrimaryKey(); + + return $this->setPrimaryKey($oldIndex->getColumns(), $newName ?? false); + } + + unset($this->_indexes[$oldName]); + + if ($oldIndex->isUnique()) { + return $this->addUniqueIndex($oldIndex->getColumns(), $newName, $oldIndex->getOptions()); + } + + return $this->addIndex($oldIndex->getColumns(), $newName, $oldIndex->getFlags(), $oldIndex->getOptions()); + } + + /** + * Checks if an index begins in the order of the given columns. + * + * @param string[] $columnNames + * + * @return bool + */ + public function columnsAreIndexed(array $columnNames) + { + foreach ($this->getIndexes() as $index) { + if ($index->spansColumns($columnNames)) { + return true; + } + } + + return false; + } + + /** + * @param string[] $columnNames + * @param string $indexName + * @param bool $isUnique + * @param bool $isPrimary + * @param string[] $flags + * @param mixed[] $options + * + * @throws SchemaException + */ + private function _createIndex( + array $columnNames, + $indexName, + $isUnique, + $isPrimary, + array $flags = [], + array $options = [] + ): Index { + if (preg_match('(([^a-zA-Z0-9_]+))', $this->normalizeIdentifier($indexName)) === 1) { + throw SchemaException::indexNameInvalid($indexName); + } + + foreach ($columnNames as $columnName) { + if (! $this->hasColumn($columnName)) { + throw SchemaException::columnDoesNotExist($columnName, $this->_name); + } + } + + return new Index($indexName, $columnNames, $isUnique, $isPrimary, $flags, $options); + } + + /** + * @param string $name + * @param string $typeName + * @param mixed[] $options + * + * @return Column + * + * @throws SchemaException + */ + public function addColumn($name, $typeName, array $options = []) + { + $column = new Column($name, Type::getType($typeName), $options); + + $this->_addColumn($column); + + return $column; + } + + /** + * Change Column Details. + * + * @deprecated Use {@link modifyColumn()} instead. + * + * @param string $name + * @param mixed[] $options + * + * @return self + * + * @throws SchemaException + */ + public function changeColumn($name, array $options) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5747', + '%s is deprecated. Use modifyColumn() instead.', + __METHOD__, + ); + + return $this->modifyColumn($name, $options); + } + + /** + * @param string $name + * @param mixed[] $options + * + * @return self + * + * @throws SchemaException + */ + public function modifyColumn($name, array $options) + { + $column = $this->getColumn($name); + $column->setOptions($options); + + return $this; + } + + /** + * Drops a Column from the Table. + * + * @param string $name + * + * @return self + */ + public function dropColumn($name) + { + $name = $this->normalizeIdentifier($name); + + unset($this->_columns[$name]); + + return $this; + } + + /** + * Adds a foreign key constraint. + * + * Name is inferred from the local columns. + * + * @param Table|string $foreignTable Table schema instance or table name + * @param string[] $localColumnNames + * @param string[] $foreignColumnNames + * @param mixed[] $options + * @param string|null $name + * + * @return self + * + * @throws SchemaException + */ + public function addForeignKeyConstraint( + $foreignTable, + array $localColumnNames, + array $foreignColumnNames, + array $options = [], + $name = null + ) { + $name ??= $this->_generateIdentifierName( + array_merge([$this->getName()], $localColumnNames), + 'fk', + $this->_getMaxIdentifierLength(), + ); + + if ($foreignTable instanceof Table) { + foreach ($foreignColumnNames as $columnName) { + if (! $foreignTable->hasColumn($columnName)) { + throw SchemaException::columnDoesNotExist($columnName, $foreignTable->getName()); + } + } + } + + foreach ($localColumnNames as $columnName) { + if (! $this->hasColumn($columnName)) { + throw SchemaException::columnDoesNotExist($columnName, $this->_name); + } + } + + $constraint = new ForeignKeyConstraint( + $localColumnNames, + $foreignTable, + $foreignColumnNames, + $name, + $options, + ); + + return $this->_addForeignKeyConstraint($constraint); + } + + /** + * @param string $name + * @param mixed $value + * + * @return self + */ + public function addOption($name, $value) + { + $this->_options[$name] = $value; + + return $this; + } + + /** + * @return void + * + * @throws SchemaException + */ + protected function _addColumn(Column $column) + { + $columnName = $column->getName(); + $columnName = $this->normalizeIdentifier($columnName); + + if (isset($this->_columns[$columnName])) { + throw SchemaException::columnAlreadyExists($this->getName(), $columnName); + } + + $this->_columns[$columnName] = $column; + } + + /** + * Adds an index to the table. + * + * @return self + * + * @throws SchemaException + */ + protected function _addIndex(Index $indexCandidate) + { + $indexName = $indexCandidate->getName(); + $indexName = $this->normalizeIdentifier($indexName); + $replacedImplicitIndexes = []; + + foreach ($this->implicitIndexes as $name => $implicitIndex) { + if (! $implicitIndex->isFulfilledBy($indexCandidate) || ! isset($this->_indexes[$name])) { + continue; + } + + $replacedImplicitIndexes[] = $name; + } + + if ( + (isset($this->_indexes[$indexName]) && ! in_array($indexName, $replacedImplicitIndexes, true)) || + ($this->_primaryKeyName !== null && $indexCandidate->isPrimary()) + ) { + throw SchemaException::indexAlreadyExists($indexName, $this->_name); + } + + foreach ($replacedImplicitIndexes as $name) { + unset($this->_indexes[$name], $this->implicitIndexes[$name]); + } + + if ($indexCandidate->isPrimary()) { + $this->_primaryKeyName = $indexName; + } + + $this->_indexes[$indexName] = $indexCandidate; + + return $this; + } + + /** @return self */ + protected function _addUniqueConstraint(UniqueConstraint $constraint): Table + { + $mergedNames = array_merge([$this->getName()], $constraint->getColumns()); + $name = strlen($constraint->getName()) > 0 + ? $constraint->getName() + : $this->_generateIdentifierName($mergedNames, 'fk', $this->_getMaxIdentifierLength()); + + $name = $this->normalizeIdentifier($name); + + $this->uniqueConstraints[$name] = $constraint; + + // If there is already an index that fulfills this requirements drop the request. In the case of __construct + // calling this method during hydration from schema-details all the explicitly added indexes lead to duplicates. + // This creates computation overhead in this case, however no duplicate indexes are ever added (column based). + $indexName = $this->_generateIdentifierName($mergedNames, 'idx', $this->_getMaxIdentifierLength()); + + $indexCandidate = $this->_createIndex($constraint->getColumns(), $indexName, true, false); + + foreach ($this->_indexes as $existingIndex) { + if ($indexCandidate->isFulfilledBy($existingIndex)) { + return $this; + } + } + + $this->implicitIndexes[$this->normalizeIdentifier($indexName)] = $indexCandidate; + + return $this; + } + + /** @return self */ + protected function _addForeignKeyConstraint(ForeignKeyConstraint $constraint) + { + $constraint->setLocalTable($this); + + if (strlen($constraint->getName()) > 0) { + $name = $constraint->getName(); + } else { + $name = $this->_generateIdentifierName( + array_merge([$this->getName()], $constraint->getLocalColumns()), + 'fk', + $this->_getMaxIdentifierLength(), + ); + } + + $name = $this->normalizeIdentifier($name); + + $this->_fkConstraints[$name] = $constraint; + + /* Add an implicit index (defined by the DBAL) on the foreign key + columns. If there is already a user-defined index that fulfills these + requirements drop the request. In the case of __construct() calling + this method during hydration from schema-details, all the explicitly + added indexes lead to duplicates. This creates computation overhead in + this case, however no duplicate indexes are ever added (based on + columns). */ + $indexName = $this->_generateIdentifierName( + array_merge([$this->getName()], $constraint->getColumns()), + 'idx', + $this->_getMaxIdentifierLength(), + ); + + $indexCandidate = $this->_createIndex($constraint->getColumns(), $indexName, false, false); + + foreach ($this->_indexes as $existingIndex) { + if ($indexCandidate->isFulfilledBy($existingIndex)) { + return $this; + } + } + + $this->_addIndex($indexCandidate); + $this->implicitIndexes[$this->normalizeIdentifier($indexName)] = $indexCandidate; + + return $this; + } + + /** + * Returns whether this table has a foreign key constraint with the given name. + * + * @param string $name + * + * @return bool + */ + public function hasForeignKey($name) + { + $name = $this->normalizeIdentifier($name); + + return isset($this->_fkConstraints[$name]); + } + + /** + * Returns the foreign key constraint with the given name. + * + * @param string $name The constraint name. + * + * @return ForeignKeyConstraint + * + * @throws SchemaException If the foreign key does not exist. + */ + public function getForeignKey($name) + { + $name = $this->normalizeIdentifier($name); + + if (! $this->hasForeignKey($name)) { + throw SchemaException::foreignKeyDoesNotExist($name, $this->_name); + } + + return $this->_fkConstraints[$name]; + } + + /** + * Removes the foreign key constraint with the given name. + * + * @param string $name The constraint name. + * + * @return void + * + * @throws SchemaException + */ + public function removeForeignKey($name) + { + $name = $this->normalizeIdentifier($name); + + if (! $this->hasForeignKey($name)) { + throw SchemaException::foreignKeyDoesNotExist($name, $this->_name); + } + + unset($this->_fkConstraints[$name]); + } + + /** + * Returns whether this table has a unique constraint with the given name. + */ + public function hasUniqueConstraint(string $name): bool + { + $name = $this->normalizeIdentifier($name); + + return isset($this->uniqueConstraints[$name]); + } + + /** + * Returns the unique constraint with the given name. + * + * @throws SchemaException If the unique constraint does not exist. + */ + public function getUniqueConstraint(string $name): UniqueConstraint + { + $name = $this->normalizeIdentifier($name); + + if (! $this->hasUniqueConstraint($name)) { + throw SchemaException::uniqueConstraintDoesNotExist($name, $this->_name); + } + + return $this->uniqueConstraints[$name]; + } + + /** + * Removes the unique constraint with the given name. + * + * @throws SchemaException If the unique constraint does not exist. + */ + public function removeUniqueConstraint(string $name): void + { + $name = $this->normalizeIdentifier($name); + + if (! $this->hasUniqueConstraint($name)) { + throw SchemaException::uniqueConstraintDoesNotExist($name, $this->_name); + } + + unset($this->uniqueConstraints[$name]); + } + + /** + * Returns ordered list of columns (primary keys are first, then foreign keys, then the rest) + * + * @return Column[] + */ + public function getColumns() + { + $primaryKeyColumns = $this->getPrimaryKey() !== null ? $this->getPrimaryKeyColumns() : []; + $foreignKeyColumns = $this->getForeignKeyColumns(); + $remainderColumns = $this->filterColumns( + array_merge(array_keys($primaryKeyColumns), array_keys($foreignKeyColumns)), + true, + ); + + return array_merge($primaryKeyColumns, $foreignKeyColumns, $remainderColumns); + } + + /** + * Returns the foreign key columns + * + * @deprecated Use {@see getForeignKey()} and {@see ForeignKeyConstraint::getLocalColumns()} instead. + * + * @return Column[] + */ + public function getForeignKeyColumns() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5731', + '%s is deprecated. Use getForeignKey() and ForeignKeyConstraint::getLocalColumns() instead.', + __METHOD__, + ); + + $foreignKeyColumns = []; + + foreach ($this->getForeignKeys() as $foreignKey) { + $foreignKeyColumns = array_merge($foreignKeyColumns, $foreignKey->getLocalColumns()); + } + + return $this->filterColumns($foreignKeyColumns); + } + + /** + * Returns only columns that have specified names + * + * @param string[] $columnNames + * + * @return Column[] + */ + private function filterColumns(array $columnNames, bool $reverse = false): array + { + return array_filter($this->_columns, static function (string $columnName) use ($columnNames, $reverse): bool { + return in_array($columnName, $columnNames, true) !== $reverse; + }, ARRAY_FILTER_USE_KEY); + } + + /** + * Returns whether this table has a Column with the given name. + * + * @param string $name The column name. + * + * @return bool + */ + public function hasColumn($name) + { + $name = $this->normalizeIdentifier($name); + + return isset($this->_columns[$name]); + } + + /** + * Returns the Column with the given name. + * + * @param string $name The column name. + * + * @return Column + * + * @throws SchemaException If the column does not exist. + */ + public function getColumn($name) + { + $name = $this->normalizeIdentifier($name); + + if (! $this->hasColumn($name)) { + throw SchemaException::columnDoesNotExist($name, $this->_name); + } + + return $this->_columns[$name]; + } + + /** + * Returns the primary key. + * + * @return Index|null The primary key, or null if this Table has no primary key. + */ + public function getPrimaryKey() + { + if ($this->_primaryKeyName !== null) { + return $this->getIndex($this->_primaryKeyName); + } + + return null; + } + + /** + * Returns the primary key columns. + * + * @deprecated Use {@see getPrimaryKey()} and {@see Index::getColumns()} instead. + * + * @return Column[] + * + * @throws Exception + */ + public function getPrimaryKeyColumns() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5731', + '%s is deprecated. Use getPrimaryKey() and Index::getColumns() instead.', + __METHOD__, + ); + + $primaryKey = $this->getPrimaryKey(); + + if ($primaryKey === null) { + throw new Exception('Table ' . $this->getName() . ' has no primary key.'); + } + + return $this->filterColumns($primaryKey->getColumns()); + } + + /** + * Returns whether this table has a primary key. + * + * @deprecated Use {@see getPrimaryKey()} instead. + * + * @return bool + */ + public function hasPrimaryKey() + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5731', + '%s is deprecated. Use getPrimaryKey() instead.', + __METHOD__, + ); + + return $this->_primaryKeyName !== null && $this->hasIndex($this->_primaryKeyName); + } + + /** + * Returns whether this table has an Index with the given name. + * + * @param string $name The index name. + * + * @return bool + */ + public function hasIndex($name) + { + $name = $this->normalizeIdentifier($name); + + return isset($this->_indexes[$name]); + } + + /** + * Returns the Index with the given name. + * + * @param string $name The index name. + * + * @return Index + * + * @throws SchemaException If the index does not exist. + */ + public function getIndex($name) + { + $name = $this->normalizeIdentifier($name); + if (! $this->hasIndex($name)) { + throw SchemaException::indexDoesNotExist($name, $this->_name); + } + + return $this->_indexes[$name]; + } + + /** @return Index[] */ + public function getIndexes() + { + return $this->_indexes; + } + + /** + * Returns the unique constraints. + * + * @return UniqueConstraint[] + */ + public function getUniqueConstraints(): array + { + return $this->uniqueConstraints; + } + + /** + * Returns the foreign key constraints. + * + * @return ForeignKeyConstraint[] + */ + public function getForeignKeys() + { + return $this->_fkConstraints; + } + + /** + * @param string $name + * + * @return bool + */ + public function hasOption($name) + { + return isset($this->_options[$name]); + } + + /** + * @param string $name + * + * @return mixed + */ + public function getOption($name) + { + return $this->_options[$name]; + } + + /** @return mixed[] */ + public function getOptions() + { + return $this->_options; + } + + /** + * @deprecated + * + * @return void + * + * @throws SchemaException + */ + public function visit(Visitor $visitor) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5435', + 'Table::visit() is deprecated.', + ); + + $visitor->acceptTable($this); + + foreach ($this->getColumns() as $column) { + $visitor->acceptColumn($this, $column); + } + + foreach ($this->getIndexes() as $index) { + $visitor->acceptIndex($this, $index); + } + + foreach ($this->getForeignKeys() as $constraint) { + $visitor->acceptForeignKey($this, $constraint); + } + } + + /** + * Clone of a Table triggers a deep clone of all affected assets. + * + * @return void + */ + public function __clone() + { + foreach ($this->_columns as $k => $column) { + $this->_columns[$k] = clone $column; + } + + foreach ($this->_indexes as $k => $index) { + $this->_indexes[$k] = clone $index; + } + + foreach ($this->_fkConstraints as $k => $fk) { + $this->_fkConstraints[$k] = clone $fk; + $this->_fkConstraints[$k]->setLocalTable($this); + } + } + + /** + * @param string[] $columnNames + * @param string[] $flags + * @param mixed[] $options + * + * @throws SchemaException + */ + private function _createUniqueConstraint( + array $columnNames, + string $indexName, + array $flags = [], + array $options = [] + ): UniqueConstraint { + if (preg_match('(([^a-zA-Z0-9_]+))', $this->normalizeIdentifier($indexName)) === 1) { + throw SchemaException::indexNameInvalid($indexName); + } + + foreach ($columnNames as $columnName) { + if (! $this->hasColumn($columnName)) { + throw SchemaException::columnDoesNotExist($columnName, $this->_name); + } + } + + return new UniqueConstraint($indexName, $columnNames, $flags, $options); + } + + /** + * Normalizes a given identifier. + * + * Trims quotes and lowercases the given identifier. + * + * @return string The normalized identifier. + */ + private function normalizeIdentifier(?string $identifier): string + { + if ($identifier === null) { + return ''; + } + + return $this->trimQuotes(strtolower($identifier)); + } + + public function setComment(?string $comment): self + { + // For keeping backward compatibility with MySQL in previous releases, table comments are stored as options. + $this->addOption('comment', $comment); + + return $this; + } + + public function getComment(): ?string + { + return $this->_options['comment'] ?? null; + } +} diff --git a/vendor/doctrine/dbal/src/Schema/TableDiff.php b/vendor/doctrine/dbal/src/Schema/TableDiff.php new file mode 100644 index 00000000..58128d75 --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/TableDiff.php @@ -0,0 +1,361 @@ + $addedColumns + * @param array $modifiedColumns + * @param array $droppedColumns + * @param array $addedIndexes + * @param array $changedIndexes + * @param array $removedIndexes + * @param list $addedForeignKeys + * @param list $changedForeignKeys + * @param list $removedForeignKeys + * @param array $renamedColumns + * @param array $renamedIndexes + */ + public function __construct( + $tableName, + $addedColumns = [], + $modifiedColumns = [], + $droppedColumns = [], + $addedIndexes = [], + $changedIndexes = [], + $removedIndexes = [], + ?Table $fromTable = null, + $addedForeignKeys = [], + $changedForeignKeys = [], + $removedForeignKeys = [], + $renamedColumns = [], + $renamedIndexes = [] + ) { + $this->name = $tableName; + $this->addedColumns = $addedColumns; + $this->changedColumns = $modifiedColumns; + $this->renamedColumns = $renamedColumns; + $this->removedColumns = $droppedColumns; + $this->addedIndexes = $addedIndexes; + $this->changedIndexes = $changedIndexes; + $this->renamedIndexes = $renamedIndexes; + $this->removedIndexes = $removedIndexes; + $this->addedForeignKeys = $addedForeignKeys; + $this->changedForeignKeys = $changedForeignKeys; + $this->removedForeignKeys = $removedForeignKeys; + + if ($fromTable !== null) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5678', + 'Not passing the $fromColumn to %s is deprecated.', + __METHOD__, + ); + } + + $this->fromTable = $fromTable; + } + + /** + * @deprecated Use {@see getOldTable()} instead. + * + * @param AbstractPlatform $platform The platform to use for retrieving this table diff's name. + * + * @return Identifier + */ + public function getName(AbstractPlatform $platform) + { + return new Identifier( + $this->fromTable instanceof Table ? $this->fromTable->getQuotedName($platform) : $this->name, + ); + } + + /** + * @deprecated Rename tables via {@link AbstractSchemaManager::renameTable()} instead. + * + * @return Identifier|false + */ + public function getNewName() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5663', + '%s is deprecated. Rename tables via AbstractSchemaManager::renameTable() instead.', + __METHOD__, + ); + + if ($this->newName === false) { + return false; + } + + return new Identifier($this->newName); + } + + public function getOldTable(): ?Table + { + return $this->fromTable; + } + + /** @return list */ + public function getAddedColumns(): array + { + return array_values($this->addedColumns); + } + + /** @return list */ + public function getModifiedColumns(): array + { + return array_values($this->changedColumns); + } + + /** @return list */ + public function getDroppedColumns(): array + { + return array_values($this->removedColumns); + } + + /** @return array */ + public function getRenamedColumns(): array + { + return $this->renamedColumns; + } + + /** @return list */ + public function getAddedIndexes(): array + { + return array_values($this->addedIndexes); + } + + /** + * @internal This method exists only for compatibility with the current implementation of schema managers + * that modify the diff while processing it. + */ + public function unsetAddedIndex(Index $index): void + { + $this->addedIndexes = array_filter( + $this->addedIndexes, + static function (Index $addedIndex) use ($index): bool { + return $addedIndex !== $index; + }, + ); + } + + /** @return array */ + public function getModifiedIndexes(): array + { + return array_values($this->changedIndexes); + } + + /** @return list */ + public function getDroppedIndexes(): array + { + return array_values($this->removedIndexes); + } + + /** + * @internal This method exists only for compatibility with the current implementation of schema managers + * that modify the diff while processing it. + */ + public function unsetDroppedIndex(Index $index): void + { + $this->removedIndexes = array_filter( + $this->removedIndexes, + static function (Index $removedIndex) use ($index): bool { + return $removedIndex !== $index; + }, + ); + } + + /** @return array */ + public function getRenamedIndexes(): array + { + return $this->renamedIndexes; + } + + /** @return list */ + public function getAddedForeignKeys(): array + { + return $this->addedForeignKeys; + } + + /** @return list */ + public function getModifiedForeignKeys(): array + { + return $this->changedForeignKeys; + } + + /** @return list */ + public function getDroppedForeignKeys(): array + { + return $this->removedForeignKeys; + } + + /** + * @internal This method exists only for compatibility with the current implementation of the schema comparator. + * + * @param ForeignKeyConstraint|string $foreignKey + */ + public function unsetDroppedForeignKey($foreignKey): void + { + $this->removedForeignKeys = array_filter( + $this->removedForeignKeys, + static function ($removedForeignKey) use ($foreignKey): bool { + return $removedForeignKey !== $foreignKey; + }, + ); + } + + /** + * Returns whether the diff is empty (contains no changes). + */ + public function isEmpty(): bool + { + return count($this->addedColumns) === 0 + && count($this->changedColumns) === 0 + && count($this->removedColumns) === 0 + && count($this->renamedColumns) === 0 + && count($this->addedIndexes) === 0 + && count($this->changedIndexes) === 0 + && count($this->removedIndexes) === 0 + && count($this->renamedIndexes) === 0 + && count($this->addedForeignKeys) === 0 + && count($this->changedForeignKeys) === 0 + && count($this->removedForeignKeys) === 0; + } +} diff --git a/vendor/doctrine/dbal/src/Schema/UniqueConstraint.php b/vendor/doctrine/dbal/src/Schema/UniqueConstraint.php new file mode 100644 index 00000000..85502e71 --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/UniqueConstraint.php @@ -0,0 +1,154 @@ + Identifier) + * + * @var Identifier[] + */ + protected $columns = []; + + /** + * Platform specific flags. + * array($flagName => true) + * + * @var true[] + */ + protected $flags = []; + + /** + * Platform specific options. + * + * @var mixed[] + */ + private array $options; + + /** + * @param string[] $columns + * @param string[] $flags + * @param mixed[] $options + */ + public function __construct(string $name, array $columns, array $flags = [], array $options = []) + { + $this->_setName($name); + + $this->options = $options; + + foreach ($columns as $column) { + $this->addColumn($column); + } + + foreach ($flags as $flag) { + $this->addFlag($flag); + } + } + + /** + * {@inheritdoc} + */ + public function getColumns() + { + return array_keys($this->columns); + } + + /** + * {@inheritdoc} + */ + public function getQuotedColumns(AbstractPlatform $platform) + { + $columns = []; + + foreach ($this->columns as $column) { + $columns[] = $column->getQuotedName($platform); + } + + return $columns; + } + + /** @return string[] */ + public function getUnquotedColumns(): array + { + return array_map([$this, 'trimQuotes'], $this->getColumns()); + } + + /** + * Returns platform specific flags for unique constraint. + * + * @return string[] + */ + public function getFlags(): array + { + return array_keys($this->flags); + } + + /** + * Adds flag for a unique constraint that translates to platform specific handling. + * + * @return $this + * + * @example $uniqueConstraint->addFlag('CLUSTERED') + */ + public function addFlag(string $flag): UniqueConstraint + { + $this->flags[strtolower($flag)] = true; + + return $this; + } + + /** + * Does this unique constraint have a specific flag? + */ + public function hasFlag(string $flag): bool + { + return isset($this->flags[strtolower($flag)]); + } + + /** + * Removes a flag. + */ + public function removeFlag(string $flag): void + { + unset($this->flags[strtolower($flag)]); + } + + /** + * Does this unique constraint have a specific option? + */ + public function hasOption(string $name): bool + { + return isset($this->options[strtolower($name)]); + } + + /** @return mixed */ + public function getOption(string $name) + { + return $this->options[strtolower($name)]; + } + + /** @return mixed[] */ + public function getOptions(): array + { + return $this->options; + } + + /** + * Adds a new column to the unique constraint. + */ + protected function addColumn(string $column): void + { + $this->columns[$column] = new Identifier($column); + } +} diff --git a/vendor/doctrine/dbal/src/Schema/View.php b/vendor/doctrine/dbal/src/Schema/View.php new file mode 100644 index 00000000..b19f2ad1 --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/View.php @@ -0,0 +1,28 @@ +_setName($name); + $this->sql = $sql; + } + + /** @return string */ + public function getSql() + { + return $this->sql; + } +} diff --git a/vendor/doctrine/dbal/src/Schema/Visitor/AbstractVisitor.php b/vendor/doctrine/dbal/src/Schema/Visitor/AbstractVisitor.php new file mode 100644 index 00000000..3d2ad27c --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/Visitor/AbstractVisitor.php @@ -0,0 +1,49 @@ +platform = $platform; + } + + /** + * {@inheritdoc} + */ + public function acceptNamespace($namespaceName) + { + if (! $this->platform->supportsSchemas()) { + return; + } + + $this->createNamespaceQueries[] = $this->platform->getCreateSchemaSQL($namespaceName); + } + + /** + * {@inheritdoc} + */ + public function acceptTable(Table $table) + { + $this->createTableQueries = array_merge($this->createTableQueries, $this->platform->getCreateTableSQL($table)); + } + + /** + * {@inheritdoc} + */ + public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) + { + if (! $this->platform->supportsForeignKeyConstraints()) { + return; + } + + $this->createFkConstraintQueries[] = $this->platform->getCreateForeignKeySQL($fkConstraint, $localTable); + } + + /** + * {@inheritdoc} + */ + public function acceptSequence(Sequence $sequence) + { + $this->createSequenceQueries[] = $this->platform->getCreateSequenceSQL($sequence); + } + + /** @return void */ + public function resetQueries() + { + $this->createNamespaceQueries = []; + $this->createTableQueries = []; + $this->createSequenceQueries = []; + $this->createFkConstraintQueries = []; + } + + /** + * Gets all queries collected so far. + * + * @return string[] + */ + public function getQueries() + { + return array_merge( + $this->createNamespaceQueries, + $this->createSequenceQueries, + $this->createTableQueries, + $this->createFkConstraintQueries, + ); + } +} diff --git a/vendor/doctrine/dbal/src/Schema/Visitor/DropSchemaSqlCollector.php b/vendor/doctrine/dbal/src/Schema/Visitor/DropSchemaSqlCollector.php new file mode 100644 index 00000000..0c573025 --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/Visitor/DropSchemaSqlCollector.php @@ -0,0 +1,107 @@ +platform = $platform; + $this->initializeQueries(); + } + + /** + * {@inheritdoc} + */ + public function acceptTable(Table $table) + { + $this->tables->attach($table); + } + + /** + * {@inheritdoc} + */ + public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) + { + if (strlen($fkConstraint->getName()) === 0) { + throw SchemaException::namedForeignKeyRequired($localTable, $fkConstraint); + } + + $this->constraints->attach($fkConstraint, $localTable); + } + + /** + * {@inheritdoc} + */ + public function acceptSequence(Sequence $sequence) + { + $this->sequences->attach($sequence); + } + + /** @return void */ + public function clearQueries() + { + $this->initializeQueries(); + } + + /** @return string[] */ + public function getQueries() + { + $sql = []; + + foreach ($this->constraints as $fkConstraint) { + assert($fkConstraint instanceof ForeignKeyConstraint); + $localTable = $this->constraints[$fkConstraint]; + $sql[] = $this->platform->getDropForeignKeySQL( + $fkConstraint->getQuotedName($this->platform), + $localTable->getQuotedName($this->platform), + ); + } + + foreach ($this->sequences as $sequence) { + assert($sequence instanceof Sequence); + $sql[] = $this->platform->getDropSequenceSQL($sequence->getQuotedName($this->platform)); + } + + foreach ($this->tables as $table) { + assert($table instanceof Table); + $sql[] = $this->platform->getDropTableSQL($table->getQuotedName($this->platform)); + } + + return $sql; + } + + private function initializeQueries(): void + { + $this->constraints = new SplObjectStorage(); + $this->sequences = new SplObjectStorage(); + $this->tables = new SplObjectStorage(); + } +} diff --git a/vendor/doctrine/dbal/src/Schema/Visitor/Graphviz.php b/vendor/doctrine/dbal/src/Schema/Visitor/Graphviz.php new file mode 100644 index 00000000..e3c61411 --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/Visitor/Graphviz.php @@ -0,0 +1,164 @@ +output .= $this->createNodeRelation( + $fkConstraint->getLocalTableName() . ':col' . current($fkConstraint->getLocalColumns()) . ':se', + $fkConstraint->getForeignTableName() . ':col' . current($fkConstraint->getForeignColumns()) . ':se', + [ + 'dir' => 'back', + 'arrowtail' => 'dot', + 'arrowhead' => 'normal', + ], + ); + } + + /** + * {@inheritdoc} + */ + public function acceptSchema(Schema $schema) + { + $this->output = 'digraph "' . $schema->getName() . '" {' . "\n"; + $this->output .= 'splines = true;' . "\n"; + $this->output .= 'overlap = false;' . "\n"; + $this->output .= 'outputorder=edgesfirst;' . "\n"; + $this->output .= 'mindist = 0.6;' . "\n"; + $this->output .= 'sep = .2;' . "\n"; + } + + /** + * {@inheritdoc} + */ + public function acceptTable(Table $table) + { + $this->output .= $this->createNode( + $table->getName(), + [ + 'label' => $this->createTableLabel($table), + 'shape' => 'plaintext', + ], + ); + } + + private function createTableLabel(Table $table): string + { + // Start the table + $label = '<
'; + + // The title + $label .= ''; + + // The attributes block + foreach ($table->getColumns() as $column) { + $columnLabel = $column->getName(); + + $label .= '' + . '' + . '' + . ''; + } + + // End the table + $label .= '
' + . '' . $table->getName() . '
' + . '' . $columnLabel . '' + . '' + . '' + . strtolower($column->getType()->getName()) + . '' + . ''; + + $primaryKey = $table->getPrimaryKey(); + + if ($primaryKey !== null && in_array($column->getName(), $primaryKey->getColumns(), true)) { + $label .= "\xe2\x9c\xb7"; + } + + $label .= '
>'; + + return $label; + } + + /** + * @param string $name + * @param string[] $options + */ + private function createNode($name, $options): string + { + $node = $name . ' ['; + foreach ($options as $key => $value) { + $node .= $key . '=' . $value . ' '; + } + + $node .= "]\n"; + + return $node; + } + + /** + * @param string $node1 + * @param string $node2 + * @param string[] $options + */ + private function createNodeRelation($node1, $node2, $options): string + { + $relation = $node1 . ' -> ' . $node2 . ' ['; + foreach ($options as $key => $value) { + $relation .= $key . '=' . $value . ' '; + } + + $relation .= "]\n"; + + return $relation; + } + + /** + * Get Graphviz Output + * + * @return string + */ + public function getOutput() + { + return $this->output . '}'; + } + + /** + * Writes dot language output to a file. This should usually be a *.dot file. + * + * You have to convert the output into a viewable format. For example use "neato" on linux systems + * and execute: + * + * neato -Tpng -o er.png er.dot + * + * @param string $filename + * + * @return void + */ + public function write($filename) + { + file_put_contents($filename, $this->getOutput()); + } +} diff --git a/vendor/doctrine/dbal/src/Schema/Visitor/NamespaceVisitor.php b/vendor/doctrine/dbal/src/Schema/Visitor/NamespaceVisitor.php new file mode 100644 index 00000000..44382434 --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/Visitor/NamespaceVisitor.php @@ -0,0 +1,20 @@ +schema = $schema; + } + + /** + * {@inheritdoc} + */ + public function acceptTable(Table $table) + { + if ($this->schema === null) { + return; + } + + if ($table->isInDefaultNamespace($this->schema->getName())) { + return; + } + + $this->schema->dropTable($table->getName()); + } + + /** + * {@inheritdoc} + */ + public function acceptSequence(Sequence $sequence) + { + if ($this->schema === null) { + return; + } + + if ($sequence->isInDefaultNamespace($this->schema->getName())) { + return; + } + + $this->schema->dropSequence($sequence->getName()); + } + + /** + * {@inheritdoc} + */ + public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) + { + if ($this->schema === null) { + return; + } + + // The table may already be deleted in a previous + // RemoveNamespacedAssets#acceptTable call. Removing Foreign keys that + // point to nowhere. + if (! $this->schema->hasTable($fkConstraint->getForeignTableName())) { + $localTable->removeForeignKey($fkConstraint->getName()); + + return; + } + + $foreignTable = $this->schema->getTable($fkConstraint->getForeignTableName()); + if ($foreignTable->isInDefaultNamespace($this->schema->getName())) { + return; + } + + $localTable->removeForeignKey($fkConstraint->getName()); + } +} diff --git a/vendor/doctrine/dbal/src/Schema/Visitor/Visitor.php b/vendor/doctrine/dbal/src/Schema/Visitor/Visitor.php new file mode 100644 index 00000000..8b34864c --- /dev/null +++ b/vendor/doctrine/dbal/src/Schema/Visitor/Visitor.php @@ -0,0 +1,45 @@ +Statement for the given SQL and Connection. + * + * @internal The statement can be only instantiated by {@see Connection}. + * + * @param Connection $conn The connection for handling statement errors. + * @param Driver\Statement $statement The underlying driver-level statement. + * @param string $sql The SQL of the statement. + * + * @throws Exception + */ + public function __construct(Connection $conn, Driver\Statement $statement, string $sql) + { + $this->conn = $conn; + $this->stmt = $statement; + $this->sql = $sql; + $this->platform = $conn->getDatabasePlatform(); + } + + /** + * Binds a parameter value to the statement. + * + * The value can optionally be bound with a DBAL mapping type. + * If bound with a DBAL mapping type, the binding type is derived from the mapping + * type and the value undergoes the conversion routines of the mapping type before + * being bound. + * + * @param string|int $param The name or position of the parameter. + * @param mixed $value The value of the parameter. + * @param mixed $type Either a PDO binding type or a DBAL mapping type name or instance. + * + * @return bool TRUE on success, FALSE on failure. + * + * @throws Exception + */ + public function bindValue($param, $value, $type = ParameterType::STRING) + { + $this->params[$param] = $value; + $this->types[$param] = $type; + + $bindingType = ParameterType::STRING; + + if ($type !== null) { + if (is_string($type)) { + $type = Type::getType($type); + } + + $bindingType = $type; + + if ($type instanceof Type) { + $value = $type->convertToDatabaseValue($value, $this->platform); + $bindingType = $type->getBindingType(); + } + } + + try { + return $this->stmt->bindValue($param, $value, $bindingType); + } catch (Driver\Exception $e) { + throw $this->conn->convertException($e); + } + } + + /** + * Binds a parameter to a value by reference. + * + * Binding a parameter by reference does not support DBAL mapping types. + * + * @deprecated Use {@see bindValue()} instead. + * + * @param string|int $param The name or position of the parameter. + * @param mixed $variable The reference to the variable to bind. + * @param int $type The binding type. + * @param int|null $length Must be specified when using an OUT bind + * so that PHP allocates enough memory to hold the returned value. + * + * @return bool TRUE on success, FALSE on failure. + * + * @throws Exception + */ + public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5563', + '%s is deprecated. Use bindValue() instead.', + __METHOD__, + ); + + $this->params[$param] = $variable; + $this->types[$param] = $type; + + try { + if (func_num_args() > 3) { + return $this->stmt->bindParam($param, $variable, $type, $length); + } + + return $this->stmt->bindParam($param, $variable, $type); + } catch (Driver\Exception $e) { + throw $this->conn->convertException($e); + } + } + + /** + * Executes the statement with the currently bound parameters. + * + * @deprecated Statement::execute() is deprecated, use Statement::executeQuery() or executeStatement() instead + * + * @param mixed[]|null $params + * + * @throws Exception + */ + public function execute($params = null): Result + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4580', + '%s() is deprecated, use Statement::executeQuery() or Statement::executeStatement() instead', + __METHOD__, + ); + + if ($params !== null) { + $this->params = $params; + } + + $logger = $this->conn->getConfiguration()->getSQLLogger(); + if ($logger !== null) { + $logger->startQuery($this->sql, $this->params, $this->types); + } + + try { + return new Result( + $this->stmt->execute($params), + $this->conn, + ); + } catch (Driver\Exception $ex) { + throw $this->conn->convertExceptionDuringQuery($ex, $this->sql, $this->params, $this->types); + } finally { + if ($logger !== null) { + $logger->stopQuery(); + } + } + } + + /** + * Executes the statement with the currently bound parameters and return result. + * + * @param mixed[] $params + * + * @throws Exception + */ + public function executeQuery(array $params = []): Result + { + if (func_num_args() > 0) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5556', + 'Passing $params to Statement::executeQuery() is deprecated. Bind parameters using' + . ' Statement::bindParam() or Statement::bindValue() instead.', + ); + } + + if ($params === []) { + $params = null; // Workaround as long execute() exists and used internally. + } + + return $this->execute($params); + } + + /** + * Executes the statement with the currently bound parameters and return affected rows. + * + * @param mixed[] $params + * + * @throws Exception + */ + public function executeStatement(array $params = []): int + { + if (func_num_args() > 0) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5556', + 'Passing $params to Statement::executeStatement() is deprecated. Bind parameters using' + . ' Statement::bindParam() or Statement::bindValue() instead.', + ); + } + + if ($params === []) { + $params = null; // Workaround as long execute() exists and used internally. + } + + return $this->execute($params)->rowCount(); + } + + /** + * Gets the wrapped driver statement. + * + * @return Driver\Statement + */ + public function getWrappedStatement() + { + return $this->stmt; + } +} diff --git a/vendor/doctrine/dbal/src/Tools/Console/Command/ReservedWordsCommand.php b/vendor/doctrine/dbal/src/Tools/Console/Command/ReservedWordsCommand.php new file mode 100644 index 00000000..eb854a59 --- /dev/null +++ b/vendor/doctrine/dbal/src/Tools/Console/Command/ReservedWordsCommand.php @@ -0,0 +1,219 @@ + */ + private array $keywordLists; + + private ConnectionProvider $connectionProvider; + + public function __construct(ConnectionProvider $connectionProvider) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5431', + 'ReservedWordsCommand is deprecated. Use database documentation instead.', + ); + + parent::__construct(); + $this->connectionProvider = $connectionProvider; + + $this->keywordLists = [ + 'db2' => new DB2Keywords(), + 'mariadb102' => new MariaDb102Keywords(), + 'mysql' => new MySQLKeywords(), + 'mysql57' => new MySQL57Keywords(), + 'mysql80' => new MySQL80Keywords(), + 'oracle' => new OracleKeywords(), + 'pgsql' => new PostgreSQL94Keywords(), + 'pgsql100' => new PostgreSQL100Keywords(), + 'sqlite' => new SQLiteKeywords(), + 'sqlserver' => new SQLServer2012Keywords(), + ]; + } + + /** + * Add or replace a keyword list. + */ + public function setKeywordList(string $name, KeywordList $keywordList): void + { + $this->keywordLists[$name] = $keywordList; + } + + /** + * If you want to add or replace a keywords list use this command. + * + * @param string $name + * @param class-string $class + * + * @return void + */ + public function setKeywordListClass($name, $class) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4510', + 'ReservedWordsCommand::setKeywordListClass() is deprecated,' + . ' use ReservedWordsCommand::setKeywordList() instead.', + ); + + $this->keywordLists[$name] = new $class(); + } + + /** @return void */ + protected function configure() + { + $this + ->setName('dbal:reserved-words') + ->setDescription('Checks if the current database contains identifiers that are reserved.') + ->setDefinition([ + new InputOption('connection', null, InputOption::VALUE_REQUIRED, 'The named database connection'), + new InputOption( + 'list', + 'l', + InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, + 'Keyword-List name.', + ), + ]) + ->setHelp(<<<'EOT' +Checks if the current database contains tables and columns +with names that are identifiers in this dialect or in other SQL dialects. + +By default all supported platform keywords are checked: + + %command.full_name% + +If you want to check against specific dialects you can +pass them to the command: + + %command.full_name% -l mysql -l pgsql + +The following keyword lists are currently shipped with Doctrine: + + * db2 + * mariadb102 + * mysql + * mysql57 + * mysql80 + * oracle + * pgsql + * pgsql100 + * sqlite + * sqlserver +EOT); + } + + /** + * {@inheritdoc} + * + * @return int + * + * @throws Exception + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + $output->writeln( + 'The dbal:reserved-words command is deprecated.' + . ' Use the documentation on the used database platform(s) instead.', + ); + $output->writeln(''); + + $conn = $this->getConnection($input); + + $keywordLists = $input->getOption('list'); + + if (is_string($keywordLists)) { + $keywordLists = [$keywordLists]; + } elseif (! is_array($keywordLists)) { + $keywordLists = []; + } + + if (count($keywordLists) === 0) { + $keywordLists = array_keys($this->keywordLists); + } + + $keywords = []; + foreach ($keywordLists as $keywordList) { + if (! isset($this->keywordLists[$keywordList])) { + throw new InvalidArgumentException( + "There exists no keyword list with name '" . $keywordList . "'. " . + 'Known lists: ' . implode(', ', array_keys($this->keywordLists)), + ); + } + + $keywords[] = $this->keywordLists[$keywordList]; + } + + $output->write( + 'Checking keyword violations for ' . implode(', ', $keywordLists) . '...', + true, + ); + + $schema = $conn->getSchemaManager()->introspectSchema(); + $visitor = new ReservedKeywordsValidator($keywords); + $schema->visit($visitor); + + $violations = $visitor->getViolations(); + if (count($violations) !== 0) { + $output->write( + 'There are ' . count($violations) . ' reserved keyword violations' + . ' in your database schema:', + true, + ); + + foreach ($violations as $violation) { + $output->write(' - ' . $violation, true); + } + + return 1; + } + + $output->write('No reserved keywords violations have been found!', true); + + return 0; + } + + private function getConnection(InputInterface $input): Connection + { + $connectionName = $input->getOption('connection'); + assert(is_string($connectionName) || $connectionName === null); + + if ($connectionName !== null) { + return $this->connectionProvider->getConnection($connectionName); + } + + return $this->connectionProvider->getDefaultConnection(); + } +} diff --git a/vendor/doctrine/dbal/src/Tools/Console/Command/RunSqlCommand.php b/vendor/doctrine/dbal/src/Tools/Console/Command/RunSqlCommand.php new file mode 100644 index 00000000..5bd72ea6 --- /dev/null +++ b/vendor/doctrine/dbal/src/Tools/Console/Command/RunSqlCommand.php @@ -0,0 +1,123 @@ +connectionProvider = $connectionProvider; + } + + /** @return void */ + protected function configure() + { + $this + ->setName('dbal:run-sql') + ->setDescription('Executes arbitrary SQL directly from the command line.') + ->setDefinition([ + new InputOption('connection', null, InputOption::VALUE_REQUIRED, 'The named database connection'), + new InputArgument('sql', InputArgument::REQUIRED, 'The SQL statement to execute.'), + new InputOption('depth', null, InputOption::VALUE_REQUIRED, 'Dumping depth of result set (deprecated).'), + new InputOption('force-fetch', null, InputOption::VALUE_NONE, 'Forces fetching the result.'), + ]) + ->setHelp(<<<'EOT' +The %command.name% command executes the given SQL query and +outputs the results: + +php %command.full_name% "SELECT * FROM users" +EOT); + } + + /** + * {@inheritdoc} + * + * @return int + * + * @throws Exception + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + $conn = $this->getConnection($input); + $io = new SymfonyStyle($input, $output); + + $sql = $input->getArgument('sql'); + + if ($sql === null) { + throw new RuntimeException("Argument 'SQL' is required in order to execute this command correctly."); + } + + assert(is_string($sql)); + + if ($input->getOption('depth') !== null) { + $io->warning('Parameter "depth" is deprecated and has no effect anymore.'); + } + + $forceFetch = $input->getOption('force-fetch'); + assert(is_bool($forceFetch)); + + if (stripos($sql, 'select') === 0 || $forceFetch) { + $this->runQuery($io, $conn, $sql); + } else { + $this->runStatement($io, $conn, $sql); + } + + return 0; + } + + private function getConnection(InputInterface $input): Connection + { + $connectionName = $input->getOption('connection'); + assert(is_string($connectionName) || $connectionName === null); + + if ($connectionName !== null) { + return $this->connectionProvider->getConnection($connectionName); + } + + return $this->connectionProvider->getDefaultConnection(); + } + + /** @throws Exception */ + private function runQuery(SymfonyStyle $io, Connection $conn, string $sql): void + { + $resultSet = $conn->fetchAllAssociative($sql); + if ($resultSet === []) { + $io->success('The query yielded an empty result set.'); + + return; + } + + $io->table(array_keys($resultSet[0]), $resultSet); + } + + /** @throws Exception */ + private function runStatement(SymfonyStyle $io, Connection $conn, string $sql): void + { + $io->success(sprintf('%d rows affected.', $conn->executeStatement($sql))); + } +} diff --git a/vendor/doctrine/dbal/src/Tools/Console/ConnectionNotFound.php b/vendor/doctrine/dbal/src/Tools/Console/ConnectionNotFound.php new file mode 100644 index 00000000..81ca4182 --- /dev/null +++ b/vendor/doctrine/dbal/src/Tools/Console/ConnectionNotFound.php @@ -0,0 +1,9 @@ +connection = $connection; + $this->defaultConnectionName = $defaultConnectionName; + } + + public function getDefaultConnection(): Connection + { + return $this->connection; + } + + public function getConnection(string $name): Connection + { + if ($name !== $this->defaultConnectionName) { + throw new ConnectionNotFound(sprintf('Connection with name "%s" does not exist.', $name)); + } + + return $this->connection; + } +} diff --git a/vendor/doctrine/dbal/src/Tools/Console/ConsoleRunner.php b/vendor/doctrine/dbal/src/Tools/Console/ConsoleRunner.php new file mode 100644 index 00000000..e8fa3c60 --- /dev/null +++ b/vendor/doctrine/dbal/src/Tools/Console/ConsoleRunner.php @@ -0,0 +1,81 @@ +setCatchExceptions(true); + self::addCommands($cli, $connectionProvider); + $cli->addCommands($commands); + $cli->run(); + } + + /** @return void */ + public static function addCommands(Application $cli, ConnectionProvider $connectionProvider) + { + $cli->addCommands([ + new RunSqlCommand($connectionProvider), + new ReservedWordsCommand($connectionProvider), + ]); + } + + /** + * Prints the instructions to create a configuration file + * + * @deprecated This method will be removed without replacement. + * + * @return void + */ + public static function printCliConfigTemplate() + { + echo <<<'HELP' +You are missing a "cli-config.php" or "config/cli-config.php" file in your +project, which is required to get the Doctrine-DBAL Console working. You can use the +following sample as a template: + +getClobTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToDatabaseValue($value, AbstractPlatform $platform) + { + // @todo 3.0 - $value === null check to save real NULL in database + return serialize($value); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null) { + return null; + } + + $value = is_resource($value) ? stream_get_contents($value) : $value; + + set_error_handler(function (int $code, string $message): bool { + if ($code === E_DEPRECATED || $code === E_USER_DEPRECATED) { + return false; + } + + throw ConversionException::conversionFailedUnserialization($this->getName(), $message); + }); + + try { + return unserialize($value); + } finally { + restore_error_handler(); + } + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return Types::ARRAY; + } + + /** + * {@inheritdoc} + * + * @deprecated + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5509', + '%s is deprecated.', + __METHOD__, + ); + + return true; + } +} diff --git a/vendor/doctrine/dbal/src/Types/AsciiStringType.php b/vendor/doctrine/dbal/src/Types/AsciiStringType.php new file mode 100644 index 00000000..ab1e0e06 --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/AsciiStringType.php @@ -0,0 +1,29 @@ +getAsciiStringTypeDeclarationSQL($column); + } + + public function getBindingType(): int + { + return ParameterType::ASCII; + } + + public function getName(): string + { + return Types::ASCII_STRING; + } +} diff --git a/vendor/doctrine/dbal/src/Types/BigIntType.php b/vendor/doctrine/dbal/src/Types/BigIntType.php new file mode 100644 index 00000000..e5d6dcbb --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/BigIntType.php @@ -0,0 +1,44 @@ +getBigIntTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function getBindingType() + { + return ParameterType::STRING; + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + return $value === null ? null : (string) $value; + } +} diff --git a/vendor/doctrine/dbal/src/Types/BinaryType.php b/vendor/doctrine/dbal/src/Types/BinaryType.php new file mode 100644 index 00000000..e030f166 --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/BinaryType.php @@ -0,0 +1,67 @@ +getBinaryTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null) { + return null; + } + + if (is_string($value)) { + $fp = fopen('php://temp', 'rb+'); + assert(is_resource($fp)); + fwrite($fp, $value); + fseek($fp, 0); + $value = $fp; + } + + if (! is_resource($value)) { + throw ConversionException::conversionFailed($value, Types::BINARY); + } + + return $value; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return Types::BINARY; + } + + /** + * {@inheritdoc} + */ + public function getBindingType() + { + return ParameterType::BINARY; + } +} diff --git a/vendor/doctrine/dbal/src/Types/BlobType.php b/vendor/doctrine/dbal/src/Types/BlobType.php new file mode 100644 index 00000000..b71e7255 --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/BlobType.php @@ -0,0 +1,67 @@ +getBlobTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null) { + return null; + } + + if (is_string($value)) { + $fp = fopen('php://temp', 'rb+'); + assert(is_resource($fp)); + fwrite($fp, $value); + fseek($fp, 0); + $value = $fp; + } + + if (! is_resource($value)) { + throw ConversionException::conversionFailed($value, Types::BLOB); + } + + return $value; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return Types::BLOB; + } + + /** + * {@inheritdoc} + */ + public function getBindingType() + { + return ParameterType::LARGE_OBJECT; + } +} diff --git a/vendor/doctrine/dbal/src/Types/BooleanType.php b/vendor/doctrine/dbal/src/Types/BooleanType.php new file mode 100644 index 00000000..92f53055 --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/BooleanType.php @@ -0,0 +1,73 @@ +getBooleanTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToDatabaseValue($value, AbstractPlatform $platform) + { + return $platform->convertBooleansToDatabaseValue($value); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + return $platform->convertFromBoolean($value); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return Types::BOOLEAN; + } + + /** + * {@inheritdoc} + */ + public function getBindingType() + { + return ParameterType::BOOLEAN; + } + + /** + * @deprecated + * + * @return bool + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5509', + '%s is deprecated.', + __METHOD__, + ); + + // We require a commented boolean type in order to distinguish between + // boolean and smallint as both (have to) map to the same native type. + return $platform instanceof DB2Platform; + } +} diff --git a/vendor/doctrine/dbal/src/Types/ConversionException.php b/vendor/doctrine/dbal/src/Types/ConversionException.php new file mode 100644 index 00000000..154b06d3 --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/ConversionException.php @@ -0,0 +1,123 @@ + 32 ? substr($value, 0, 20) . '...' : $value; + + return new self('Could not convert database value "' . $value . '" to Doctrine Type ' . $toType, 0, $previous); + } + + /** + * Thrown when a Database to Doctrine Type Conversion fails and we can make a statement + * about the expected format. + * + * @param mixed $value + * @param string $toType + * @param string $expectedFormat + * + * @return ConversionException + */ + public static function conversionFailedFormat($value, $toType, $expectedFormat, ?Throwable $previous = null) + { + $value = strlen($value) > 32 ? substr($value, 0, 20) . '...' : $value; + + return new self( + 'Could not convert database value "' . $value . '" to Doctrine Type ' . + $toType . '. Expected format: ' . $expectedFormat, + 0, + $previous, + ); + } + + /** + * Thrown when the PHP value passed to the converter was not of the expected type. + * + * @param mixed $value + * @param string $toType + * @param string[] $possibleTypes + * + * @return ConversionException + */ + public static function conversionFailedInvalidType( + $value, + $toType, + array $possibleTypes, + ?Throwable $previous = null + ) { + if (is_scalar($value) || $value === null) { + return new self(sprintf( + 'Could not convert PHP value %s to type %s. Expected one of the following types: %s', + var_export($value, true), + $toType, + implode(', ', $possibleTypes), + ), 0, $previous); + } + + return new self(sprintf( + 'Could not convert PHP value of type %s to type %s. Expected one of the following types: %s', + is_object($value) ? get_class($value) : gettype($value), + $toType, + implode(', ', $possibleTypes), + ), 0, $previous); + } + + /** + * @param mixed $value + * @param string $format + * @param string $error + * + * @return ConversionException + */ + public static function conversionFailedSerialization($value, $format, $error /*, ?Throwable $previous = null */) + { + $actualType = is_object($value) ? get_class($value) : gettype($value); + + return new self(sprintf( + "Could not convert PHP type '%s' to '%s', as an '%s' error was triggered by the serialization", + $actualType, + $format, + $error, + ), 0, func_num_args() >= 4 ? func_get_arg(3) : null); + } + + public static function conversionFailedUnserialization(string $format, string $error): self + { + return new self(sprintf( + "Could not convert database value to '%s' as an error was triggered by the unserialization: '%s'", + $format, + $error, + )); + } +} diff --git a/vendor/doctrine/dbal/src/Types/DateImmutableType.php b/vendor/doctrine/dbal/src/Types/DateImmutableType.php new file mode 100644 index 00000000..98fa6dc6 --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/DateImmutableType.php @@ -0,0 +1,80 @@ +format($platform->getDateFormatString()); + } + + throw ConversionException::conversionFailedInvalidType( + $value, + $this->getName(), + ['null', DateTimeImmutable::class], + ); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null || $value instanceof DateTimeImmutable) { + return $value; + } + + $dateTime = DateTimeImmutable::createFromFormat('!' . $platform->getDateFormatString(), $value); + + if ($dateTime === false) { + throw ConversionException::conversionFailedFormat( + $value, + $this->getName(), + $platform->getDateFormatString(), + ); + } + + return $dateTime; + } + + /** + * {@inheritdoc} + * + * @deprecated + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5509', + '%s is deprecated.', + __METHOD__, + ); + + return true; + } +} diff --git a/vendor/doctrine/dbal/src/Types/DateIntervalType.php b/vendor/doctrine/dbal/src/Types/DateIntervalType.php new file mode 100644 index 00000000..72156f17 --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/DateIntervalType.php @@ -0,0 +1,98 @@ +getStringTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToDatabaseValue($value, AbstractPlatform $platform) + { + if ($value === null) { + return null; + } + + if ($value instanceof DateInterval) { + return $value->format(self::FORMAT); + } + + throw ConversionException::conversionFailedInvalidType($value, $this->getName(), ['null', 'DateInterval']); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null || $value instanceof DateInterval) { + return $value; + } + + $negative = false; + + if (isset($value[0]) && ($value[0] === '+' || $value[0] === '-')) { + $negative = $value[0] === '-'; + $value = substr($value, 1); + } + + try { + $interval = new DateInterval($value); + + if ($negative) { + $interval->invert = 1; + } + + return $interval; + } catch (Throwable $exception) { + throw ConversionException::conversionFailedFormat($value, $this->getName(), self::FORMAT, $exception); + } + } + + /** + * {@inheritdoc} + * + * @deprecated + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5509', + '%s is deprecated.', + __METHOD__, + ); + + return true; + } +} diff --git a/vendor/doctrine/dbal/src/Types/DateTimeImmutableType.php b/vendor/doctrine/dbal/src/Types/DateTimeImmutableType.php new file mode 100644 index 00000000..6f789620 --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/DateTimeImmutableType.php @@ -0,0 +1,86 @@ +format($platform->getDateTimeFormatString()); + } + + throw ConversionException::conversionFailedInvalidType( + $value, + $this->getName(), + ['null', DateTimeImmutable::class], + ); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null || $value instanceof DateTimeImmutable) { + return $value; + } + + $dateTime = DateTimeImmutable::createFromFormat($platform->getDateTimeFormatString(), $value); + + if ($dateTime === false) { + $dateTime = date_create_immutable($value); + } + + if ($dateTime === false) { + throw ConversionException::conversionFailedFormat( + $value, + $this->getName(), + $platform->getDateTimeFormatString(), + ); + } + + return $dateTime; + } + + /** + * {@inheritdoc} + * + * @deprecated + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5509', + '%s is deprecated.', + __METHOD__, + ); + + return true; + } +} diff --git a/vendor/doctrine/dbal/src/Types/DateTimeType.php b/vendor/doctrine/dbal/src/Types/DateTimeType.php new file mode 100644 index 00000000..738c6bfb --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/DateTimeType.php @@ -0,0 +1,73 @@ +getDateTimeTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToDatabaseValue($value, AbstractPlatform $platform) + { + if ($value === null) { + return $value; + } + + if ($value instanceof DateTimeInterface) { + return $value->format($platform->getDateTimeFormatString()); + } + + throw ConversionException::conversionFailedInvalidType($value, $this->getName(), ['null', 'DateTime']); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null || $value instanceof DateTimeInterface) { + return $value; + } + + $val = DateTime::createFromFormat($platform->getDateTimeFormatString(), $value); + + if ($val === false) { + $val = date_create($value); + } + + if ($val === false) { + throw ConversionException::conversionFailedFormat( + $value, + $this->getName(), + $platform->getDateTimeFormatString(), + ); + } + + return $val; + } +} diff --git a/vendor/doctrine/dbal/src/Types/DateTimeTzImmutableType.php b/vendor/doctrine/dbal/src/Types/DateTimeTzImmutableType.php new file mode 100644 index 00000000..222a9c3b --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/DateTimeTzImmutableType.php @@ -0,0 +1,80 @@ +format($platform->getDateTimeTzFormatString()); + } + + throw ConversionException::conversionFailedInvalidType( + $value, + $this->getName(), + ['null', DateTimeImmutable::class], + ); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null || $value instanceof DateTimeImmutable) { + return $value; + } + + $dateTime = DateTimeImmutable::createFromFormat($platform->getDateTimeTzFormatString(), $value); + + if ($dateTime === false) { + throw ConversionException::conversionFailedFormat( + $value, + $this->getName(), + $platform->getDateTimeTzFormatString(), + ); + } + + return $dateTime; + } + + /** + * {@inheritdoc} + * + * @deprecated + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5509', + '%s is deprecated.', + __METHOD__, + ); + + return true; + } +} diff --git a/vendor/doctrine/dbal/src/Types/DateTimeTzType.php b/vendor/doctrine/dbal/src/Types/DateTimeTzType.php new file mode 100644 index 00000000..ee08f9d1 --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/DateTimeTzType.php @@ -0,0 +1,83 @@ +getDateTimeTzTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToDatabaseValue($value, AbstractPlatform $platform) + { + if ($value === null) { + return $value; + } + + if ($value instanceof DateTimeInterface) { + return $value->format($platform->getDateTimeTzFormatString()); + } + + throw ConversionException::conversionFailedInvalidType( + $value, + $this->getName(), + ['null', 'DateTime'], + ); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null || $value instanceof DateTimeInterface) { + return $value; + } + + $val = DateTime::createFromFormat($platform->getDateTimeTzFormatString(), $value); + if ($val === false) { + throw ConversionException::conversionFailedFormat( + $value, + $this->getName(), + $platform->getDateTimeTzFormatString(), + ); + } + + return $val; + } +} diff --git a/vendor/doctrine/dbal/src/Types/DateType.php b/vendor/doctrine/dbal/src/Types/DateType.php new file mode 100644 index 00000000..533667dd --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/DateType.php @@ -0,0 +1,66 @@ +getDateTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToDatabaseValue($value, AbstractPlatform $platform) + { + if ($value === null) { + return $value; + } + + if ($value instanceof DateTimeInterface) { + return $value->format($platform->getDateFormatString()); + } + + throw ConversionException::conversionFailedInvalidType($value, $this->getName(), ['null', 'DateTime']); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null || $value instanceof DateTimeInterface) { + return $value; + } + + $val = DateTime::createFromFormat('!' . $platform->getDateFormatString(), $value); + if ($val === false) { + throw ConversionException::conversionFailedFormat( + $value, + $this->getName(), + $platform->getDateFormatString(), + ); + } + + return $val; + } +} diff --git a/vendor/doctrine/dbal/src/Types/DecimalType.php b/vendor/doctrine/dbal/src/Types/DecimalType.php new file mode 100644 index 00000000..144e97a0 --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/DecimalType.php @@ -0,0 +1,47 @@ +getDecimalTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + // Some drivers starting from PHP 8.1 can represent decimals as float/int + // See also: https://github.com/doctrine/dbal/pull/4818 + if ((PHP_VERSION_ID >= 80100 || $platform instanceof SqlitePlatform) && (is_float($value) || is_int($value))) { + return (string) $value; + } + + return $value; + } +} diff --git a/vendor/doctrine/dbal/src/Types/FloatType.php b/vendor/doctrine/dbal/src/Types/FloatType.php new file mode 100644 index 00000000..98ead4a9 --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/FloatType.php @@ -0,0 +1,32 @@ +getFloatDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + return $value === null ? null : (float) $value; + } +} diff --git a/vendor/doctrine/dbal/src/Types/GuidType.php b/vendor/doctrine/dbal/src/Types/GuidType.php new file mode 100644 index 00000000..6ce903e2 --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/GuidType.php @@ -0,0 +1,45 @@ +getGuidTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return Types::GUID; + } + + /** + * {@inheritdoc} + * + * @deprecated + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5509', + '%s is deprecated.', + __METHOD__, + ); + + return ! $platform->hasNativeGuidType(); + } +} diff --git a/vendor/doctrine/dbal/src/Types/IntegerType.php b/vendor/doctrine/dbal/src/Types/IntegerType.php new file mode 100644 index 00000000..0df606e2 --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/IntegerType.php @@ -0,0 +1,44 @@ +getIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + return $value === null ? null : (int) $value; + } + + /** + * {@inheritdoc} + */ + public function getBindingType() + { + return ParameterType::INTEGER; + } +} diff --git a/vendor/doctrine/dbal/src/Types/JsonType.php b/vendor/doctrine/dbal/src/Types/JsonType.php new file mode 100644 index 00000000..20ee79de --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/JsonType.php @@ -0,0 +1,90 @@ +getJsonTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToDatabaseValue($value, AbstractPlatform $platform) + { + if ($value === null) { + return null; + } + + try { + return json_encode($value, JSON_THROW_ON_ERROR | JSON_PRESERVE_ZERO_FRACTION); + } catch (JsonException $e) { + throw ConversionException::conversionFailedSerialization($value, 'json', $e->getMessage(), $e); + } + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null || $value === '') { + return null; + } + + if (is_resource($value)) { + $value = stream_get_contents($value); + } + + try { + return json_decode($value, true, 512, JSON_THROW_ON_ERROR); + } catch (JsonException $e) { + throw ConversionException::conversionFailed($value, $this->getName(), $e); + } + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return Types::JSON; + } + + /** + * {@inheritdoc} + * + * @deprecated + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5509', + '%s is deprecated.', + __METHOD__, + ); + + return ! $platform->hasNativeJsonType(); + } +} diff --git a/vendor/doctrine/dbal/src/Types/ObjectType.php b/vendor/doctrine/dbal/src/Types/ObjectType.php new file mode 100644 index 00000000..f8bcc943 --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/ObjectType.php @@ -0,0 +1,84 @@ +getClobTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToDatabaseValue($value, AbstractPlatform $platform) + { + return serialize($value); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null) { + return null; + } + + $value = is_resource($value) ? stream_get_contents($value) : $value; + + set_error_handler(function (int $code, string $message): bool { + throw ConversionException::conversionFailedUnserialization($this->getName(), $message); + }); + + try { + return unserialize($value); + } finally { + restore_error_handler(); + } + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return Types::OBJECT; + } + + /** + * {@inheritdoc} + * + * @deprecated + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5509', + '%s is deprecated.', + __METHOD__, + ); + + return true; + } +} diff --git a/vendor/doctrine/dbal/src/Types/PhpDateTimeMappingType.php b/vendor/doctrine/dbal/src/Types/PhpDateTimeMappingType.php new file mode 100644 index 00000000..45658505 --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/PhpDateTimeMappingType.php @@ -0,0 +1,12 @@ +getClobTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToDatabaseValue($value, AbstractPlatform $platform) + { + if (! is_array($value) || count($value) === 0) { + return null; + } + + return implode(',', $value); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null) { + return []; + } + + $value = is_resource($value) ? stream_get_contents($value) : $value; + + return explode(',', $value); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return Types::SIMPLE_ARRAY; + } + + /** + * {@inheritdoc} + * + * @deprecated + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5509', + '%s is deprecated.', + __METHOD__, + ); + + return true; + } +} diff --git a/vendor/doctrine/dbal/src/Types/SmallIntType.php b/vendor/doctrine/dbal/src/Types/SmallIntType.php new file mode 100644 index 00000000..90e63495 --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/SmallIntType.php @@ -0,0 +1,44 @@ +getSmallIntTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + return $value === null ? null : (int) $value; + } + + /** + * {@inheritdoc} + */ + public function getBindingType() + { + return ParameterType::INTEGER; + } +} diff --git a/vendor/doctrine/dbal/src/Types/StringType.php b/vendor/doctrine/dbal/src/Types/StringType.php new file mode 100644 index 00000000..e409c2a8 --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/StringType.php @@ -0,0 +1,27 @@ +getStringTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return Types::STRING; + } +} diff --git a/vendor/doctrine/dbal/src/Types/TextType.php b/vendor/doctrine/dbal/src/Types/TextType.php new file mode 100644 index 00000000..b1e640b6 --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/TextType.php @@ -0,0 +1,38 @@ +getClobTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + return is_resource($value) ? stream_get_contents($value) : $value; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return Types::TEXT; + } +} diff --git a/vendor/doctrine/dbal/src/Types/TimeImmutableType.php b/vendor/doctrine/dbal/src/Types/TimeImmutableType.php new file mode 100644 index 00000000..eef8ba91 --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/TimeImmutableType.php @@ -0,0 +1,80 @@ +format($platform->getTimeFormatString()); + } + + throw ConversionException::conversionFailedInvalidType( + $value, + $this->getName(), + ['null', DateTimeImmutable::class], + ); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null || $value instanceof DateTimeImmutable) { + return $value; + } + + $dateTime = DateTimeImmutable::createFromFormat('!' . $platform->getTimeFormatString(), $value); + + if ($dateTime === false) { + throw ConversionException::conversionFailedFormat( + $value, + $this->getName(), + $platform->getTimeFormatString(), + ); + } + + return $dateTime; + } + + /** + * {@inheritdoc} + * + * @deprecated + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5509', + '%s is deprecated.', + __METHOD__, + ); + + return true; + } +} diff --git a/vendor/doctrine/dbal/src/Types/TimeType.php b/vendor/doctrine/dbal/src/Types/TimeType.php new file mode 100644 index 00000000..9c8f03e9 --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/TimeType.php @@ -0,0 +1,66 @@ +getTimeTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToDatabaseValue($value, AbstractPlatform $platform) + { + if ($value === null) { + return $value; + } + + if ($value instanceof DateTimeInterface) { + return $value->format($platform->getTimeFormatString()); + } + + throw ConversionException::conversionFailedInvalidType($value, $this->getName(), ['null', 'DateTime']); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null || $value instanceof DateTimeInterface) { + return $value; + } + + $val = DateTime::createFromFormat('!' . $platform->getTimeFormatString(), $value); + if ($val === false) { + throw ConversionException::conversionFailedFormat( + $value, + $this->getName(), + $platform->getTimeFormatString(), + ); + } + + return $val; + } +} diff --git a/vendor/doctrine/dbal/src/Types/Type.php b/vendor/doctrine/dbal/src/Types/Type.php new file mode 100644 index 00000000..536cf36f --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/Type.php @@ -0,0 +1,285 @@ + ArrayType::class, + Types::ASCII_STRING => AsciiStringType::class, + Types::BIGINT => BigIntType::class, + Types::BINARY => BinaryType::class, + Types::BLOB => BlobType::class, + Types::BOOLEAN => BooleanType::class, + Types::DATE_MUTABLE => DateType::class, + Types::DATE_IMMUTABLE => DateImmutableType::class, + Types::DATEINTERVAL => DateIntervalType::class, + Types::DATETIME_MUTABLE => DateTimeType::class, + Types::DATETIME_IMMUTABLE => DateTimeImmutableType::class, + Types::DATETIMETZ_MUTABLE => DateTimeTzType::class, + Types::DATETIMETZ_IMMUTABLE => DateTimeTzImmutableType::class, + Types::DECIMAL => DecimalType::class, + Types::FLOAT => FloatType::class, + Types::GUID => GuidType::class, + Types::INTEGER => IntegerType::class, + Types::JSON => JsonType::class, + Types::OBJECT => ObjectType::class, + Types::SIMPLE_ARRAY => SimpleArrayType::class, + Types::SMALLINT => SmallIntType::class, + Types::STRING => StringType::class, + Types::TEXT => TextType::class, + Types::TIME_MUTABLE => TimeType::class, + Types::TIME_IMMUTABLE => TimeImmutableType::class, + ]; + + private static ?TypeRegistry $typeRegistry = null; + + /** @internal Do not instantiate directly - use {@see Type::addType()} method instead. */ + final public function __construct() + { + } + + /** + * Converts a value from its PHP representation to its database representation + * of this type. + * + * @param mixed $value The value to convert. + * @param AbstractPlatform $platform The currently used database platform. + * + * @return mixed The database representation of the value. + * + * @throws ConversionException + */ + public function convertToDatabaseValue($value, AbstractPlatform $platform) + { + return $value; + } + + /** + * Converts a value from its database representation to its PHP representation + * of this type. + * + * @param mixed $value The value to convert. + * @param AbstractPlatform $platform The currently used database platform. + * + * @return mixed The PHP representation of the value. + * + * @throws ConversionException + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + return $value; + } + + /** + * Gets the SQL declaration snippet for a column of this type. + * + * @param mixed[] $column The column definition + * @param AbstractPlatform $platform The currently used database platform. + * + * @return string + */ + abstract public function getSQLDeclaration(array $column, AbstractPlatform $platform); + + /** + * Gets the name of this type. + * + * @deprecated this method will be removed in Doctrine DBAL 4.0. + * + * @return string + */ + abstract public function getName(); + + final public static function getTypeRegistry(): TypeRegistry + { + return self::$typeRegistry ??= self::createTypeRegistry(); + } + + private static function createTypeRegistry(): TypeRegistry + { + $instances = []; + + foreach (self::BUILTIN_TYPES_MAP as $name => $class) { + $instances[$name] = new $class(); + } + + return new TypeRegistry($instances); + } + + /** + * Factory method to create type instances. + * Type instances are implemented as flyweights. + * + * @param string $name The name of the type (as returned by getName()). + * + * @return Type + * + * @throws Exception + */ + public static function getType($name) + { + return self::getTypeRegistry()->get($name); + } + + /** + * Adds a custom type to the type map. + * + * @param string $name The name of the type. This should correspond to what getName() returns. + * @param class-string $className The class name of the custom type. + * + * @return void + * + * @throws Exception + */ + public static function addType($name, $className) + { + self::getTypeRegistry()->register($name, new $className()); + } + + /** + * Checks if exists support for a type. + * + * @param string $name The name of the type. + * + * @return bool TRUE if type is supported; FALSE otherwise. + */ + public static function hasType($name) + { + return self::getTypeRegistry()->has($name); + } + + /** + * Overrides an already defined type to use a different implementation. + * + * @param string $name + * @param class-string $className + * + * @return void + * + * @throws Exception + */ + public static function overrideType($name, $className) + { + self::getTypeRegistry()->override($name, new $className()); + } + + /** + * Gets the (preferred) binding type for values of this type that + * can be used when binding parameters to prepared statements. + * + * This method should return one of the {@see ParameterType} constants. + * + * @return int + */ + public function getBindingType() + { + return ParameterType::STRING; + } + + /** + * Gets the types array map which holds all registered types and the corresponding + * type class + * + * @return array + */ + public static function getTypesMap() + { + return array_map( + static function (Type $type): string { + return get_class($type); + }, + self::getTypeRegistry()->getMap(), + ); + } + + /** + * Does working with this column require SQL conversion functions? + * + * This is a metadata function that is required for example in the ORM. + * Usage of {@see convertToDatabaseValueSQL} and + * {@see convertToPHPValueSQL} works for any type and mostly + * does nothing. This method can additionally be used for optimization purposes. + * + * @deprecated Consumers should call {@see convertToDatabaseValueSQL} and {@see convertToPHPValueSQL} + * regardless of the type. + * + * @return bool + */ + public function canRequireSQLConversion() + { + return false; + } + + /** + * Modifies the SQL expression (identifier, parameter) to convert to a database value. + * + * @param string $sqlExpr + * + * @return string + */ + public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform) + { + return $sqlExpr; + } + + /** + * Modifies the SQL expression (identifier, parameter) to convert to a PHP value. + * + * @param string $sqlExpr + * @param AbstractPlatform $platform + * + * @return string + */ + public function convertToPHPValueSQL($sqlExpr, $platform) + { + return $sqlExpr; + } + + /** + * Gets an array of database types that map to this Doctrine type. + * + * @return string[] + */ + public function getMappedDatabaseTypes(AbstractPlatform $platform) + { + return []; + } + + /** + * If this Doctrine Type maps to an already mapped database type, + * reverse schema engineering can't tell them apart. You need to mark + * one of those types as commented, which will have Doctrine use an SQL + * comment to typehint the actual Doctrine Type. + * + * @deprecated + * + * @return bool + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5509', + '%s is deprecated.', + __METHOD__, + ); + + return false; + } +} diff --git a/vendor/doctrine/dbal/src/Types/TypeRegistry.php b/vendor/doctrine/dbal/src/Types/TypeRegistry.php new file mode 100644 index 00000000..b5e800ad --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/TypeRegistry.php @@ -0,0 +1,123 @@ + Map of type names and their corresponding flyweight objects. */ + private array $instances; + + /** @param array $instances */ + public function __construct(array $instances = []) + { + $this->instances = $instances; + } + + /** + * Finds a type by the given name. + * + * @throws Exception + */ + public function get(string $name): Type + { + if (! isset($this->instances[$name])) { + throw Exception::unknownColumnType($name); + } + + return $this->instances[$name]; + } + + /** + * Finds a name for the given type. + * + * @throws Exception + */ + public function lookupName(Type $type): string + { + $name = $this->findTypeName($type); + + if ($name === null) { + throw Exception::typeNotRegistered($type); + } + + return $name; + } + + /** + * Checks if there is a type of the given name. + */ + public function has(string $name): bool + { + return isset($this->instances[$name]); + } + + /** + * Registers a custom type to the type map. + * + * @throws Exception + */ + public function register(string $name, Type $type): void + { + if (isset($this->instances[$name])) { + throw Exception::typeExists($name); + } + + if ($this->findTypeName($type) !== null) { + throw Exception::typeAlreadyRegistered($type); + } + + $this->instances[$name] = $type; + } + + /** + * Overrides an already defined type to use a different implementation. + * + * @throws Exception + */ + public function override(string $name, Type $type): void + { + if (! isset($this->instances[$name])) { + throw Exception::typeNotFound($name); + } + + if (! in_array($this->findTypeName($type), [$name, null], true)) { + throw Exception::typeAlreadyRegistered($type); + } + + $this->instances[$name] = $type; + } + + /** + * Gets the map of all registered types and their corresponding type instances. + * + * @internal + * + * @return array + */ + public function getMap(): array + { + return $this->instances; + } + + private function findTypeName(Type $type): ?string + { + $name = array_search($type, $this->instances, true); + + if ($name === false) { + return null; + } + + return $name; + } +} diff --git a/vendor/doctrine/dbal/src/Types/Types.php b/vendor/doctrine/dbal/src/Types/Types.php new file mode 100644 index 00000000..54b0dfec --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/Types.php @@ -0,0 +1,47 @@ +format($platform->getDateTimeFormatString()); + } + + throw ConversionException::conversionFailedInvalidType( + $value, + $this->getName(), + ['null', DateTimeImmutable::class], + ); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null || $value instanceof DateTimeImmutable) { + return $value; + } + + $dateTime = date_create_immutable($value); + + if ($dateTime === false) { + throw ConversionException::conversionFailed($value, $this->getName()); + } + + return $dateTime; + } + + /** + * {@inheritdoc} + * + * @deprecated + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/5509', + '%s is deprecated.', + __METHOD__, + ); + + return true; + } +} diff --git a/vendor/doctrine/dbal/src/Types/VarDateTimeType.php b/vendor/doctrine/dbal/src/Types/VarDateTimeType.php new file mode 100644 index 00000000..b11ef287 --- /dev/null +++ b/vendor/doctrine/dbal/src/Types/VarDateTimeType.php @@ -0,0 +1,35 @@ + 0 it is necessary to use this type. + */ +class VarDateTimeType extends DateTimeType +{ + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null || $value instanceof DateTime) { + return $value; + } + + $val = date_create($value); + if ($val === false) { + throw ConversionException::conversionFailed($value, $this->getName()); + } + + return $val; + } +} diff --git a/vendor/doctrine/dbal/src/VersionAwarePlatformDriver.php b/vendor/doctrine/dbal/src/VersionAwarePlatformDriver.php new file mode 100644 index 00000000..ffcfcd63 --- /dev/null +++ b/vendor/doctrine/dbal/src/VersionAwarePlatformDriver.php @@ -0,0 +1,30 @@ + MyConnection::class, + ]); +} diff --git a/vendor/doctrine/deprecations/LICENSE b/vendor/doctrine/deprecations/LICENSE new file mode 100644 index 00000000..156905cd --- /dev/null +++ b/vendor/doctrine/deprecations/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2020-2021 Doctrine Project + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/doctrine/deprecations/README.md b/vendor/doctrine/deprecations/README.md new file mode 100644 index 00000000..22f0cced --- /dev/null +++ b/vendor/doctrine/deprecations/README.md @@ -0,0 +1,154 @@ +# Doctrine Deprecations + +A small (side-effect free by default) layer on top of +`trigger_error(E_USER_DEPRECATED)` or PSR-3 logging. + +- no side-effects by default, making it a perfect fit for libraries that don't know how the error handler works they operate under +- options to avoid having to rely on error handlers global state by using PSR-3 logging +- deduplicate deprecation messages to avoid excessive triggering and reduce overhead + +We recommend to collect Deprecations using a PSR logger instead of relying on +the global error handler. + +## Usage from consumer perspective: + +Enable Doctrine deprecations to be sent to a PSR3 logger: + +```php +\Doctrine\Deprecations\Deprecation::enableWithPsrLogger($logger); +``` + +Enable Doctrine deprecations to be sent as `@trigger_error($message, E_USER_DEPRECATED)` +messages. + +```php +\Doctrine\Deprecations\Deprecation::enableWithTriggerError(); +``` + +If you only want to enable deprecation tracking, without logging or calling `trigger_error` then call: + +```php +\Doctrine\Deprecations\Deprecation::enableTrackingDeprecations(); +``` + +Tracking is enabled with all three modes and provides access to all triggered +deprecations and their individual count: + +```php +$deprecations = \Doctrine\Deprecations\Deprecation::getTriggeredDeprecations(); + +foreach ($deprecations as $identifier => $count) { + echo $identifier . " was triggered " . $count . " times\n"; +} +``` + +### Suppressing Specific Deprecations + +Disable triggering about specific deprecations: + +```php +\Doctrine\Deprecations\Deprecation::ignoreDeprecations("https://link/to/deprecations-description-identifier"); +``` + +Disable all deprecations from a package + +```php +\Doctrine\Deprecations\Deprecation::ignorePackage("doctrine/orm"); +``` + +### Other Operations + +When used within PHPUnit or other tools that could collect multiple instances of the same deprecations +the deduplication can be disabled: + +```php +\Doctrine\Deprecations\Deprecation::withoutDeduplication(); +``` + +Disable deprecation tracking again: + +```php +\Doctrine\Deprecations\Deprecation::disable(); +``` + +## Usage from a library/producer perspective: + +When you want to unconditionally trigger a deprecation even when called +from the library itself then the `trigger` method is the way to go: + +```php +\Doctrine\Deprecations\Deprecation::trigger( + "doctrine/orm", + "https://link/to/deprecations-description", + "message" +); +``` + +If variable arguments are provided at the end, they are used with `sprintf` on +the message. + +```php +\Doctrine\Deprecations\Deprecation::trigger( + "doctrine/orm", + "https://github.com/doctrine/orm/issue/1234", + "message %s %d", + "foo", + 1234 +); +``` + +When you want to trigger a deprecation only when it is called by a function +outside of the current package, but not trigger when the package itself is the cause, +then use: + +```php +\Doctrine\Deprecations\Deprecation::triggerIfCalledFromOutside( + "doctrine/orm", + "https://link/to/deprecations-description", + "message" +); +``` + +Based on the issue link each deprecation message is only triggered once per +request. + +A limited stacktrace is included in the deprecation message to find the +offending location. + +Note: A producer/library should never call `Deprecation::enableWith` methods +and leave the decision how to handle deprecations to application and +frameworks. + +## Usage in PHPUnit tests + +There is a `VerifyDeprecations` trait that you can use to make assertions on +the occurrence of deprecations within a test. + +```php +use Doctrine\Deprecations\PHPUnit\VerifyDeprecations; + +class MyTest extends TestCase +{ + use VerifyDeprecations; + + public function testSomethingDeprecation() + { + $this->expectDeprecationWithIdentifier('https://github.com/doctrine/orm/issue/1234'); + + triggerTheCodeWithDeprecation(); + } + + public function testSomethingDeprecationFixed() + { + $this->expectNoDeprecationWithIdentifier('https://github.com/doctrine/orm/issue/1234'); + + triggerTheCodeWithoutDeprecation(); + } +} +``` + +## What is a deprecation identifier? + +An identifier for deprecations is just a link to any resource, most often a +Github Issue or Pull Request explaining the deprecation and potentially its +alternative. diff --git a/vendor/doctrine/deprecations/composer.json b/vendor/doctrine/deprecations/composer.json new file mode 100644 index 00000000..c79e38cd --- /dev/null +++ b/vendor/doctrine/deprecations/composer.json @@ -0,0 +1,32 @@ +{ + "name": "doctrine/deprecations", + "type": "library", + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "license": "MIT", + "require": { + "php": "^7.1|^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.5|^8.5|^9.5", + "psr/log": "^1|^2|^3", + "doctrine/coding-standard": "^9" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "autoload": { + "psr-4": {"Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations"} + }, + "autoload-dev": { + "psr-4": { + "DeprecationTests\\": "test_fixtures/src", + "Doctrine\\Foo\\": "test_fixtures/vendor/doctrine/foo" + } + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } + } +} diff --git a/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php b/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php new file mode 100644 index 00000000..1029372f --- /dev/null +++ b/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php @@ -0,0 +1,266 @@ + */ + private static $ignoredPackages = []; + + /** @var array */ + private static $ignoredLinks = []; + + /** @var bool */ + private static $deduplication = true; + + /** + * Trigger a deprecation for the given package and identfier. + * + * The link should point to a Github issue or Wiki entry detailing the + * deprecation. It is additionally used to de-duplicate the trigger of the + * same deprecation during a request. + * + * @param mixed $args + */ + public static function trigger(string $package, string $link, string $message, ...$args): void + { + if (self::$type === self::TYPE_NONE) { + return; + } + + if (array_key_exists($link, self::$ignoredLinks)) { + self::$ignoredLinks[$link]++; + } else { + self::$ignoredLinks[$link] = 1; + } + + if (self::$deduplication === true && self::$ignoredLinks[$link] > 1) { + return; + } + + if (isset(self::$ignoredPackages[$package])) { + return; + } + + $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2); + + $message = sprintf($message, ...$args); + + self::delegateTriggerToBackend($message, $backtrace, $link, $package); + } + + /** + * Trigger a deprecation for the given package and identifier when called from outside. + * + * "Outside" means we assume that $package is currently installed as a + * dependency and the caller is not a file in that package. When $package + * is installed as a root package then deprecations triggered from the + * tests folder are also considered "outside". + * + * This deprecation method assumes that you are using Composer to install + * the dependency and are using the default /vendor/ folder and not a + * Composer plugin to change the install location. The assumption is also + * that $package is the exact composer packge name. + * + * Compared to {@link trigger()} this method causes some overhead when + * deprecation tracking is enabled even during deduplication, because it + * needs to call {@link debug_backtrace()} + * + * @param mixed $args + */ + public static function triggerIfCalledFromOutside(string $package, string $link, string $message, ...$args): void + { + if (self::$type === self::TYPE_NONE) { + return; + } + + $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2); + + // first check that the caller is not from a tests folder, in which case we always let deprecations pass + if (strpos($backtrace[1]['file'], DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR) === false) { + $path = DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . $package . DIRECTORY_SEPARATOR; + + if (strpos($backtrace[0]['file'], $path) === false) { + return; + } + + if (strpos($backtrace[1]['file'], $path) !== false) { + return; + } + } + + if (array_key_exists($link, self::$ignoredLinks)) { + self::$ignoredLinks[$link]++; + } else { + self::$ignoredLinks[$link] = 1; + } + + if (self::$deduplication === true && self::$ignoredLinks[$link] > 1) { + return; + } + + if (isset(self::$ignoredPackages[$package])) { + return; + } + + $message = sprintf($message, ...$args); + + self::delegateTriggerToBackend($message, $backtrace, $link, $package); + } + + /** + * @param array $backtrace + */ + private static function delegateTriggerToBackend(string $message, array $backtrace, string $link, string $package): void + { + if ((self::$type & self::TYPE_PSR_LOGGER) > 0) { + $context = [ + 'file' => $backtrace[0]['file'], + 'line' => $backtrace[0]['line'], + 'package' => $package, + 'link' => $link, + ]; + + self::$logger->notice($message, $context); + } + + if (! ((self::$type & self::TYPE_TRIGGER_ERROR) > 0)) { + return; + } + + $message .= sprintf( + ' (%s:%d called by %s:%d, %s, package %s)', + self::basename($backtrace[0]['file']), + $backtrace[0]['line'], + self::basename($backtrace[1]['file']), + $backtrace[1]['line'], + $link, + $package + ); + + @trigger_error($message, E_USER_DEPRECATED); + } + + /** + * A non-local-aware version of PHPs basename function. + */ + private static function basename(string $filename): string + { + $pos = strrpos($filename, DIRECTORY_SEPARATOR); + + if ($pos === false) { + return $filename; + } + + return substr($filename, $pos + 1); + } + + public static function enableTrackingDeprecations(): void + { + self::$type |= self::TYPE_TRACK_DEPRECATIONS; + } + + public static function enableWithTriggerError(): void + { + self::$type |= self::TYPE_TRIGGER_ERROR; + } + + public static function enableWithPsrLogger(LoggerInterface $logger): void + { + self::$type |= self::TYPE_PSR_LOGGER; + self::$logger = $logger; + } + + public static function withoutDeduplication(): void + { + self::$deduplication = false; + } + + public static function disable(): void + { + self::$type = self::TYPE_NONE; + self::$logger = null; + self::$deduplication = true; + + foreach (self::$ignoredLinks as $link => $count) { + self::$ignoredLinks[$link] = 0; + } + } + + public static function ignorePackage(string $packageName): void + { + self::$ignoredPackages[$packageName] = true; + } + + public static function ignoreDeprecations(string ...$links): void + { + foreach ($links as $link) { + self::$ignoredLinks[$link] = 0; + } + } + + public static function getUniqueTriggeredDeprecationsCount(): int + { + return array_reduce(self::$ignoredLinks, static function (int $carry, int $count) { + return $carry + $count; + }, 0); + } + + /** + * Returns each triggered deprecation link identifier and the amount of occurrences. + * + * @return array + */ + public static function getTriggeredDeprecations(): array + { + return self::$ignoredLinks; + } +} diff --git a/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/PHPUnit/VerifyDeprecations.php b/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/PHPUnit/VerifyDeprecations.php new file mode 100644 index 00000000..4c3366a9 --- /dev/null +++ b/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/PHPUnit/VerifyDeprecations.php @@ -0,0 +1,66 @@ + */ + private $doctrineDeprecationsExpectations = []; + + /** @var array */ + private $doctrineNoDeprecationsExpectations = []; + + public function expectDeprecationWithIdentifier(string $identifier): void + { + $this->doctrineDeprecationsExpectations[$identifier] = Deprecation::getTriggeredDeprecations()[$identifier] ?? 0; + } + + public function expectNoDeprecationWithIdentifier(string $identifier): void + { + $this->doctrineNoDeprecationsExpectations[$identifier] = Deprecation::getTriggeredDeprecations()[$identifier] ?? 0; + } + + /** + * @before + */ + public function enableDeprecationTracking(): void + { + Deprecation::enableTrackingDeprecations(); + } + + /** + * @after + */ + public function verifyDeprecationsAreTriggered(): void + { + foreach ($this->doctrineDeprecationsExpectations as $identifier => $expectation) { + $actualCount = Deprecation::getTriggeredDeprecations()[$identifier] ?? 0; + + $this->assertTrue( + $actualCount > $expectation, + sprintf( + "Expected deprecation with identifier '%s' was not triggered by code executed in test.", + $identifier + ) + ); + } + + foreach ($this->doctrineNoDeprecationsExpectations as $identifier => $expectation) { + $actualCount = Deprecation::getTriggeredDeprecations()[$identifier] ?? 0; + + $this->assertTrue( + $actualCount === $expectation, + sprintf( + "Expected deprecation with identifier '%s' was triggered by code executed in test, but expected not to.", + $identifier + ) + ); + } + } +} diff --git a/vendor/doctrine/deprecations/phpcs.xml b/vendor/doctrine/deprecations/phpcs.xml new file mode 100644 index 00000000..f115e43d --- /dev/null +++ b/vendor/doctrine/deprecations/phpcs.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + lib + tests + + + + + + diff --git a/vendor/doctrine/event-manager/LICENSE b/vendor/doctrine/event-manager/LICENSE new file mode 100644 index 00000000..8c38cc1b --- /dev/null +++ b/vendor/doctrine/event-manager/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2006-2015 Doctrine Project + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/doctrine/event-manager/README.md b/vendor/doctrine/event-manager/README.md new file mode 100644 index 00000000..5b36f546 --- /dev/null +++ b/vendor/doctrine/event-manager/README.md @@ -0,0 +1,13 @@ +# Doctrine Event Manager + +[![Build Status](https://github.com/doctrine/event-manager/workflows/Continuous%20Integration/badge.svg)](https://github.com/doctrine/event-manager/actions) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/doctrine/event-manager/badges/quality-score.png?b=1.2.x)](https://scrutinizer-ci.com/g/doctrine/event-manager/?branch=1.2.x) +[![Code Coverage](https://scrutinizer-ci.com/g/doctrine/event-manager/badges/coverage.png?b=1.2.x)](https://scrutinizer-ci.com/g/doctrine/event-manager/?branch=1.2.x) + +The Doctrine Event Manager is a library that provides a simple event system. + +## More resources: + +* [Website](https://www.doctrine-project.org/) +* [Documentation](https://www.doctrine-project.org/projects/doctrine-event-manager/en/latest/) +* [Downloads](https://github.com/doctrine/event-manager/releases) diff --git a/vendor/doctrine/event-manager/UPGRADE.md b/vendor/doctrine/event-manager/UPGRADE.md new file mode 100644 index 00000000..c8c8038f --- /dev/null +++ b/vendor/doctrine/event-manager/UPGRADE.md @@ -0,0 +1,7 @@ +# Upgrade to 1.2 + +## Deprecated calling `EventManager::getListeners()` without an event name + +When calling `EventManager::getListeners()` without an event name, all +listeners were returned, keyed by event name. A new method `getAllListeners()` +has been added to provide this functionality. It should be used instead. diff --git a/vendor/doctrine/event-manager/composer.json b/vendor/doctrine/event-manager/composer.json new file mode 100644 index 00000000..deeb7e03 --- /dev/null +++ b/vendor/doctrine/event-manager/composer.json @@ -0,0 +1,69 @@ +{ + "name": "doctrine/event-manager", + "description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.", + "license": "MIT", + "type": "library", + "keywords": [ + "events", + "event", + "event dispatcher", + "event manager", + "event system" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "homepage": "https://www.doctrine-project.org/projects/event-manager.html", + "require": { + "php": "^7.1 || ^8.0", + "doctrine/deprecations": "^0.5.3 || ^1" + }, + "require-dev": { + "doctrine/coding-standard": "^9 || ^10", + "phpstan/phpstan": "~1.4.10 || ^1.8.8", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.24" + }, + "conflict": { + "doctrine/common": "<2.9" + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Doctrine\\Tests\\Common\\": "tests" + } + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + }, + "sort-packages": true + } +} diff --git a/vendor/doctrine/event-manager/phpstan.neon.dist b/vendor/doctrine/event-manager/phpstan.neon.dist new file mode 100644 index 00000000..1517ec8c --- /dev/null +++ b/vendor/doctrine/event-manager/phpstan.neon.dist @@ -0,0 +1,5 @@ +parameters: + level: 9 + paths: + - src/ + - tests/ diff --git a/vendor/doctrine/event-manager/psalm.xml b/vendor/doctrine/event-manager/psalm.xml new file mode 100644 index 00000000..4e9226bd --- /dev/null +++ b/vendor/doctrine/event-manager/psalm.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/vendor/doctrine/event-manager/src/EventArgs.php b/vendor/doctrine/event-manager/src/EventArgs.php new file mode 100644 index 00000000..4795ba6b --- /dev/null +++ b/vendor/doctrine/event-manager/src/EventArgs.php @@ -0,0 +1,45 @@ + => + * + * @var array + */ + private $listeners = []; + + /** + * Dispatches an event to all registered listeners. + * + * @param string $eventName The name of the event to dispatch. The name of the event is + * the name of the method that is invoked on listeners. + * @param EventArgs|null $eventArgs The event arguments to pass to the event handlers/listeners. + * If not supplied, the single empty EventArgs instance is used. + * + * @return void + */ + public function dispatchEvent($eventName, ?EventArgs $eventArgs = null) + { + if (! isset($this->listeners[$eventName])) { + return; + } + + $eventArgs = $eventArgs ?? EventArgs::getEmptyInstance(); + + foreach ($this->listeners[$eventName] as $listener) { + $listener->$eventName($eventArgs); + } + } + + /** + * Gets the listeners of a specific event. + * + * @param string|null $event The name of the event. + * + * @return object[]|array The event listeners for the specified event, or all event listeners. + * @psalm-return ($event is null ? array : object[]) + */ + public function getListeners($event = null) + { + if ($event === null) { + Deprecation::trigger( + 'doctrine/event-manager', + 'https://github.com/doctrine/event-manager/pull/50', + 'Calling %s without an event name is deprecated. Call getAllListeners() instead.', + __METHOD__ + ); + + return $this->getAllListeners(); + } + + return $this->listeners[$event] ?? []; + } + + /** + * Gets all listeners keyed by event name. + * + * @return array The event listeners for the specified event, or all event listeners. + */ + public function getAllListeners(): array + { + return $this->listeners; + } + + /** + * Checks whether an event has any registered listeners. + * + * @param string $event + * + * @return bool TRUE if the specified event has any listeners, FALSE otherwise. + */ + public function hasListeners($event) + { + return ! empty($this->listeners[$event]); + } + + /** + * Adds an event listener that listens on the specified events. + * + * @param string|string[] $events The event(s) to listen on. + * @param object $listener The listener object. + * + * @return void + */ + public function addEventListener($events, $listener) + { + // Picks the hash code related to that listener + $hash = spl_object_hash($listener); + + foreach ((array) $events as $event) { + // Overrides listener if a previous one was associated already + // Prevents duplicate listeners on same event (same instance only) + $this->listeners[$event][$hash] = $listener; + } + } + + /** + * Removes an event listener from the specified events. + * + * @param string|string[] $events + * @param object $listener + * + * @return void + */ + public function removeEventListener($events, $listener) + { + // Picks the hash code related to that listener + $hash = spl_object_hash($listener); + + foreach ((array) $events as $event) { + unset($this->listeners[$event][$hash]); + } + } + + /** + * Adds an EventSubscriber. The subscriber is asked for all the events it is + * interested in and added as a listener for these events. + * + * @param EventSubscriber $subscriber The subscriber. + * + * @return void + */ + public function addEventSubscriber(EventSubscriber $subscriber) + { + $this->addEventListener($subscriber->getSubscribedEvents(), $subscriber); + } + + /** + * Removes an EventSubscriber. The subscriber is asked for all the events it is + * interested in and removed as a listener for these events. + * + * @param EventSubscriber $subscriber The subscriber. + * + * @return void + */ + public function removeEventSubscriber(EventSubscriber $subscriber) + { + $this->removeEventListener($subscriber->getSubscribedEvents(), $subscriber); + } +} diff --git a/vendor/doctrine/event-manager/src/EventSubscriber.php b/vendor/doctrine/event-manager/src/EventSubscriber.php new file mode 100644 index 00000000..89cef558 --- /dev/null +++ b/vendor/doctrine/event-manager/src/EventSubscriber.php @@ -0,0 +1,21 @@ +fqsen = $fqsen; + + if (isset($matches[2])) { + $this->name = $matches[2]; + } else { + $matches = explode('\\', $fqsen); + $name = end($matches); + assert(is_string($name)); + $this->name = trim($name, '()'); + } + } + + /** + * converts this class to string. + */ + public function __toString() : string + { + return $this->fqsen; + } + + /** + * Returns the name of the element without path. + */ + public function getName() : string + { + return $this->name; + } +} diff --git a/vendor/phpdocumentor/reflection-common/src/Location.php b/vendor/phpdocumentor/reflection-common/src/Location.php new file mode 100644 index 00000000..177deede --- /dev/null +++ b/vendor/phpdocumentor/reflection-common/src/Location.php @@ -0,0 +1,53 @@ +lineNumber = $lineNumber; + $this->columnNumber = $columnNumber; + } + + /** + * Returns the line number that is covered by this location. + */ + public function getLineNumber() : int + { + return $this->lineNumber; + } + + /** + * Returns the column number (character position on a line) for this location object. + */ + public function getColumnNumber() : int + { + return $this->columnNumber; + } +} diff --git a/vendor/phpdocumentor/reflection-common/src/Project.php b/vendor/phpdocumentor/reflection-common/src/Project.php new file mode 100644 index 00000000..57839fd1 --- /dev/null +++ b/vendor/phpdocumentor/reflection-common/src/Project.php @@ -0,0 +1,25 @@ + please note that if you want to pass partial class names that additional steps are necessary, see the + > chapter `Resolving partial classes and FQSENs` for more information. + +Where the FqsenResolver can resolve: + +- Constant expressions (i.e. `@see \MyNamespace\MY_CONSTANT`) +- Function expressions (i.e. `@see \MyNamespace\myFunction()`) +- Class expressions (i.e. `@see \MyNamespace\MyClass`) +- Interface expressions (i.e. `@see \MyNamespace\MyInterface`) +- Trait expressions (i.e. `@see \MyNamespace\MyTrait`) +- Class constant expressions (i.e. `@see \MyNamespace\MyClass::MY_CONSTANT`) +- Property expressions (i.e. `@see \MyNamespace\MyClass::$myProperty`) +- Method expressions (i.e. `@see \MyNamespace\MyClass::myMethod()`) + +## Resolving a type + +In order to resolve a type you will have to instantiate the class `\phpDocumentor\Reflection\TypeResolver` and call its `resolve` method like this: + +```php +$typeResolver = new \phpDocumentor\Reflection\TypeResolver(); +$type = $typeResolver->resolve('string|integer'); +``` + +In this example you will receive a Value Object of class `\phpDocumentor\Reflection\Types\Compound` that has two +elements, one of type `\phpDocumentor\Reflection\Types\String_` and one of type +`\phpDocumentor\Reflection\Types\Integer`. + +The real power of this resolver is in its capability to expand partial class names into fully qualified class names; but in order to do that we need an additional `\phpDocumentor\Reflection\Types\Context` class that will inform the resolver in which namespace the given expression occurs and which namespace aliases (or imports) apply. + +### Resolving nullable types + +Php 7.1 introduced nullable types e.g. `?string`. Type resolver will resolve the original type without the nullable notation `?` +just like it would do without the `?`. After that the type is wrapped in a `\phpDocumentor\Reflection\Types\Nullable` object. +The `Nullable` type has a method to fetch the actual type. + +## Resolving an FQSEN + +A Fully Qualified Structural Element Name is a reference to another element in your code bases and can be resolved using the `\phpDocumentor\Reflection\FqsenResolver` class' `resolve` method, like this: + +```php +$fqsenResolver = new \phpDocumentor\Reflection\FqsenResolver(); +$fqsen = $fqsenResolver->resolve('\phpDocumentor\Reflection\FqsenResolver::resolve()'); +``` + +In this example we resolve a Fully Qualified Structural Element Name (meaning that it includes the full namespace, class name and element name) and receive a Value Object of type `\phpDocumentor\Reflection\Fqsen`. + +The real power of this resolver is in its capability to expand partial element names into Fully Qualified Structural Element Names; but in order to do that we need an additional `\phpDocumentor\Reflection\Types\Context` class that will inform the resolver in which namespace the given expression occurs and which namespace aliases (or imports) apply. + +## Resolving partial Classes and Structural Element Names + +Perhaps the best feature of this library is that it knows how to resolve partial class names into fully qualified class names. + +For example, you have this file: + +```php +namespace My\Example; + +use phpDocumentor\Reflection\Types; + +class Classy +{ + /** + * @var Types\Context + * @see Classy::otherFunction() + */ + public function __construct($context) {} + + public function otherFunction(){} +} +``` + +Suppose that you would want to resolve (and expand) the type in the `@var` tag and the element name in the `@see` tag. + +For the resolvers to know how to expand partial names you have to provide a bit of _Context_ for them by instantiating a new class named `\phpDocumentor\Reflection\Types\Context` with the name of the namespace and the aliases that are in play. + +### Creating a Context + +You can do this by manually creating a Context like this: + +```php +$context = new \phpDocumentor\Reflection\Types\Context( + '\My\Example', + [ 'Types' => '\phpDocumentor\Reflection\Types'] +); +``` + +Or by using the `\phpDocumentor\Reflection\Types\ContextFactory` to instantiate a new context based on a Reflector object or by providing the namespace that you'd like to extract and the source code of the file in which the given type expression occurs. + +```php +$contextFactory = new \phpDocumentor\Reflection\Types\ContextFactory(); +$context = $contextFactory->createFromReflector(new ReflectionMethod('\My\Example\Classy', '__construct')); +``` + +or + +```php +$contextFactory = new \phpDocumentor\Reflection\Types\ContextFactory(); +$context = $contextFactory->createForNamespace('\My\Example', file_get_contents('My/Example/Classy.php')); +``` + +### Using the Context + +After you have obtained a Context it is just a matter of passing it along with the `resolve` method of either Resolver class as second argument and the Resolvers will take this into account when resolving partial names. + +To obtain the resolved class name for the `@var` tag in the example above you can do: + +```php +$typeResolver = new \phpDocumentor\Reflection\TypeResolver(); +$type = $typeResolver->resolve('Types\Context', $context); +``` + +When you do this you will receive an object of class `\phpDocumentor\Reflection\Types\Object_` for which you can call the `getFqsen` method to receive a Value Object that represents the complete FQSEN. So that would be `phpDocumentor\Reflection\Types\Context`. + +> Why is the FQSEN wrapped in another object `Object_`? +> +> The resolve method of the TypeResolver only returns object with the interface `Type` and the FQSEN is a common type that does not represent a Type. Also: in some cases a type can represent an "Untyped Object", meaning that it is an object (signified by the `object` keyword) but does not refer to a specific element using an FQSEN. + +Another example is on how to resolve the FQSEN of a method as can be seen with the `@see` tag in the example above. To resolve that you can do the following: + +```php +$fqsenResolver = new \phpDocumentor\Reflection\FqsenResolver(); +$type = $fqsenResolver->resolve('Classy::otherFunction()', $context); +``` + +Because Classy is a Class in the current namespace its FQSEN will have the `My\Example` namespace and by calling the `resolve` method of the FQSEN Resolver you will receive an `Fqsen` object that refers to `\My\Example\Classy::otherFunction()`. diff --git a/vendor/phpdocumentor/type-resolver/composer-require-checker.json b/vendor/phpdocumentor/type-resolver/composer-require-checker.json new file mode 100644 index 00000000..137522df --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/composer-require-checker.json @@ -0,0 +1,16 @@ +{ + "symbol-whitelist" : [ + "null", "true", "false", + "static", "self", "parent", + "array", "string", "int", "float", "bool", "iterable", "callable", "void", "object", "XSLTProcessor", + "T_NAME_QUALIFIED", "T_NAME_FULLY_QUALIFIED" + ], + "php-core-extensions" : [ + "Core", + "pcre", + "Reflection", + "tokenizer", + "SPL", + "standard" + ] +} diff --git a/vendor/phpdocumentor/type-resolver/composer.json b/vendor/phpdocumentor/type-resolver/composer.json new file mode 100644 index 00000000..a7ae10f6 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/composer.json @@ -0,0 +1,48 @@ +{ + "name": "phpdocumentor/type-resolver", + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "type": "library", + "license": "MIT", + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "require": { + "php": "^7.4 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "*", + "phpunit/phpunit": "^9.5", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/extension-installer": "^1.1", + "vimeo/psalm": "^4.25", + "rector/rector": "^0.13.9" + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "phpDocumentor\\Reflection\\": ["tests/unit", "tests/benchmark"] + } + }, + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, + "config": { + "platform": { + "php": "7.4.0" + }, + "allow-plugins": { + "phpstan/extension-installer": true + } + } +} diff --git a/vendor/phpdocumentor/type-resolver/rector.php b/vendor/phpdocumentor/type-resolver/rector.php new file mode 100644 index 00000000..b285d6cf --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/rector.php @@ -0,0 +1,26 @@ +paths([ + __DIR__ . '/src', + __DIR__ . '/tests/unit' + ]); + + // register a single rule + $rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class); + $rectorConfig->rule(Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector::class); + $rectorConfig->rule(Rector\TypeDeclaration\Rector\Closure\AddClosureReturnTypeRector::class); + $rectorConfig->rule(Rector\PHPUnit\Rector\Class_\AddProphecyTraitRector::class); + $rectorConfig->importNames(); + + // define sets of rules + $rectorConfig->sets([ + LevelSetList::UP_TO_PHP_74 + ]); +}; diff --git a/vendor/phpdocumentor/type-resolver/src/FqsenResolver.php b/vendor/phpdocumentor/type-resolver/src/FqsenResolver.php new file mode 100644 index 00000000..068fa208 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/FqsenResolver.php @@ -0,0 +1,80 @@ +isFqsen($fqsen)) { + return new Fqsen($fqsen); + } + + return $this->resolvePartialStructuralElementName($fqsen, $context); + } + + /** + * Tests whether the given type is a Fully Qualified Structural Element Name. + */ + private function isFqsen(string $type): bool + { + return strpos($type, self::OPERATOR_NAMESPACE) === 0; + } + + /** + * Resolves a partial Structural Element Name (i.e. `Reflection\DocBlock`) to its FQSEN representation + * (i.e. `\phpDocumentor\Reflection\DocBlock`) based on the Namespace and aliases mentioned in the Context. + * + * @throws InvalidArgumentException When type is not a valid FQSEN. + */ + private function resolvePartialStructuralElementName(string $type, Context $context): Fqsen + { + $typeParts = explode(self::OPERATOR_NAMESPACE, $type, 2); + + $namespaceAliases = $context->getNamespaceAliases(); + + // if the first segment is not an alias; prepend namespace name and return + if (!isset($namespaceAliases[$typeParts[0]])) { + $namespace = $context->getNamespace(); + if ($namespace !== '') { + $namespace .= self::OPERATOR_NAMESPACE; + } + + return new Fqsen(self::OPERATOR_NAMESPACE . $namespace . $type); + } + + $typeParts[0] = $namespaceAliases[$typeParts[0]]; + + return new Fqsen(self::OPERATOR_NAMESPACE . implode(self::OPERATOR_NAMESPACE, $typeParts)); + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/PseudoType.php b/vendor/phpdocumentor/type-resolver/src/PseudoType.php new file mode 100644 index 00000000..dd91ed79 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/PseudoType.php @@ -0,0 +1,19 @@ +minValue = $minValue; + $this->maxValue = $maxValue; + } + + public function underlyingType(): Type + { + return new Integer(); + } + + public function getMinValue(): string + { + return $this->minValue; + } + + public function getMaxValue(): string + { + return $this->maxValue; + } + + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + */ + public function __toString(): string + { + return 'int<' . $this->minValue . ', ' . $this->maxValue . '>'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/PseudoTypes/List_.php b/vendor/phpdocumentor/type-resolver/src/PseudoTypes/List_.php new file mode 100644 index 00000000..f9f0c6b5 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/PseudoTypes/List_.php @@ -0,0 +1,50 @@ +valueType instanceof Mixed_) { + return 'list'; + } + + return 'list<' . $this->valueType . '>'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/PseudoTypes/LiteralString.php b/vendor/phpdocumentor/type-resolver/src/PseudoTypes/LiteralString.php new file mode 100644 index 00000000..690f782b --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/PseudoTypes/LiteralString.php @@ -0,0 +1,39 @@ + List of recognized keywords and unto which Value Object they map + * @psalm-var array> + */ + private array $keywords = [ + 'string' => String_::class, + 'class-string' => ClassString::class, + 'interface-string' => InterfaceString::class, + 'html-escaped-string' => HtmlEscapedString::class, + 'lowercase-string' => LowercaseString::class, + 'non-empty-lowercase-string' => NonEmptyLowercaseString::class, + 'non-empty-string' => NonEmptyString::class, + 'numeric-string' => NumericString::class, + 'numeric' => Numeric_::class, + 'trait-string' => TraitString::class, + 'int' => Integer::class, + 'integer' => Integer::class, + 'positive-int' => PositiveInteger::class, + 'negative-int' => NegativeInteger::class, + 'bool' => Boolean::class, + 'boolean' => Boolean::class, + 'real' => Float_::class, + 'float' => Float_::class, + 'double' => Float_::class, + 'object' => Object_::class, + 'mixed' => Mixed_::class, + 'array' => Array_::class, + 'array-key' => ArrayKey::class, + 'resource' => Resource_::class, + 'void' => Void_::class, + 'null' => Null_::class, + 'scalar' => Scalar::class, + 'callback' => Callable_::class, + 'callable' => Callable_::class, + 'callable-string' => CallableString::class, + 'false' => False_::class, + 'true' => True_::class, + 'literal-string' => LiteralString::class, + 'self' => Self_::class, + '$this' => This::class, + 'static' => Static_::class, + 'parent' => Parent_::class, + 'iterable' => Iterable_::class, + 'never' => Never_::class, + 'list' => List_::class, + ]; + + /** @psalm-readonly */ + private FqsenResolver $fqsenResolver; + + /** + * Initializes this TypeResolver with the means to create and resolve Fqsen objects. + */ + public function __construct(?FqsenResolver $fqsenResolver = null) + { + $this->fqsenResolver = $fqsenResolver ?: new FqsenResolver(); + } + + /** + * Analyzes the given type and returns the FQCN variant. + * + * When a type is provided this method checks whether it is not a keyword or + * Fully Qualified Class Name. If so it will use the given namespace and + * aliases to expand the type to a FQCN representation. + * + * This method only works as expected if the namespace and aliases are set; + * no dynamic reflection is being performed here. + * + * @uses Context::getNamespaceAliases() to check whether the first part of the relative type name should not be + * replaced with another namespace. + * @uses Context::getNamespace() to determine with what to prefix the type name. + * + * @param string $type The relative or absolute type. + */ + public function resolve(string $type, ?Context $context = null): Type + { + $type = trim($type); + if (!$type) { + throw new InvalidArgumentException('Attempted to resolve "' . $type . '" but it appears to be empty'); + } + + if ($context === null) { + $context = new Context(''); + } + + // split the type string into tokens `|`, `?`, `<`, `>`, `,`, `(`, `)`, `[]`, '<', '>' and type names + $tokens = preg_split( + '/(\\||\\?|<|>|&|, ?|\\(|\\)|\\[\\]+)/', + $type, + -1, + PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE + ); + + if ($tokens === false) { + throw new InvalidArgumentException('Unable to split the type string "' . $type . '" into tokens'); + } + + /** @var ArrayIterator $tokenIterator */ + $tokenIterator = new ArrayIterator($tokens); + + return $this->parseTypes($tokenIterator, $context, self::PARSER_IN_COMPOUND); + } + + /** + * Analyse each tokens and creates types + * + * @param ArrayIterator $tokens the iterator on tokens + * @param int $parserContext on of self::PARSER_* constants, indicating + * the context where we are in the parsing + */ + private function parseTypes(ArrayIterator $tokens, Context $context, int $parserContext): Type + { + $types = []; + $token = ''; + $compoundToken = '|'; + while ($tokens->valid()) { + $token = $tokens->current(); + if ($token === null) { + throw new RuntimeException( + 'Unexpected nullable character' + ); + } + + if ($token === '|' || $token === '&') { + if (count($types) === 0) { + throw new RuntimeException( + 'A type is missing before a type separator' + ); + } + + if ( + !in_array($parserContext, [ + self::PARSER_IN_COMPOUND, + self::PARSER_IN_ARRAY_EXPRESSION, + self::PARSER_IN_COLLECTION_EXPRESSION, + self::PARSER_IN_NULLABLE, + ], true) + ) { + throw new RuntimeException( + 'Unexpected type separator' + ); + } + + $compoundToken = $token; + $tokens->next(); + } elseif ($token === '?') { + if ( + !in_array($parserContext, [ + self::PARSER_IN_COMPOUND, + self::PARSER_IN_ARRAY_EXPRESSION, + self::PARSER_IN_COLLECTION_EXPRESSION, + self::PARSER_IN_NULLABLE, + ], true) + ) { + throw new RuntimeException( + 'Unexpected nullable character' + ); + } + + $tokens->next(); + $type = $this->parseTypes($tokens, $context, self::PARSER_IN_NULLABLE); + $types[] = new Nullable($type); + } elseif ($token === '(') { + $tokens->next(); + $type = $this->parseTypes($tokens, $context, self::PARSER_IN_ARRAY_EXPRESSION); + + $token = $tokens->current(); + if ($token === null) { // Someone did not properly close their array expression .. + break; + } + + $tokens->next(); + + $resolvedType = new Expression($type); + + $types[] = $resolvedType; + } elseif ($parserContext === self::PARSER_IN_ARRAY_EXPRESSION && isset($token[0]) && $token[0] === ')') { + break; + } elseif ($token === '<') { + if (count($types) === 0) { + throw new RuntimeException( + 'Unexpected collection operator "<", class name is missing' + ); + } + + $classType = array_pop($types); + if ($classType !== null) { + if ((string) $classType === 'class-string') { + $types[] = $this->resolveClassString($tokens, $context); + } elseif ((string) $classType === 'int') { + $types[] = $this->resolveIntRange($tokens); + } elseif ((string) $classType === 'interface-string') { + $types[] = $this->resolveInterfaceString($tokens, $context); + } else { + $types[] = $this->resolveCollection($tokens, $classType, $context); + } + } + + $tokens->next(); + } elseif ( + $parserContext === self::PARSER_IN_COLLECTION_EXPRESSION + && ($token === '>' || trim($token) === ',') + ) { + break; + } elseif ($token === self::OPERATOR_ARRAY) { + $last = array_key_last($types); + if ($last === null) { + throw new InvalidArgumentException('Unexpected array operator'); + } + + $lastItem = $types[$last]; + if ($lastItem instanceof Expression) { + $lastItem = $lastItem->getValueType(); + } + + $types[$last] = new Array_($lastItem); + + $tokens->next(); + } else { + $types[] = $this->resolveSingleType($token, $context); + $tokens->next(); + } + } + + if ($token === '|' || $token === '&') { + throw new RuntimeException( + 'A type is missing after a type separator' + ); + } + + if (count($types) === 0) { + if ($parserContext === self::PARSER_IN_NULLABLE) { + throw new RuntimeException( + 'A type is missing after a nullable character' + ); + } + + if ($parserContext === self::PARSER_IN_ARRAY_EXPRESSION) { + throw new RuntimeException( + 'A type is missing in an array expression' + ); + } + + if ($parserContext === self::PARSER_IN_COLLECTION_EXPRESSION) { + throw new RuntimeException( + 'A type is missing in a collection expression' + ); + } + } elseif (count($types) === 1) { + return current($types); + } + + if ($compoundToken === '|') { + return new Compound(array_values($types)); + } + + return new Intersection(array_values($types)); + } + + /** + * resolve the given type into a type object + * + * @param string $type the type string, representing a single type + * + * @return Type|Array_|Object_ + * + * @psalm-mutation-free + */ + private function resolveSingleType(string $type, Context $context): object + { + switch (true) { + case $this->isKeyword($type): + return $this->resolveKeyword($type); + + case $this->isFqsen($type): + return $this->resolveTypedObject($type); + + case $this->isPartialStructuralElementName($type): + return $this->resolveTypedObject($type, $context); + + // @codeCoverageIgnoreStart + default: + // I haven't got the foggiest how the logic would come here but added this as a defense. + throw new RuntimeException( + 'Unable to resolve type "' . $type . '", there is no known method to resolve it' + ); + } + + // @codeCoverageIgnoreEnd + } + + /** + * Adds a keyword to the list of Keywords and associates it with a specific Value Object. + * + * @psalm-param class-string $typeClassName + */ + public function addKeyword(string $keyword, string $typeClassName): void + { + if (!class_exists($typeClassName)) { + throw new InvalidArgumentException( + 'The Value Object that needs to be created with a keyword "' . $keyword . '" must be an existing class' + . ' but we could not find the class ' . $typeClassName + ); + } + + $interfaces = class_implements($typeClassName); + if ($interfaces === false) { + throw new InvalidArgumentException( + 'The Value Object that needs to be created with a keyword "' . $keyword . '" must be an existing class' + . ' but we could not find the class ' . $typeClassName + ); + } + + if (!in_array(Type::class, $interfaces, true)) { + throw new InvalidArgumentException( + 'The class "' . $typeClassName . '" must implement the interface "phpDocumentor\Reflection\Type"' + ); + } + + $this->keywords[$keyword] = $typeClassName; + } + + /** + * Detects whether the given type represents a PHPDoc keyword. + * + * @param string $type A relative or absolute type as defined in the phpDocumentor documentation. + * + * @psalm-mutation-free + */ + private function isKeyword(string $type): bool + { + return array_key_exists(strtolower($type), $this->keywords); + } + + /** + * Detects whether the given type represents a relative structural element name. + * + * @param string $type A relative or absolute type as defined in the phpDocumentor documentation. + * + * @psalm-mutation-free + */ + private function isPartialStructuralElementName(string $type): bool + { + return (isset($type[0]) && $type[0] !== self::OPERATOR_NAMESPACE) && !$this->isKeyword($type); + } + + /** + * Tests whether the given type is a Fully Qualified Structural Element Name. + * + * @psalm-mutation-free + */ + private function isFqsen(string $type): bool + { + return strpos($type, self::OPERATOR_NAMESPACE) === 0; + } + + /** + * Resolves the given keyword (such as `string`) into a Type object representing that keyword. + * + * @psalm-mutation-free + */ + private function resolveKeyword(string $type): Type + { + $className = $this->keywords[strtolower($type)]; + + return new $className(); + } + + /** + * Resolves the given FQSEN string into an FQSEN object. + * + * @psalm-mutation-free + */ + private function resolveTypedObject(string $type, ?Context $context = null): Object_ + { + return new Object_($this->fqsenResolver->resolve($type, $context)); + } + + /** + * Resolves class string + * + * @param ArrayIterator $tokens + */ + private function resolveClassString(ArrayIterator $tokens, Context $context): Type + { + $tokens->next(); + + $classType = $this->parseTypes($tokens, $context, self::PARSER_IN_COLLECTION_EXPRESSION); + + if (!$classType instanceof Object_ || $classType->getFqsen() === null) { + throw new RuntimeException( + $classType . ' is not a class string' + ); + } + + $token = $tokens->current(); + if ($token !== '>') { + if (empty($token)) { + throw new RuntimeException( + 'class-string: ">" is missing' + ); + } + + throw new RuntimeException( + 'Unexpected character "' . $token . '", ">" is missing' + ); + } + + return new ClassString($classType->getFqsen()); + } + + /** + * Resolves integer ranges + * + * @param ArrayIterator $tokens + */ + private function resolveIntRange(ArrayIterator $tokens): Type + { + $tokens->next(); + + $token = ''; + $minValue = null; + $maxValue = null; + $commaFound = false; + $tokenCounter = 0; + while ($tokens->valid()) { + $tokenCounter++; + $token = $tokens->current(); + if ($token === null) { + throw new RuntimeException( + 'Unexpected nullable character' + ); + } + + $token = trim($token); + + if ($token === '>') { + break; + } + + if ($token === ',') { + $commaFound = true; + } + + if ($commaFound === false && $minValue === null) { + if (is_numeric($token) || $token === 'max' || $token === 'min') { + $minValue = $token; + } + } + + if ($commaFound === true && $maxValue === null) { + if (is_numeric($token) || $token === 'max' || $token === 'min') { + $maxValue = $token; + } + } + + $tokens->next(); + } + + if ($token !== '>') { + if (empty($token)) { + throw new RuntimeException( + 'interface-string: ">" is missing' + ); + } + + throw new RuntimeException( + 'Unexpected character "' . $token . '", ">" is missing' + ); + } + + if ($minValue === null || $maxValue === null || $tokenCounter > 4) { + throw new RuntimeException( + 'int has not the correct format' + ); + } + + return new IntegerRange($minValue, $maxValue); + } + + /** + * Resolves class string + * + * @param ArrayIterator $tokens + */ + private function resolveInterfaceString(ArrayIterator $tokens, Context $context): Type + { + $tokens->next(); + + $classType = $this->parseTypes($tokens, $context, self::PARSER_IN_COLLECTION_EXPRESSION); + + if (!$classType instanceof Object_ || $classType->getFqsen() === null) { + throw new RuntimeException( + $classType . ' is not a interface string' + ); + } + + $token = $tokens->current(); + if ($token !== '>') { + if (empty($token)) { + throw new RuntimeException( + 'interface-string: ">" is missing' + ); + } + + throw new RuntimeException( + 'Unexpected character "' . $token . '", ">" is missing' + ); + } + + return new InterfaceString($classType->getFqsen()); + } + + /** + * Resolves the collection values and keys + * + * @param ArrayIterator $tokens + * + * @return Array_|Iterable_|Collection + */ + private function resolveCollection(ArrayIterator $tokens, Type $classType, Context $context): Type + { + $isArray = ((string) $classType === 'array'); + $isIterable = ((string) $classType === 'iterable'); + $isList = ((string) $classType === 'list'); + + // allow only "array", "iterable" or class name before "<" + if ( + !$isArray && !$isIterable && !$isList + && (!$classType instanceof Object_ || $classType->getFqsen() === null) + ) { + throw new RuntimeException( + $classType . ' is not a collection' + ); + } + + $tokens->next(); + + $valueType = $this->parseTypes($tokens, $context, self::PARSER_IN_COLLECTION_EXPRESSION); + $keyType = null; + + $token = $tokens->current(); + if ($token !== null && trim($token) === ',' && !$isList) { + // if we have a comma, then we just parsed the key type, not the value type + $keyType = $valueType; + if ($isArray) { + // check the key type for an "array" collection. We allow only + // strings or integers. + if ( + !$keyType instanceof ArrayKey && + !$keyType instanceof String_ && + !$keyType instanceof Integer && + !$keyType instanceof Compound + ) { + throw new RuntimeException( + 'An array can have only integers or strings as keys' + ); + } + + if ($keyType instanceof Compound) { + foreach ($keyType->getIterator() as $item) { + if ( + !$item instanceof ArrayKey && + !$item instanceof String_ && + !$item instanceof Integer + ) { + throw new RuntimeException( + 'An array can have only integers or strings as keys' + ); + } + } + } + } + + $tokens->next(); + // now let's parse the value type + $valueType = $this->parseTypes($tokens, $context, self::PARSER_IN_COLLECTION_EXPRESSION); + } + + $token = $tokens->current(); + if ($token !== '>') { + if (empty($token)) { + throw new RuntimeException( + 'Collection: ">" is missing' + ); + } + + throw new RuntimeException( + 'Unexpected character "' . $token . '", ">" is missing' + ); + } + + if ($isArray) { + return new Array_($valueType, $keyType); + } + + if ($isIterable) { + return new Iterable_($valueType, $keyType); + } + + if ($isList) { + return new List_($valueType); + } + + if ($classType instanceof Object_) { + return $this->makeCollectionFromObject($classType, $valueType, $keyType); + } + + throw new RuntimeException('Invalid $classType provided'); + } + + /** + * @psalm-pure + */ + private function makeCollectionFromObject(Object_ $object, Type $valueType, ?Type $keyType = null): Collection + { + return new Collection($object->getFqsen(), $valueType, $keyType); + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/AbstractList.php b/vendor/phpdocumentor/type-resolver/src/Types/AbstractList.php new file mode 100644 index 00000000..ee8ace80 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/AbstractList.php @@ -0,0 +1,83 @@ +valueType = $valueType; + $this->defaultKeyType = new Compound([new String_(), new Integer()]); + $this->keyType = $keyType; + } + + /** + * Returns the type for the keys of this array. + */ + public function getKeyType(): Type + { + return $this->keyType ?? $this->defaultKeyType; + } + + /** + * Returns the type for the values of this array. + */ + public function getValueType(): Type + { + return $this->valueType; + } + + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + */ + public function __toString(): string + { + if ($this->keyType) { + return 'array<' . $this->keyType . ',' . $this->valueType . '>'; + } + + if ($this->valueType instanceof Mixed_) { + return 'array'; + } + + if ($this->valueType instanceof Compound) { + return '(' . $this->valueType . ')[]'; + } + + return $this->valueType . '[]'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/AggregatedType.php b/vendor/phpdocumentor/type-resolver/src/Types/AggregatedType.php new file mode 100644 index 00000000..257ed516 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/AggregatedType.php @@ -0,0 +1,124 @@ + + */ +abstract class AggregatedType implements Type, IteratorAggregate +{ + /** + * @psalm-allow-private-mutation + * @var array + */ + private array $types = []; + + private string $token; + + /** + * @param array $types + */ + public function __construct(array $types, string $token) + { + foreach ($types as $type) { + $this->add($type); + } + + $this->token = $token; + } + + /** + * Returns the type at the given index. + */ + public function get(int $index): ?Type + { + if (!$this->has($index)) { + return null; + } + + return $this->types[$index]; + } + + /** + * Tests if this compound type has a type with the given index. + */ + public function has(int $index): bool + { + return array_key_exists($index, $this->types); + } + + /** + * Tests if this compound type contains the given type. + */ + public function contains(Type $type): bool + { + foreach ($this->types as $typePart) { + // if the type is duplicate; do not add it + if ((string) $typePart === (string) $type) { + return true; + } + } + + return false; + } + + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + */ + public function __toString(): string + { + return implode($this->token, $this->types); + } + + /** + * @return ArrayIterator + */ + public function getIterator(): ArrayIterator + { + return new ArrayIterator($this->types); + } + + /** + * @psalm-suppress ImpureMethodCall + */ + private function add(Type $type): void + { + if ($type instanceof self) { + foreach ($type->getIterator() as $subType) { + $this->add($subType); + } + + return; + } + + // if the type is duplicate; do not add it + if ($this->contains($type)) { + return; + } + + $this->types[] = $type; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/ArrayKey.php b/vendor/phpdocumentor/type-resolver/src/Types/ArrayKey.php new file mode 100644 index 00000000..cf86df00 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/ArrayKey.php @@ -0,0 +1,42 @@ +fqsen = $fqsen; + } + + public function underlyingType(): Type + { + return new String_(); + } + + /** + * Returns the FQSEN associated with this object. + */ + public function getFqsen(): ?Fqsen + { + return $this->fqsen; + } + + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + */ + public function __toString(): string + { + if ($this->fqsen === null) { + return 'class-string'; + } + + return 'class-string<' . (string) $this->fqsen . '>'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Collection.php b/vendor/phpdocumentor/type-resolver/src/Types/Collection.php new file mode 100644 index 00000000..dbf3f19f --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Collection.php @@ -0,0 +1,67 @@ +` + * 2. `ACollectionObject` + * + * - ACollectionObject can be 'array' or an object that can act as an array + * - aValueType and aKeyType can be any type expression + * + * @psalm-immutable + */ +final class Collection extends AbstractList +{ + private ?Fqsen $fqsen; + + /** + * Initializes this representation of an array with the given Type or Fqsen. + */ + public function __construct(?Fqsen $fqsen, Type $valueType, ?Type $keyType = null) + { + parent::__construct($valueType, $keyType); + + $this->fqsen = $fqsen; + } + + /** + * Returns the FQSEN associated with this object. + */ + public function getFqsen(): ?Fqsen + { + return $this->fqsen; + } + + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + */ + public function __toString(): string + { + $objectType = (string) ($this->fqsen ?? 'object'); + + if ($this->keyType === null) { + return $objectType . '<' . $this->valueType . '>'; + } + + return $objectType . '<' . $this->keyType . ',' . $this->valueType . '>'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Compound.php b/vendor/phpdocumentor/type-resolver/src/Types/Compound.php new file mode 100644 index 00000000..ad426cc2 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Compound.php @@ -0,0 +1,38 @@ + $types + */ + public function __construct(array $types) + { + parent::__construct($types, '|'); + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Context.php b/vendor/phpdocumentor/type-resolver/src/Types/Context.php new file mode 100644 index 00000000..17aa5065 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Context.php @@ -0,0 +1,95 @@ + Fully Qualified Namespace. + * @psalm-var array + */ + private array $namespaceAliases; + + /** + * Initializes the new context and normalizes all passed namespaces to be in Qualified Namespace Name (QNN) + * format (without a preceding `\`). + * + * @param string $namespace The namespace where this DocBlock resides in. + * @param string[] $namespaceAliases List of namespace aliases => Fully Qualified Namespace. + * @psalm-param array $namespaceAliases + */ + public function __construct(string $namespace, array $namespaceAliases = []) + { + $this->namespace = $namespace !== 'global' && $namespace !== 'default' + ? trim($namespace, '\\') + : ''; + + foreach ($namespaceAliases as $alias => $fqnn) { + if ($fqnn[0] === '\\') { + $fqnn = substr($fqnn, 1); + } + + if ($fqnn[strlen($fqnn) - 1] === '\\') { + $fqnn = substr($fqnn, 0, -1); + } + + $namespaceAliases[$alias] = $fqnn; + } + + $this->namespaceAliases = $namespaceAliases; + } + + /** + * Returns the Qualified Namespace Name (thus without `\` in front) where the associated element is in. + */ + public function getNamespace(): string + { + return $this->namespace; + } + + /** + * Returns a list of Qualified Namespace Names (thus without `\` in front) that are imported, the keys represent + * the alias for the imported Namespace. + * + * @return string[] + * @psalm-return array + */ + public function getNamespaceAliases(): array + { + return $this->namespaceAliases; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/ContextFactory.php b/vendor/phpdocumentor/type-resolver/src/Types/ContextFactory.php new file mode 100644 index 00000000..892ee0f9 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/ContextFactory.php @@ -0,0 +1,420 @@ + $reflector */ + + return $this->createFromReflectionClass($reflector); + } + + if ($reflector instanceof ReflectionParameter) { + return $this->createFromReflectionParameter($reflector); + } + + if ($reflector instanceof ReflectionMethod) { + return $this->createFromReflectionMethod($reflector); + } + + if ($reflector instanceof ReflectionProperty) { + return $this->createFromReflectionProperty($reflector); + } + + if ($reflector instanceof ReflectionClassConstant) { + return $this->createFromReflectionClassConstant($reflector); + } + + throw new UnexpectedValueException('Unhandled \Reflector instance given: ' . get_class($reflector)); + } + + private function createFromReflectionParameter(ReflectionParameter $parameter): Context + { + $class = $parameter->getDeclaringClass(); + if (!$class) { + throw new InvalidArgumentException('Unable to get class of ' . $parameter->getName()); + } + + return $this->createFromReflectionClass($class); + } + + private function createFromReflectionMethod(ReflectionMethod $method): Context + { + $class = $method->getDeclaringClass(); + + return $this->createFromReflectionClass($class); + } + + private function createFromReflectionProperty(ReflectionProperty $property): Context + { + $class = $property->getDeclaringClass(); + + return $this->createFromReflectionClass($class); + } + + private function createFromReflectionClassConstant(ReflectionClassConstant $constant): Context + { + //phpcs:ignore SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.MissingVariable + /** @phpstan-var ReflectionClass $class */ + $class = $constant->getDeclaringClass(); + + return $this->createFromReflectionClass($class); + } + + /** + * @phpstan-param ReflectionClass $class + */ + private function createFromReflectionClass(ReflectionClass $class): Context + { + $fileName = $class->getFileName(); + $namespace = $class->getNamespaceName(); + + if (is_string($fileName) && file_exists($fileName)) { + $contents = file_get_contents($fileName); + if ($contents === false) { + throw new RuntimeException('Unable to read file "' . $fileName . '"'); + } + + return $this->createForNamespace($namespace, $contents); + } + + return new Context($namespace, []); + } + + /** + * Build a Context for a namespace in the provided file contents. + * + * @see Context for more information on Contexts. + * + * @param string $namespace It does not matter if a `\` precedes the namespace name, + * this method first normalizes. + * @param string $fileContents The file's contents to retrieve the aliases from with the given namespace. + */ + public function createForNamespace(string $namespace, string $fileContents): Context + { + $namespace = trim($namespace, '\\'); + $useStatements = []; + $currentNamespace = ''; + $tokens = new ArrayIterator(token_get_all($fileContents)); + + while ($tokens->valid()) { + $currentToken = $tokens->current(); + switch ($currentToken[0]) { + case T_NAMESPACE: + $currentNamespace = $this->parseNamespace($tokens); + break; + case T_CLASS: + // Fast-forward the iterator through the class so that any + // T_USE tokens found within are skipped - these are not + // valid namespace use statements so should be ignored. + $braceLevel = 0; + $firstBraceFound = false; + while ($tokens->valid() && ($braceLevel > 0 || !$firstBraceFound)) { + $currentToken = $tokens->current(); + if ( + $currentToken === '{' + || in_array($currentToken[0], [T_CURLY_OPEN, T_DOLLAR_OPEN_CURLY_BRACES], true) + ) { + if (!$firstBraceFound) { + $firstBraceFound = true; + } + + ++$braceLevel; + } + + if ($currentToken === '}') { + --$braceLevel; + } + + $tokens->next(); + } + + break; + case T_USE: + if ($currentNamespace === $namespace) { + $useStatements += $this->parseUseStatement($tokens); + } + + break; + } + + $tokens->next(); + } + + return new Context($namespace, $useStatements); + } + + /** + * Deduce the name from tokens when we are at the T_NAMESPACE token. + * + * @param ArrayIterator $tokens + */ + private function parseNamespace(ArrayIterator $tokens): string + { + // skip to the first string or namespace separator + $this->skipToNextStringOrNamespaceSeparator($tokens); + + $name = ''; + $acceptedTokens = [T_STRING, T_NS_SEPARATOR, T_NAME_QUALIFIED]; + while ($tokens->valid() && in_array($tokens->current()[0], $acceptedTokens, true)) { + $name .= $tokens->current()[1]; + $tokens->next(); + } + + return $name; + } + + /** + * Deduce the names of all imports when we are at the T_USE token. + * + * @param ArrayIterator $tokens + * + * @return string[] + * @psalm-return array + */ + private function parseUseStatement(ArrayIterator $tokens): array + { + $uses = []; + + while ($tokens->valid()) { + $this->skipToNextStringOrNamespaceSeparator($tokens); + + $uses += $this->extractUseStatements($tokens); + $currentToken = $tokens->current(); + if ($currentToken[0] === self::T_LITERAL_END_OF_USE) { + return $uses; + } + } + + return $uses; + } + + /** + * Fast-forwards the iterator as longs as we don't encounter a T_STRING or T_NS_SEPARATOR token. + * + * @param ArrayIterator $tokens + */ + private function skipToNextStringOrNamespaceSeparator(ArrayIterator $tokens): void + { + while ($tokens->valid()) { + $currentToken = $tokens->current(); + if (in_array($currentToken[0], [T_STRING, T_NS_SEPARATOR], true)) { + break; + } + + if ($currentToken[0] === T_NAME_QUALIFIED) { + break; + } + + if (defined('T_NAME_FULLY_QUALIFIED') && $currentToken[0] === T_NAME_FULLY_QUALIFIED) { + break; + } + + $tokens->next(); + } + } + + /** + * Deduce the namespace name and alias of an import when we are at the T_USE token or have not reached the end of + * a USE statement yet. This will return a key/value array of the alias => namespace. + * + * @param ArrayIterator $tokens + * + * @return string[] + * @psalm-return array + * + * @psalm-suppress TypeDoesNotContainType + */ + private function extractUseStatements(ArrayIterator $tokens): array + { + $extractedUseStatements = []; + $groupedNs = ''; + $currentNs = ''; + $currentAlias = ''; + $state = 'start'; + + while ($tokens->valid()) { + $currentToken = $tokens->current(); + $tokenId = is_string($currentToken) ? $currentToken : $currentToken[0]; + $tokenValue = is_string($currentToken) ? null : $currentToken[1]; + switch ($state) { + case 'start': + switch ($tokenId) { + case T_STRING: + case T_NS_SEPARATOR: + $currentNs .= (string) $tokenValue; + $currentAlias = $tokenValue; + break; + case T_NAME_QUALIFIED: + case T_NAME_FULLY_QUALIFIED: + $currentNs .= (string) $tokenValue; + $currentAlias = substr( + (string) $tokenValue, + (int) (strrpos((string) $tokenValue, '\\')) + 1 + ); + break; + case T_CURLY_OPEN: + case '{': + $state = 'grouped'; + $groupedNs = $currentNs; + break; + case T_AS: + $state = 'start-alias'; + break; + case self::T_LITERAL_USE_SEPARATOR: + case self::T_LITERAL_END_OF_USE: + $state = 'end'; + break; + default: + break; + } + + break; + case 'start-alias': + switch ($tokenId) { + case T_STRING: + $currentAlias = $tokenValue; + break; + case self::T_LITERAL_USE_SEPARATOR: + case self::T_LITERAL_END_OF_USE: + $state = 'end'; + break; + default: + break; + } + + break; + case 'grouped': + switch ($tokenId) { + case T_STRING: + case T_NS_SEPARATOR: + $currentNs .= (string) $tokenValue; + $currentAlias = $tokenValue; + break; + case T_AS: + $state = 'grouped-alias'; + break; + case self::T_LITERAL_USE_SEPARATOR: + $state = 'grouped'; + $extractedUseStatements[(string) $currentAlias] = $currentNs; + $currentNs = $groupedNs; + $currentAlias = ''; + break; + case self::T_LITERAL_END_OF_USE: + $state = 'end'; + break; + default: + break; + } + + break; + case 'grouped-alias': + switch ($tokenId) { + case T_STRING: + $currentAlias = $tokenValue; + break; + case self::T_LITERAL_USE_SEPARATOR: + $state = 'grouped'; + $extractedUseStatements[(string) $currentAlias] = $currentNs; + $currentNs = $groupedNs; + $currentAlias = ''; + break; + case self::T_LITERAL_END_OF_USE: + $state = 'end'; + break; + default: + break; + } + } + + if ($state === 'end') { + break; + } + + $tokens->next(); + } + + if ($groupedNs !== $currentNs) { + $extractedUseStatements[(string) $currentAlias] = $currentNs; + } + + return $extractedUseStatements; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Expression.php b/vendor/phpdocumentor/type-resolver/src/Types/Expression.php new file mode 100644 index 00000000..2b6b0951 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Expression.php @@ -0,0 +1,50 @@ +valueType = $valueType; + } + + /** + * Returns the value for the keys of this array. + */ + public function getValueType(): Type + { + return $this->valueType; + } + + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + */ + public function __toString(): string + { + return '(' . $this->valueType . ')'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Float_.php b/vendor/phpdocumentor/type-resolver/src/Types/Float_.php new file mode 100644 index 00000000..86138c0e --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Float_.php @@ -0,0 +1,32 @@ +fqsen = $fqsen; + } + + /** + * Returns the FQSEN associated with this object. + */ + public function getFqsen(): ?Fqsen + { + return $this->fqsen; + } + + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + */ + public function __toString(): string + { + if ($this->fqsen === null) { + return 'interface-string'; + } + + return 'interface-string<' . (string) $this->fqsen . '>'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Intersection.php b/vendor/phpdocumentor/type-resolver/src/Types/Intersection.php new file mode 100644 index 00000000..ced37b62 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Intersection.php @@ -0,0 +1,37 @@ + $types + */ + public function __construct(array $types) + { + parent::__construct($types, '&'); + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Iterable_.php b/vendor/phpdocumentor/type-resolver/src/Types/Iterable_.php new file mode 100644 index 00000000..1ca069f2 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Iterable_.php @@ -0,0 +1,38 @@ +keyType) { + return 'iterable<' . $this->keyType . ',' . $this->valueType . '>'; + } + + if ($this->valueType instanceof Mixed_) { + return 'iterable'; + } + + return 'iterable<' . $this->valueType . '>'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Mixed_.php b/vendor/phpdocumentor/type-resolver/src/Types/Mixed_.php new file mode 100644 index 00000000..56d1b6da --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Mixed_.php @@ -0,0 +1,32 @@ +realType = $realType; + } + + /** + * Provide access to the actual type directly, if needed. + */ + public function getActualType(): Type + { + return $this->realType; + } + + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + */ + public function __toString(): string + { + return '?' . $this->realType->__toString(); + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Object_.php b/vendor/phpdocumentor/type-resolver/src/Types/Object_.php new file mode 100644 index 00000000..feb6ee34 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Object_.php @@ -0,0 +1,68 @@ +fqsen = $fqsen; + } + + /** + * Returns the FQSEN associated with this object. + */ + public function getFqsen(): ?Fqsen + { + return $this->fqsen; + } + + public function __toString(): string + { + if ($this->fqsen) { + return (string) $this->fqsen; + } + + return 'object'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Parent_.php b/vendor/phpdocumentor/type-resolver/src/Types/Parent_.php new file mode 100644 index 00000000..34838599 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Parent_.php @@ -0,0 +1,34 @@ +