Passed
Push — main ( 652a21...525366 )
by Thierry
03:56
created

Attribute::saveFiles()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Jaxon\Attributes\Tests\Attr\Ajax;
5
6
use Jaxon\Attributes\Attribute\After;
7
use Jaxon\Attributes\Attribute\Before;
8
use Jaxon\Attributes\Attribute\Callback;
9
use Jaxon\Attributes\Attribute\DataBag;
10
use Jaxon\Attributes\Attribute\Inject;
11
use Jaxon\Attributes\Attribute\Exclude;
12
use Jaxon\Attributes\Attribute\Upload;
13
use Jaxon\Attributes\Tests\Attr\FuncComponent;
14
use Jaxon\Attributes\Tests\Service\ColorService;
0 ignored issues
show
Bug introduced by
The type Jaxon\Attributes\Tests\Service\ColorService 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...
15
16
class Attribute extends FuncComponent
17
{
18
    #[Exclude]
19
    public function doNot()
20
    {
21
    }
22
23
    #[Exclude(true)]
24
    public function doNotBool()
25
    {
26
    }
27
28
    #[Exclude('Me')]
29
    public function doNotError()
30
    {
31
    }
32
33
    #[DataBag(name: 'user.name')]
34
    #[DataBag(name: 'page.number')]
35
    public function withBags()
36
    {
37
    }
38
39
    #[DataBag(mane: 'user.name')]
40
    #[DataBag(mane: 'page.number')]
41
    public function withBagsError()
42
    {
43
    }
44
45
    #[Callback('jaxon.callback.first')]
46
    #[Callback('jaxon.callback.second')]
47
    public function withCallbacks()
48
    {
49
    }
50
51
    #[Upload(field: 'user-files')]
52
    public function saveFiles()
53
    {
54
    }
55
56
    #[Upload(name: 'user-files')]
57
    public function saveFilesWrongName()
58
    {
59
    }
60
61
    #[Upload(field: 'user-file1')]
62
    #[Upload(field: 'user-file2')]
63
    public function saveFilesMultiple()
64
    {
65
    }
66
67
    #[Before(call: 'funcBefore')]
68
    #[After(call: 'funcAfter')]
69
    public function cbSingle()
70
    {
71
    }
72
73
    #[Before(call: 'funcBefore1')]
74
    #[Before(call: 'funcBefore2')]
75
    #[After(call: 'funcAfter1')]
76
    #[After(call: 'funcAfter2')]
77
    #[After(call: 'funcAfter3')]
78
    public function cbMultiple()
79
    {
80
    }
81
82
    #[Before(call: 'funcBefore1', with: ['param1'])]
83
    #[Before(call: 'funcBefore2', with: ['param1', 'param2'])]
84
    #[After(call: 'funcAfter1', with: ['param1', 'param2'])]
85
    public function cbParams()
86
    {
87
    }
88
89
    #[Inject(type: ColorService::class, attr: 'colorService')]
90
    #[Inject(type: FontService::class, attr: 'fontService')]
91
    public function di1()
92
    {
93
    }
94
95
    #[Inject(type: ColorService::class, attr: 'colorService')]
96
    #[Inject(type: '\Jaxon\Attributes\Tests\Service\TextService', attr: 'textService')]
97
    public function di2()
98
    {
99
    }
100
101
    #[Before(name: 'funcBefore', with: ['param1'])]
102
    public function cbBeforeNoCall()
103
    {
104
    }
105
106
    #[Before(call: 'funcBefore', params: ['param1'])]
107
    public function cbBeforeUnknownAttr()
108
    {
109
    }
110
111
    #[Before(call: 'funcBefore', with: 'param1')]
112
    public function cbBeforeWrongAttrType()
113
    {
114
    }
115
116
    #[After(name: 'funcAfter', with: ['param1'])]
117
    public function cbAfterNoCall()
118
    {
119
    }
120
121
    #[After(call: 'funcAfter', params: ['param1'])]
122
    public function cbAfterUnknownAttr()
123
    {
124
    }
125
126
    #[After(call: 'funcAfter', with: true)]
127
    public function cbAfterWrongAttrType()
128
    {
129
    }
130
131
    #[Inject(attr: 'attr', params: '')]
132
    public function diUnknownAttr()
133
    {
134
    }
135
136
    #[Inject(type: 'ClassName', attr: [])]
137
    public function diWrongAttrType()
138
    {
139
    }
140
141
    #[Inject(type: true, attr: 'attr')]
142
    public function diWrongClassType()
143
    {
144
    }
145
}
146