Passed
Push — master ( 6dbcb1...96b972 )
by
unknown
01:44
created

ContactForm::getPropertyLabels()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Contact;
6
7
use Yiisoft\FormModel\FormModel;
0 ignored issues
show
Bug introduced by
The type Yiisoft\FormModel\FormModel was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Yiisoft\Input\Http\Attribute\Parameter\UploadedFiles;
0 ignored issues
show
Bug introduced by
The type Yiisoft\Input\Http\Attri...Parameter\UploadedFiles was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use Yiisoft\Validator\Rule\Email;
0 ignored issues
show
Bug introduced by
The type Yiisoft\Validator\Rule\Email was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
use Yiisoft\Validator\Rule\Required;
0 ignored issues
show
Bug introduced by
The type Yiisoft\Validator\Rule\Required was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Yiisoft\Validator\RulesProviderInterface;
0 ignored issues
show
Bug introduced by
The type Yiisoft\Validator\RulesProviderInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
13
final class ContactForm extends FormModel implements RulesProviderInterface
14
{
15
    private string $name = '';
0 ignored issues
show
introduced by
The private property $name is not used, and could be removed.
Loading history...
16
    private string $email = '';
0 ignored issues
show
introduced by
The private property $email is not used, and could be removed.
Loading history...
17
    private string $subject = '';
0 ignored issues
show
introduced by
The private property $subject is not used, and could be removed.
Loading history...
18
    private string $body = '';
0 ignored issues
show
introduced by
The private property $body is not used, and could be removed.
Loading history...
19
20
    #[UploadedFiles('ContactForm.attachFiles')]
21
    private array $attachFiles = [];
0 ignored issues
show
introduced by
The private property $attachFiles is not used, and could be removed.
Loading history...
22
23
    public function getPropertyLabels(): array
24
    {
25
        return [
26
            'name' => 'Name',
27
            'email' => 'Email',
28
            'subject' => 'Subject',
29
            'body' => 'Body',
30
        ];
31
    }
32
33
    public function getFormName(): string
34
    {
35
        return 'ContactForm';
36
    }
37
38
    public function getRules(): array
39
    {
40
        return [
41
            'name' => [new Required()],
42
            'email' => [new Required(), new Email()],
43
            'subject' => [new Required()],
44
            'body' => [new Required()],
45
        ];
46
    }
47
}
48