Problem/Motivation
FILE: ...-contrib/modules/ctools/src/Form/ManageResolverRelationships.php
----------------------------------------------------------------------
FOUND 43 ERRORS AND 3 WARNINGS AFFECTING 42 LINES
----------------------------------------------------------------------
15 | ERROR | [x] Missing class doc comment
17 | ERROR | [ ] Missing short description in doc comment
20 | ERROR | [ ] Class property $machine_name should use
| | lowerCamel naming without underscores
27 | ERROR | [ ] Class property $property_types should use
| | lowerCamel naming without underscores
79 | ERROR | [x] Short array syntax must be used to define arrays
84 | ERROR | [x] Short array syntax must be used to define arrays
84 | ERROR | [ ] If the line declaring an array spans longer than
| | 80 characters, each element should be broken
| | into its own line
86 | WARNING | [x] A comma should follow the last multiline array
| | item. Found: )
104 | WARNING | [x] A comma should follow the last multiline array
| | item. Found: ]
120 | ERROR | [x] Missing function doc comment
135 | ERROR | [x] Short array syntax must be used to define arrays
139 | ERROR | [x] Missing function doc comment
145 | ERROR | [ ] Missing short description in doc comment
146 | ERROR | [ ] Missing parameter comment
146 | ERROR | [ ] Missing parameter type
148 | ERROR | [ ] Description for the @return value is missing
151 | ERROR | [x] Short array syntax must be used to define arrays
154 | ERROR | [x] Short array syntax must be used to define arrays
158 | ERROR | [x] Short array syntax must be used to define arrays
162 | ERROR | [ ] Key specified for array entry; first entry has
| | no key
170 | ERROR | [ ] Missing short description in doc comment
171 | ERROR | [ ] Missing parameter comment
172 | ERROR | [ ] Missing parameter comment
173 | ERROR | [ ] Missing parameter comment
174 | ERROR | [ ] Missing parameter comment
176 | ERROR | [ ] Description for the @return value is missing
178 | ERROR | [ ] Type hint "array" missing for $cached_values
178 | ERROR | [x] Short array syntax must be used to define arrays
179 | WARNING | [ ] Line exceeds 80 characters; contains 95
| | characters
183 | ERROR | [x] Short array syntax must be used to define arrays
187 | ERROR | [x] Short array syntax must be used to define arrays
196 | ERROR | [x] Short array syntax must be used to define arrays
200 | ERROR | [x] Short array syntax must be used to define arrays
201 | ERROR | [x] Short array syntax must be used to define arrays
217 | ERROR | [ ] Description for the @return value is missing
224 | ERROR | [ ] Description for the @return value is missing
231 | ERROR | [ ] Description for the @return value is missing
235 | ERROR | [ ] Missing short description in doc comment
236 | ERROR | [ ] Missing parameter comment
236 | ERROR | [ ] Missing parameter type
238 | ERROR | [ ] Description for the @return value is missing
242 | ERROR | [ ] Missing short description in doc comment
243 | ERROR | [ ] Missing parameter comment
244 | ERROR | [ ] Missing parameter comment
245 | ERROR | [ ] Missing parameter comment
247 | ERROR | [ ] Description for the @return value is missing
----------------------------------------------------------------------
PHPCBF CAN FIX THE 17 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | ctools-ctools-Standards_on_Form_ManageResolverRelationships-3033371-14-D8.patch | 7.83 KB | thalles |
Comments
Comment #2
thallesFollow the patch!
Comment #3
joelpittetThese changes could break anything extending from this abstract class.
Comment #4
thallesWe can use both and warn that the former went into depreciation.
Comment #5
thallesFollow the patch!
Comment #7
thallesFollow new!
Comment #9
thallesFollow the patch!
Comment #10
thallesThis patch triggers the message that non-camel variables are depreciated.
Comment #11
andrey.troeglazov commentedThis is a bad solution from my point of view, I think adding @deprecated message in doc will be enough.
Comment #12
thallesFollow a patch!
Comment #13
joelpittetThis looks great but I have a couple of concerns that need to be addressed:
I don't think machine_name to machineName is ideal to change as child classes may be using that protected property.
why is this changing to a string key?
Comment #14
thallesHi @joelpittet!
All right?
Follow a new patch with the proposed changes.
About key:
I added because phpcs asked because it has a key in one value and in others not.
Thanks!
Comment #15
joelpittetThanks for doing that, strange that PHPCS would mention mixed indexes. I've committed this to the latest dev.