Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console app dev #44

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
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
15 changes: 15 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env php
<?php

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

use CubeTools\CubeCommonDevelop\SymfonyCommands;
use CubeTools\CubeCommonDevelop\Workplace\DevCommands;
SimonHeimberg marked this conversation as resolved.
Show resolved Hide resolved
use Symfony\Component\Console\Application;

$application = new Application();

SymfonyCommands::addCcdCommands($application);
DevCommands::addCommands($application);

$application->run();
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
},
"require-dev": {
"incenteev/composer-parameter-handler": "^2.1",
"phpstan/phpstan": "^0.12.3"
"phpstan/phpstan": "^0.12.3",
"symfony/console": "^3.1|^4.1|^5.0",
"symfony/twig-bridge": "^3.1|^4.1|^5.0",
"symfony/yaml": "^3.1|^4.1|^5.0"
Comment on lines +24 to +25
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How many dependencies does this pull in? Do we care?

Copy link
Contributor Author

@SimonHeimberg SimonHeimberg May 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

twig-bridge does symfony/translation-contracts, twig/twig (doing symfony/polyfill-ctype and symfony/polyfill-mbstring)
yaml only symfony/polyfill-ctype

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

having only accepted this pr partially broke some checks of check-commit-cube.sh in this bundle

},
"suggest": {
"incenteev/composer-parameter-handler": "to run composer command",
Expand Down
19 changes: 19 additions & 0 deletions src/Workplace/DevCommands.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace CubeTools\CubeCommonDevelop\Workplace;

use Symfony\Bridge\Twig\Command\LintCommand as TwigLint;
use Symfony\Component\Console\Application;
use Symfony\Component\Yaml\Command\LintCommand as YamlLint;
use Twig\Environment;
use Twig\Loader\ArrayLoader;

class DevCommands
{
public static function addCommands(Application $application)
{
$application->add(new YamlLint());
$twigLint = new TwigLint(new Environment(new ArrayLoader()));
$application->add($twigLint);
}
}