Skip to content

Commit

Permalink
Merge pull request #1294 from ergebnis/feature/console
Browse files Browse the repository at this point in the history
Enhancement: Implement `console` script
  • Loading branch information
localheinz committed Feb 7, 2024
2 parents 5513b2a + 8ead2bd commit 51918ad
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/integrate.yaml
Expand Up @@ -524,10 +524,10 @@ jobs:
dependencies: "${{ matrix.dependencies }}"

- name: "Show Doctrine mapping information"
run: "vendor/bin/doctrine orm:info --ansi"
run: "bin/console orm:info --ansi"

- name: "Validate Doctrine mapping"
run: "vendor/bin/doctrine orm:validate-schema --ansi --skip-sync"
run: "bin/console orm:validate-schema --ansi --skip-sync"

- name: "Run unit tests with phpunit/phpunit"
run: "vendor/bin/phpunit --colors=always --configuration=test/phpunit.xml --testsuite=unit"
Expand Down
3 changes: 2 additions & 1 deletion .php-cs-fixer.php
Expand Up @@ -42,7 +42,8 @@
'/test/Fixture/Definitions/CanNotBeAutoloaded/',
])
->ignoreDotFiles(false)
->in(__DIR__);
->in(__DIR__)
->name('console');

$config->setCacheFile(__DIR__ . '/.build/php-cs-fixer/.php-cs-fixer.cache');

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -22,8 +22,8 @@ dependency-analysis: phive vendor ## Runs a dependency analysis with maglnet/com

.PHONY: doctrine
doctrine: vendor ## Shows and validates Docrine mapping information
vendor/bin/doctrine orm:info
vendor/bin/doctrine orm:validate-schema --skip-sync
bin/console orm:info
bin/console orm:validate-schema --skip-sync

.PHONY: help
help: ## Displays this list of targets with descriptions
Expand Down
20 changes: 20 additions & 0 deletions bin/console
@@ -0,0 +1,20 @@
#!/usr/bin/env php
<?php

declare(strict_types=1);

/**
* Copyright (c) 2020-2024 Andreas M枚ller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
*
* @see https://github.com/ergebnis/factory-bot
*/

use Doctrine\ORM;
use Ergebnis\FactoryBot\Test;

require_once __DIR__ . '/../vendor/autoload.php';

ORM\Tools\Console\ConsoleRunner::run(new ORM\Tools\Console\EntityManagerProvider\SingleManagerProvider(Test\Util\Doctrine\ORM\EntityManagerFactory::create()));
1 change: 1 addition & 0 deletions phpstan.neon
Expand Up @@ -26,6 +26,7 @@ parameters:
- example/
- src/
- test/
- bin/console
- .php-cs-fixer.php
- rector.php

Expand Down
1 change: 1 addition & 0 deletions psalm.xml
Expand Up @@ -21,6 +21,7 @@
<directory name="example/" />
<directory name="src/" />
<directory name="test/" />
<file name="bin/console" />
<file name=".php-cs-fixer.php" />
<file name="rector.php" />
</projectFiles>
Expand Down

0 comments on commit 51918ad

Please sign in to comment.