@@ -26,16 +26,16 @@ |
||
| 26 | 26 | * @return xml |
| 27 | 27 | * @access public |
| 28 | 28 | */ |
| 29 | - public static function noSpace( $xml = null ) |
|
| 29 | + public static function noSpace($xml = null) |
|
| 30 | 30 | { |
| 31 | 31 | |
| 32 | - if ( empty( $xml ) || is_null( $xml ) ) return false; |
|
| 32 | + if (empty($xml) || is_null($xml)) return false; |
|
| 33 | 33 | |
| 34 | - foreach ( $xml as $key => $value ) { |
|
| 35 | - if ( sizeof( $value ) > 1 ) { |
|
| 36 | - noSpace( $value ); // Get next node |
|
| 34 | + foreach ($xml as $key => $value) { |
|
| 35 | + if (sizeof($value) > 1) { |
|
| 36 | + noSpace($value); // Get next node |
|
| 37 | 37 | } else { |
| 38 | - $xml->$key = trim( $value ); |
|
| 38 | + $xml->$key = trim($value); |
|
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | return $xml; |
@@ -29,7 +29,9 @@ |
||
| 29 | 29 | public static function noSpace( $xml = null ) |
| 30 | 30 | { |
| 31 | 31 | |
| 32 | - if ( empty( $xml ) || is_null( $xml ) ) return false; |
|
| 32 | + if ( empty( $xml ) || is_null( $xml ) ) { |
|
| 33 | + return false; |
|
| 34 | + } |
|
| 33 | 35 | |
| 34 | 36 | foreach ( $xml as $key => $value ) { |
| 35 | 37 | if ( sizeof( $value ) > 1 ) { |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | { |
| 5 | 5 | |
| 6 | 6 | public function testNoXMLSpace() { |
| 7 | - $xml = simplexml_load_file( __DIR__ . '/xml_test.xml' ); |
|
| 7 | + $xml = simplexml_load_file(__DIR__ . '/xml_test.xml'); |
|
| 8 | 8 | $xml = NoXMLSpace::noSpace($xml); |
| 9 | 9 | |
| 10 | 10 | $this->assertEquals('Hello World', $xml->message); |