Skip to content

Commit

Permalink
Add new Sylius Plus info command
Browse files Browse the repository at this point in the history
  • Loading branch information
mpysiak committed May 22, 2024
1 parent 1bd306e commit fd1b81a
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"post-create-project-cmd": [
"@php -r \"file_put_contents('.gitignore', str_replace('/composer.lock' . PHP_EOL, '', file_get_contents('.gitignore')));\"",
"@php bin/console sylius:inform-about-gus --ansi",
"@php bin/console sylius:show-available-plugins --ansi"
"@php bin/console sylius:show-plus-info --ansi"
],
"auto-scripts": {
"cache:clear": "symfony-cmd",
Expand Down
61 changes: 61 additions & 0 deletions src/Console/Command/ShowPlusInfoCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php

/*
* This file is part of the Sylius package.
*
* (c) Sylius Sp. z o.o.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace App\Console\Command;

use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;

#[AsCommand(
name: 'sylius:show-plus-info',
description: 'Shows information about Sylius Plus and Sylius Store',
)]
final class ShowPlusInfoCommand extends Command
{
private const SYLIUS_PLUS_URL = 'https://sylius.com/plus/';

private const SYLIUS_STORE_URL = 'https://store.sylius.com/';

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

$io->section('Sylius Plus');
$io->writeln('<comment>Consists of modules: </comment>');
$io->listing($this->getPlusModules());
$io->writeln('<comment>For more information visit: </comment> <href=' . self::SYLIUS_PLUS_URL . '>' . self::SYLIUS_PLUS_URL . '</>');

$io->section('Sylius Store');
$io->writeln('<comment>A wide range of community plugins both open source and licensed</comment> <href=' . self::SYLIUS_STORE_URL . '>' . self::SYLIUS_STORE_URL . '</>');

return Command::SUCCESS;
}

private function getPlusModules(): array

Check failure on line 47 in src/Console/Command/ShowPlusInfoCommand.php

View workflow job for this annotation

GitHub Actions / PHP 8.1, Symfony ^5.4, MySQL 8.3, Node 20.x

Method App\Console\Command\ShowPlusInfoCommand::getPlusModules() return type has no value type specified in iterable type array.

Check failure on line 47 in src/Console/Command/ShowPlusInfoCommand.php

View workflow job for this annotation

GitHub Actions / PHP 8.1, Symfony ^6.4, MySQL 8.3, Node 20.x

Method App\Console\Command\ShowPlusInfoCommand::getPlusModules() return type has no value type specified in iterable type array.

Check failure on line 47 in src/Console/Command/ShowPlusInfoCommand.php

View workflow job for this annotation

GitHub Actions / PHP 8.2, Symfony ^5.4, MySQL 8.3, Node 20.x

Method App\Console\Command\ShowPlusInfoCommand::getPlusModules() return type has no value type specified in iterable type array.

Check failure on line 47 in src/Console/Command/ShowPlusInfoCommand.php

View workflow job for this annotation

GitHub Actions / PHP 8.2, Symfony ^6.4, MySQL 8.3, Node 20.x

Method App\Console\Command\ShowPlusInfoCommand::getPlusModules() return type has no value type specified in iterable type array.
{
return [
'<info>B2B Suite</info>',
'<info>Marketplace Suite</info>',
'<info>Advanced Multi-store</info>',
'<info>Returns Management (RMA)</info>',
'<info>Multi-source Inventory</info>',
'<info>Loyalty system</info>',
'<info>RBAC (Role-Based Access Control)</info>',
'<info>Partial Shipment</info>',
'<info>One page checkout</info>',
];
}
}

0 comments on commit fd1b81a

Please sign in to comment.