File tree 5 files changed +47
-4
lines changed
5 files changed +47
-4
lines changed Original file line number Diff line number Diff line change 40
40
- name : Execute linting
41
41
run : |
42
42
vendor/bin/php-cs-fixer fix --dry-run
43
+ vendor/bin/phpcs --colors --report-full
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
+ use AdamWojs \PhpCsFixerPhpdocForceFQCN \Fixer \Phpdoc \ForceFQCNFixer ;
3
4
use PhpCsFixer \Config ;
4
5
use PhpCsFixer \Finder ;
5
6
177
178
'unary_operator_spaces ' => true ,
178
179
// In array declaration, there MUST be a whitespace after each comma.
179
180
'whitespace_after_comma_in_array ' => true ,
181
+ // Force Fully-Qualified Class Name in docblocks
182
+ 'AdamWojs/phpdoc_force_fqcn_fixer ' => true ,
180
183
];
181
184
182
185
$ finder = Finder::create ()
191
194
->ignoreVCS (true );
192
195
193
196
return (new Config ())
197
+ ->registerCustomFixers ([
198
+ new ForceFQCNFixer (),
199
+ ])
194
200
->setRules ($ rules )
195
201
->setFinder ($ finder );
Original file line number Diff line number Diff line change 34
34
"illuminate/support" : " ^7.0|^8.0|^9.0"
35
35
},
36
36
"require-dev" : {
37
+ "adamwojs/php-cs-fixer-phpdoc-force-fqcn" : " ^2.0" ,
37
38
"friendsofphp/php-cs-fixer" : " ^3.0" ,
38
39
"orchestra/testbench" : " ^5.0|^6.0|^7.0" ,
39
- "phpunit/phpunit" : " ^9.1"
40
+ "phpunit/phpunit" : " ^9.1" ,
41
+ "squizlabs/php_codesniffer" : " ^3.6"
40
42
},
41
43
"autoload" : {
42
44
"psr-4" : {
51
53
"scripts" : {
52
54
"test" : " vendor/bin/phpunit" ,
53
55
"test-coverage" : " vendor/bin/phpunit --coverage-html coverage" ,
54
- "lint" : " vendor/bin/php-cs-fixer fix" ,
55
- "lint-dry" : " vendor/bin/php-cs-fixer fix --dry-run"
56
+ "lint" : " vendor/bin/php-cs-fixer fix && vendor/bin/phpcs --colors --report-full " ,
57
+ "lint-dry" : " vendor/bin/php-cs-fixer fix --dry-run && vendor/bin/phpcs --colors --report-full "
56
58
},
57
59
"config" : {
58
60
"sort-packages" : true
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" ?>
2
+ <ruleset name =" PSR2" >
3
+ <description >The PSR2 coding standard.</description >
4
+
5
+ <rule ref =" PSR2" />
6
+
7
+ <rule ref =" PSR1.Methods.CamelCapsMethodName" >
8
+ <exclude-pattern >*/**/tests</exclude-pattern >
9
+ </rule >
10
+
11
+ <rule ref =" Generic.Files.LineLength.TooLong" >
12
+ <exclude-pattern >*/**/tests</exclude-pattern >
13
+ <exclude-pattern >*/**/src/Console/InstallCommand.php</exclude-pattern >
14
+ <exclude-pattern >*/**/src/*ServiceProvider.php</exclude-pattern >
15
+ </rule >
16
+
17
+ <rule ref =" PSR1.Classes.ClassDeclaration.MultipleClasses" >
18
+ <exclude-pattern >*/**/tests</exclude-pattern >
19
+ </rule >
20
+
21
+ <rule ref =" Generic.PHP.ForbiddenFunctions" >
22
+ <properties >
23
+ <property name =" forbiddenFunctions" type =" array" value =" dd=>NULL,var_dump=>NULL,dump=>NULL" />
24
+ </properties >
25
+ </rule >
26
+
27
+ <file >src/</file >
28
+ <file >tests/</file >
29
+
30
+ <exclude-pattern >vendor/</exclude-pattern >
31
+ <exclude-pattern >node_modules/</exclude-pattern >
32
+ </ruleset >
Original file line number Diff line number Diff line change @@ -115,7 +115,9 @@ protected function getNotificationClass()
115
115
$ notificationClass = config ('verification-code.notification ' , VerificationCodeCreated::class);
116
116
117
117
if (! is_subclass_of ($ notificationClass , VerificationCodeCreatedInterface::class)) {
118
- throw new RuntimeException ('The notification class must implement the `\NextApps\VerificationCode\Notifications\VerificationCodeCreatedInterface` interface ' );
118
+ $ interface = VerificationCodeCreatedInterface::class;
119
+
120
+ throw new RuntimeException ('The notification class must implement the `{$interface}` interface ' );
119
121
}
120
122
121
123
return $ notificationClass ;
You can’t perform that action at this time.
0 commit comments