• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

api-platform / core / 16050929464

03 Jul 2025 12:51PM UTC coverage: 22.065% (+0.2%) from 21.821%
16050929464

push

github

soyuka
chore: todo improvement

11516 of 52192 relevant lines covered (22.06%)

22.08 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/Symfony/Maker/MakeStateProcessor.php
1
<?php
2

3
/*
4
 * This file is part of the API Platform project.
5
 *
6
 * (c) Kévin Dunglas <dunglas@gmail.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
declare(strict_types=1);
13

14
namespace ApiPlatform\Symfony\Maker;
15

16
use Symfony\Bundle\MakerBundle\ConsoleStyle;
17
use Symfony\Bundle\MakerBundle\DependencyBuilder;
18
use Symfony\Bundle\MakerBundle\Generator;
19
use Symfony\Bundle\MakerBundle\InputConfiguration;
20
use Symfony\Bundle\MakerBundle\Maker\AbstractMaker;
21
use Symfony\Component\Console\Command\Command;
22
use Symfony\Component\Console\Input\InputArgument;
23
use Symfony\Component\Console\Input\InputInterface;
24

25
final class MakeStateProcessor extends AbstractMaker
26
{
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public static function getCommandName(): string
31
    {
32
        return 'make:state-processor';
2✔
33
    }
34

35
    /**
36
     * {@inheritdoc}
37
     */
38
    public static function getCommandDescription(): string
39
    {
40
        return 'Creates an API Platform state processor';
2✔
41
    }
42

43
    /**
44
     * {@inheritdoc}
45
     */
46
    public function configureCommand(Command $command, InputConfiguration $inputConfig): void
47
    {
48
        $command
4✔
49
            ->addArgument('name', InputArgument::REQUIRED, 'Choose a class name for your state processor (e.g. <fg=yellow>AwesomeStateProcessor</>)')
4✔
50
            ->setHelp(file_get_contents(__DIR__.'/Resources/help/MakeStateProcessor.txt'));
4✔
51
    }
52

53
    /**
54
     * {@inheritdoc}
55
     */
56
    public function configureDependencies(DependencyBuilder $dependencies): void
57
    {
58
    }
4✔
59

60
    /**
61
     * {@inheritdoc}
62
     */
63
    public function generate(InputInterface $input, ConsoleStyle $io, Generator $generator): void
64
    {
65
        $stateProcessorClassNameDetails = $generator->createClassNameDetails(
4✔
66
            $input->getArgument('name'),
4✔
67
            'State\\'
4✔
68
        );
4✔
69

70
        $generator->generateClass(
4✔
71
            $stateProcessorClassNameDetails->getFullName(),
4✔
72
            __DIR__.'/Resources/skeleton/StateProcessor.php.tpl'
4✔
73
        );
4✔
74
        $generator->writeChanges();
4✔
75

76
        $this->writeSuccessMessage($io);
4✔
77
        $io->text([
4✔
78
            'Next: Open your new state processor class and start customizing it.',
4✔
79
        ]);
4✔
80
    }
81
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc