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

api-platform / core / 15133993414

20 May 2025 09:30AM UTC coverage: 26.313% (-1.2%) from 27.493%
15133993414

Pull #7161

github

web-flow
Merge e2c03d45f into 5459ba375
Pull Request #7161: fix(metadata): infer parameter string type from schema

0 of 2 new or added lines in 1 file covered. (0.0%)

11019 existing lines in 363 files now uncovered.

12898 of 49018 relevant lines covered (26.31%)

34.33 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';
1✔
33
    }
34

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

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

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

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

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

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