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

codeigniter4 / CodeIgniter4 / 24029774564

06 Apr 2026 11:17AM UTC coverage: 86.553% (-0.003%) from 86.556%
24029774564

Pull #10087

github

web-flow
Merge 694768565 into d6e3f7b3f
Pull Request #10087: feat: add `FormRequest` for encapsulating validation and authorization

70 of 82 new or added lines in 6 files covered. (85.37%)

21 existing lines in 2 files now uncovered.

22773 of 26311 relevant lines covered (86.55%)

221.46 hits per line

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

0.0
/system/Commands/Generators/FormRequestGenerator.php
1
<?php
2

3
declare(strict_types=1);
4

5
/**
6
 * This file is part of CodeIgniter 4 framework.
7
 *
8
 * (c) CodeIgniter Foundation <admin@codeigniter.com>
9
 *
10
 * For the full copyright and license information, please view
11
 * the LICENSE file that was distributed with this source code.
12
 */
13

14
namespace CodeIgniter\Commands\Generators;
15

16
use CodeIgniter\CLI\BaseCommand;
17
use CodeIgniter\CLI\GeneratorTrait;
18

19
/**
20
 * Generates a skeleton FormRequest file.
21
 */
22
class FormRequestGenerator extends BaseCommand
23
{
24
    use GeneratorTrait;
25

26
    /**
27
     * The Command's Group
28
     *
29
     * @var string
30
     */
31
    protected $group = 'Generators';
32

33
    /**
34
     * The Command's Name
35
     *
36
     * @var string
37
     */
38
    protected $name = 'make:request';
39

40
    /**
41
     * The Command's Description
42
     *
43
     * @var string
44
     */
45
    protected $description = 'Generates a new FormRequest file.';
46

47
    /**
48
     * The Command's Usage
49
     *
50
     * @var string
51
     */
52
    protected $usage = 'make:request <name> [options]';
53

54
    /**
55
     * The Command's Arguments
56
     *
57
     * @var array<string, string>
58
     */
59
    protected $arguments = [
60
        'name' => 'The FormRequest class name.',
61
    ];
62

63
    /**
64
     * The Command's Options
65
     *
66
     * @var array<string, string>
67
     */
68
    protected $options = [
69
        '--namespace' => 'Set root namespace. Default: "APP_NAMESPACE".',
70
        '--suffix'    => 'Append the component title to the class name (e.g. User => UserRequest).',
71
        '--force'     => 'Force overwrite existing file.',
72
    ];
73

74
    /**
75
     * Actually execute a command.
76
     */
77
    public function run(array $params)
78
    {
NEW
79
        $this->component = 'Request';
×
NEW
80
        $this->directory = 'Requests';
×
NEW
81
        $this->template  = 'formrequest.tpl.php';
×
82

NEW
83
        $this->classNameLang = 'CLI.generator.className.request';
×
NEW
84
        $this->generateClass($params);
×
85
    }
86
}
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

© 2026 Coveralls, Inc