@@ -71,6 +71,11 @@ class LayoutSniff implements Sniff
71
71
],
72
72
];
73
73
74
+ /**
75
+ * List of allowed method names
76
+ *
77
+ * @var string[]
78
+ */
74
79
private $ allowedActionNodeMethods = [
75
80
'addBodyClass ' ,
76
81
'addButtons ' ,
@@ -233,6 +238,9 @@ public function process(File $phpcsFile, $stackPtr)
233
238
}
234
239
235
240
/**
241
+ * Check for obsolete block references
242
+ *
243
+ * @todo missing test
236
244
* @param SimpleXMLElement $layout
237
245
* @param File $phpcsFile
238
246
*/
@@ -269,6 +277,8 @@ private function getFormattedXML(File $phpcsFile)
269
277
}
270
278
271
279
/**
280
+ * Check that CSS, Link and Script blocks are inside a head block
281
+ *
272
282
* @param SimpleXMLElement $layout
273
283
* @param File $phpcsFile
274
284
*/
@@ -295,6 +305,8 @@ private function testHeadBlocks(SimpleXMLElement $layout, File $phpcsFile): void
295
305
}
296
306
297
307
/**
308
+ * Check that the output attribute has the right value
309
+ *
298
310
* @param SimpleXMLElement $layout
299
311
* @param File $phpcsFile
300
312
*/
@@ -347,6 +359,7 @@ private function testObsoleteAttributes(SimpleXMLElement $layout, File $phpcsFil
347
359
/**
348
360
* Returns attribute value by attribute name
349
361
*
362
+ * @param SimpleXMLElement $element
350
363
* @param string $name
351
364
* @return string|null
352
365
*/
@@ -357,6 +370,8 @@ private function getAttribute(SimpleXMLElement $element, string $name): string
357
370
}
358
371
359
372
/**
373
+ * Check values in helper attributes
374
+ *
360
375
* @param SimpleXMLElement $layout
361
376
* @param File $phpcsFile
362
377
*/
@@ -381,6 +396,8 @@ private function testHelperAttribute(SimpleXMLElement $layout, File $phpcsFile):
381
396
}
382
397
383
398
/**
399
+ * Check that ListText is not used
400
+ *
384
401
* @param SimpleXMLElement $layout
385
402
* @param File $phpcsFile
386
403
*/
@@ -398,6 +415,8 @@ private function testListText(SimpleXMLElement $layout, File $phpcsFile): void
398
415
}
399
416
400
417
/**
418
+ * Check that action is calling an allowed method
419
+ *
401
420
* @param SimpleXMLElement $layout
402
421
* @param File $phpcsFile
403
422
*/
0 commit comments