Skip to content
Open
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
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
}
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.4",
"friendsofphp/php-cs-fixer": "^3.21",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^9.5",
Expand Down
169 changes: 167 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion config/bundles.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
/**
* © 2023-2023 by the orcano team (https://github.com/maxs94/orcano)
* © 2023-2024 by the orcano team (https://github.com/maxs94/orcano)
*/

return [
Expand All @@ -16,4 +16,5 @@
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
];
2 changes: 1 addition & 1 deletion config/preload.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
/**
* © 2023-2023 by the orcano team (https://github.com/maxs94/orcano)
* © 2023-2024 by the orcano team (https://github.com/maxs94/orcano)
*/

if (file_exists(dirname(__DIR__) . '/var/cache/prod/App_KernelProdContainer.preload.php')) {
Expand Down
9 changes: 9 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,12 @@ ifndef mode
else ifeq ($(mode), no-dry-run)
php ./vendor/bin/rector process
endif

fixtures: APP_ENV=test ## Load Fixtures in Test Environment
fixtures: ## Load Example data
@php bin/console doctrine:database:drop --force || true
@php bin/console doctrine:database:create
@php bin/console make:migration
@php bin/console doctrine:migrations:migrate -n
@php bin/console doctrine:fixtures:load -n
rm ./migrations/*.php
2 changes: 1 addition & 1 deletion public/index.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
/**
* © 2023-2023 by the orcano team (https://github.com/maxs94/orcano)
* © 2023-2024 by the orcano team (https://github.com/maxs94/orcano)
*/

use App\Kernel;
Expand Down
2 changes: 1 addition & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);
/**
* © 2023-2023 by the orcano team (https://github.com/maxs94/orcano)
* © 2023-2024 by the orcano team (https://github.com/maxs94/orcano)
*/

use Rector\CodingStyle\Rector\ClassConst\RemoveFinalFromConstRector;
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Asset/ListAssetCommand.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
/**
* © 2023-2023 by the orcano team (https://github.com/maxs94/orcano)
* © 2023-2024 by the orcano team (https://github.com/maxs94/orcano)
*/

namespace App\Command\Asset;
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Asset/RegisterAssetCommand.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
/**
* © 2023-2023 by the orcano team (https://github.com/maxs94/orcano)
* © 2023-2024 by the orcano team (https://github.com/maxs94/orcano)
*/

namespace App\Command\Asset;
Expand Down
2 changes: 1 addition & 1 deletion src/Command/AssetGroup/ListAssetGroupCommand.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
/**
* © 2023-2023 by the orcano team (https://github.com/maxs94/orcano)
* © 2023-2024 by the orcano team (https://github.com/maxs94/orcano)
*/

namespace App\Command\AssetGroup;
Expand Down
2 changes: 1 addition & 1 deletion src/Command/AssetGroup/RegisterAssetGroupCommand.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
/**
* © 2023-2023 by the orcano team (https://github.com/maxs94/orcano)
* © 2023-2024 by the orcano team (https://github.com/maxs94/orcano)
*/

namespace App\Command\AssetGroup;
Expand Down
2 changes: 1 addition & 1 deletion src/Command/ConditionTestCommand.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
/**
* © 2023-2023 by the orcano team (https://github.com/maxs94/orcano)
* © 2023-2024 by the orcano team (https://github.com/maxs94/orcano)
*/

namespace App\Command;
Expand Down
66 changes: 66 additions & 0 deletions src/Command/Preview/OrcanoPreviewCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php
declare(strict_types=1);
/**
* © 2023-2024 by the orcano team (https://github.com/maxs94/orcano)
*/

namespace App\Command\Preview;

use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\Process;

#[AsCommand(
name: 'orcano:preview',
description: 'Sets up Data to preview Orcano',
)]
class OrcanoPreviewCommand extends Command
{
public function __construct(private readonly ParameterBagInterface $parameterBag)
{
parent::__construct();
}

protected function configure(): void {}

protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);

$fixturesPath = $this->parameterBag->get('kernel.project_dir') . '/src/DataFixtures';

$fixtures = Finder::create()->in($fixturesPath);

$progressBar = new ProgressBar($output, count($fixtures));
$progressBar->start();

foreach ($fixtures as $fixture) {
$class = str_replace('Fixtures.php', '', $fixture->getRelativePathname());

$io->info($class . ' successfully created');
$progressBar->advance();
}

$progressBar->finish();
$output->writeln(PHP_EOL);

$process = new Process(['php', 'bin/console', 'doctrine:fixtures:load', '--no-interaction']);
$process->run();
if (!$process->isSuccessful()) {
throw new ProcessFailedException($process);
}

$output->writeln($process->getOutput());

$io->success('Preview Data was successfully loaded!');

return Command::SUCCESS;
}
}
2 changes: 1 addition & 1 deletion src/Command/Scheduler/RunSchedulerCommand.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
/**
* © 2023-2023 by the orcano team (https://github.com/maxs94/orcano)
* © 2023-2024 by the orcano team (https://github.com/maxs94/orcano)
*/

namespace App\Command\Scheduler;
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Scripts/ListCheckScriptsCommand.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
/**
* © 2023-2023 by the orcano team (https://github.com/maxs94/orcano)
* © 2023-2024 by the orcano team (https://github.com/maxs94/orcano)
*/

namespace App\Command\Scripts;
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Scripts/RefreshCheckScriptsCommand.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
/**
* © 2023-2023 by the orcano team (https://github.com/maxs94/orcano)
* © 2023-2024 by the orcano team (https://github.com/maxs94/orcano)
*/

namespace App\Command\Scripts;
Expand Down
2 changes: 1 addition & 1 deletion src/Command/ServiceCheck/ListServiceCheckCommand.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
/**
* © 2023-2023 by the orcano team (https://github.com/maxs94/orcano)
* © 2023-2024 by the orcano team (https://github.com/maxs94/orcano)
*/

namespace App\Command\ServiceCheck;
Expand Down
Loading