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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Api/Extensions/ContentExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Bolt\Enum\Statuses;
use Doctrine\ORM\Query\Expr\Join;
use Doctrine\ORM\QueryBuilder;
use Tightenco\Collect\Support\Collection;

final class ContentExtension implements QueryCollectionExtensionInterface, QueryItemExtensionInterface
{
Expand All @@ -25,9 +26,9 @@ public function __construct(Config $config)
{
$this->config = $config;

$this->viewlessContentTypes = $this->config->get('contenttypes')->filter(function ($ct) {
$this->viewlessContentTypes = $this->config->get('contenttypes')->filter(function (Collection $ct) {
return $ct->get('viewless', false);
})->map(function ($ct) {
})->map(function (Collection $ct) {
return $ct->get('slug');
})->toArray();
}
Expand Down
7 changes: 3 additions & 4 deletions src/Command/ExtensionsConfigureCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Webmozart\PathUtil\Path;

class ExtensionsConfigureCommand extends Command
Expand All @@ -20,13 +19,13 @@ class ExtensionsConfigureCommand extends Command
/** @var ExtensionRegistry */
private $extensionRegistry;

/** @var mixed */
/** @var string */
private $projectDir;

public function __construct(ExtensionRegistry $extensionRegistry, ContainerInterface $container)
public function __construct(ExtensionRegistry $extensionRegistry, string $projectDir)
{
$this->extensionRegistry = $extensionRegistry;
$this->projectDir = $container->getParameter('kernel.project_dir');
$this->projectDir = $projectDir;

parent::__construct();
}
Expand Down
6 changes: 5 additions & 1 deletion src/Doctrine/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ public function getPlatform(): array
public function tableContentExists(): bool
{
try {
$this->connection->executeQuery('SELECT 1 FROM ' . $this->tablePrefix . 'content LIMIT 1; ');
$query = $this->connection->createQueryBuilder();
$query
->select('1')
->from($this->tablePrefix . 'content');
$query->execute();
} catch (\Throwable $e) {
return false;
}
Expand Down