Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
primogenial
/
wp-content
/
themes
/
storefront
/
vendor
/
squizlabs
/
php_codesniffer
/
src
/
Standards
/
Squiz
/
Tests
/
Commenting
:
PostStatementCommentUnitTest.inc.fixed
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php function test() { $string = 'hello'; $string = 'hello'; // Set string to hello. // Valid comment. } function testing() // This is a function { }//end test() class TestClass { public $good = true; // Indeed. }//end class if (true || -1 == $b) { /* test */ } $y = 10 + /* test */ -2; $a = function() { };//end closure $array = [ function($a) { }, // phpcs:ignore Standard.Category.SniffName -- for reasons. 'key' => function($b) { }, // comment. 'key' => 'value', // phpcs:ignore Standard.Category.SniffName -- for reasons. 'key' => 'value', // comment. ]; // Verify that multi-line control structure with comments and annotations are left alone. for ( $i = 0; /* Start */ $i < 10; /* phpcs:ignore Standard.Category.SniffName -- for reasons. */ $i++ // comment ) {} if ( $condition === true // comment && $anotherCondition === false ) {} $match = match($foo // comment && $bar ) { 1 => 1, // comment };