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

api-platform / core / 10014117656

19 Jul 2024 08:44PM UTC coverage: 7.856% (-56.3%) from 64.185%
10014117656

push

github

soyuka
Merge branch 'sf/remove-flag'

0 of 527 new or added lines in 83 files covered. (0.0%)

10505 existing lines in 362 files now uncovered.

12705 of 161727 relevant lines covered (7.86%)

26.85 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
    {
UNCOV
32
        return 'make:state-processor';
3✔
33
    }
34

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

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

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

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

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

UNCOV
76
        $this->writeSuccessMessage($io);
6✔
UNCOV
77
        $io->text([
6✔
UNCOV
78
            'Next: Open your new state processor class and start customizing it.',
6✔
UNCOV
79
        ]);
6✔
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