File tree Expand file tree Collapse file tree 6 files changed +90
-18
lines changed Expand file tree Collapse file tree 6 files changed +90
-18
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /**
4
+ * @file
5
+ * Contains Test.
6
+ */
7
+
8
+ /**
9
+ * Implements hook_node_view().
10
+ */
11
+ #[Hook('hook_node_view ' )]
12
+ function module_node_view () {
13
+
14
+ }
15
+
16
+ /**
17
+ * Implements hook_piratehook_view().
18
+ */
19
+ #[Hook('piratehook_view ' )]
20
+ function module_piratehook_view () {
21
+
22
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /**
4
+ * @file
5
+ * Contains Test.
6
+ */
7
+
8
+ /**
9
+ * Implements hook_node_view().
10
+ */
11
+ #[Hook('node_view')]
12
+ function module_node_view() {
13
+
14
+ }
15
+
16
+ /**
17
+ * Implements hook_piratehook_view().
18
+ */
19
+ #[Hook('piratehook_view')]
20
+ function module_piratehook_view() {
21
+
22
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Drupal \Test \Attributes ;
4
+
5
+ use Drupal \Test \CoderSniffUnitTest ;
6
+
7
+ class ValidHookNameUnitTest extends CoderSniffUnitTest
8
+ {
9
+
10
+
11
+ /**
12
+ * Returns the lines where errors should occur.
13
+ *
14
+ * The key of the array should represent the line number and the value
15
+ * should represent the number of errors that should occur on that line.
16
+ *
17
+ * @param string $testFile The name of the file being tested.
18
+ *
19
+ * @return array<int, int>
20
+ */
21
+ protected function getErrorList (string $ testFile ): array
22
+ {
23
+ return [];
24
+
25
+ }//end getErrorList()
26
+
27
+
28
+ /**
29
+ * Returns the lines where warnings should occur.
30
+ *
31
+ * The key of the array should represent the line number and the value
32
+ * should represent the number of warnings that should occur on that line.
33
+ *
34
+ * @param string $testFile The name of the file being tested.
35
+ *
36
+ * @return array<int, int>
37
+ */
38
+ protected function getWarningList (string $ testFile ): array
39
+ {
40
+ return [11 => 1 ];
41
+
42
+ }//end getWarningList()
43
+
44
+
45
+ }//end class
Original file line number Diff line number Diff line change @@ -384,7 +384,7 @@ protected function getErrorList(string $testFile): array
384
384
849 => 2 ,
385
385
860 => 2 ,
386
386
867 => 1 ,
387
- 879 => 2 ,
387
+ 871 => 2 ,
388
388
];
389
389
}//end switch
390
390
@@ -435,7 +435,6 @@ protected function getWarningList(string $testFile): array
435
435
823 => 1 ,
436
436
824 => 1 ,
437
437
836 => 1 ,
438
- 874 => 1 ,
439
438
];
440
439
}//end switch
441
440
Original file line number Diff line number Diff line change @@ -868,12 +868,4 @@ function test30(TestType $a = NULL) {
868
868
echo "Hello " ;
869
869
}
870
870
871
- /**
872
- * Implements hook_node_view().
873
- */
874
- #[Hook('hook_node_view ' )]
875
- function bad_node_view () {
876
-
877
- }
878
-
879
871
?>
Original file line number Diff line number Diff line change @@ -921,11 +921,3 @@ function test29(
921
921
function test30(?TestType $a = NULL) {
922
922
echo "Hello";
923
923
}
924
-
925
- /**
926
- * Implements hook_node_view().
927
- */
928
- #[Hook('node_view')]
929
- function bad_node_view() {
930
-
931
- }
You can’t perform that action at this time.
0 commit comments