Loading coder_sniffer/Drupal/Sniffs/WhiteSpace/ScopeIndentSniff.php +1 −0 Original line number Diff line number Diff line Loading @@ -972,6 +972,7 @@ class ScopeIndentSniff implements Sniff T_CLOSE_CURLY_BRACKET, T_OPEN_CURLY_BRACKET, T_COLON, T_OPEN_TAG, ] ) === false ) { Loading coder_sniffer/Drupal/Test/WhiteSpace/ScopeClosingBraceUnitTest.inc 0 → 100644 +29 −0 Original line number Diff line number Diff line <?php /** * @file * Test file. */ /** * ScopeIndentSniff already handles this correctly. */ function example_entity_info_alter(&$entity_info) { $entity_info['node']['view modes']['new_display_machine_name'] = array( 'label' => t('New Display Name'), 'custom settings' => '', ); } /** * Closing brace not aligned correctly. */ function test2() { return 5; } /** * Closing brace not on line by itself. */ function test3() { return 7; } coder_sniffer/Drupal/Test/WhiteSpace/ScopeClosingBraceUnitTest.inc.fixed 0 → 100644 +30 −0 Original line number Diff line number Diff line <?php /** * @file * Test file. */ /** * ScopeIndentSniff already handles this correctly. */ function example_entity_info_alter(&$entity_info) { $entity_info['node']['view modes']['new_display_machine_name'] = array( 'label' => t('New Display Name'), 'custom settings' => '', ); } /** * Closing brace not aligned correctly. */ function test2() { return 5; } /** * Closing brace not on line by itself. */ function test3() { return 7; } coder_sniffer/Drupal/Test/WhiteSpace/ScopeClosingBraceUnitTest.php 0 → 100644 +45 −0 Original line number Diff line number Diff line <?php namespace Drupal\Sniffs\WhiteSpace; use Drupal\Test\CoderSniffUnitTest; class ScopeClosingBraceUnitTest extends CoderSniffUnitTest { /** * Returns the lines where errors should occur. * * The key of the array should represent the line number and the value * should represent the number of errors that should occur on that line. * * @return array(int => int) */ public function getErrorList() { return [ 16 => 1, 23 => 1, 29 => 1, ]; }//end getErrorList() /** * Returns the lines where warnings should occur. * * The key of the array should represent the line number and the value * should represent the number of warnings that should occur on that line. * * @return array(int => int) */ public function getWarningList() { return []; }//end getWarningList() }//end class Loading
coder_sniffer/Drupal/Sniffs/WhiteSpace/ScopeIndentSniff.php +1 −0 Original line number Diff line number Diff line Loading @@ -972,6 +972,7 @@ class ScopeIndentSniff implements Sniff T_CLOSE_CURLY_BRACKET, T_OPEN_CURLY_BRACKET, T_COLON, T_OPEN_TAG, ] ) === false ) { Loading
coder_sniffer/Drupal/Test/WhiteSpace/ScopeClosingBraceUnitTest.inc 0 → 100644 +29 −0 Original line number Diff line number Diff line <?php /** * @file * Test file. */ /** * ScopeIndentSniff already handles this correctly. */ function example_entity_info_alter(&$entity_info) { $entity_info['node']['view modes']['new_display_machine_name'] = array( 'label' => t('New Display Name'), 'custom settings' => '', ); } /** * Closing brace not aligned correctly. */ function test2() { return 5; } /** * Closing brace not on line by itself. */ function test3() { return 7; }
coder_sniffer/Drupal/Test/WhiteSpace/ScopeClosingBraceUnitTest.inc.fixed 0 → 100644 +30 −0 Original line number Diff line number Diff line <?php /** * @file * Test file. */ /** * ScopeIndentSniff already handles this correctly. */ function example_entity_info_alter(&$entity_info) { $entity_info['node']['view modes']['new_display_machine_name'] = array( 'label' => t('New Display Name'), 'custom settings' => '', ); } /** * Closing brace not aligned correctly. */ function test2() { return 5; } /** * Closing brace not on line by itself. */ function test3() { return 7; }
coder_sniffer/Drupal/Test/WhiteSpace/ScopeClosingBraceUnitTest.php 0 → 100644 +45 −0 Original line number Diff line number Diff line <?php namespace Drupal\Sniffs\WhiteSpace; use Drupal\Test\CoderSniffUnitTest; class ScopeClosingBraceUnitTest extends CoderSniffUnitTest { /** * Returns the lines where errors should occur. * * The key of the array should represent the line number and the value * should represent the number of errors that should occur on that line. * * @return array(int => int) */ public function getErrorList() { return [ 16 => 1, 23 => 1, 29 => 1, ]; }//end getErrorList() /** * Returns the lines where warnings should occur. * * The key of the array should represent the line number and the value * should represent the number of warnings that should occur on that line. * * @return array(int => int) */ public function getWarningList() { return []; }//end getWarningList() }//end class