Completed
Push — master ( 809810...fd6aea )
by Thiago Augustus de
07:38 queued 05:05
created
NoXMLSpace.class.php 3 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,16 +26,16 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,9 @@
 block discarded – undo
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 ) {
Please login to merge, or discard this patch.
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -23,6 +23,7 @@
 block discarded – undo
23 23
 	 * </code>
24 24
 	 *
25 25
 	 * @param xml
26
+	 * @param SimpleXMLElement $xml
26 27
 	 * @return xml
27 28
 	 * @access public
28 29
 	 */
Please login to merge, or discard this patch.
Tests/bootstrap.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 function loader($class)
3 3
 {
4
-    $file = $class . '.php';
5
-    if (file_exists($file)) {
6
-        require $file;
7
-    }
4
+	$file = $class . '.php';
5
+	if (file_exists($file)) {
6
+		require $file;
7
+	}
8 8
 }
9 9
 spl_autoload_register('loader');
Please login to merge, or discard this patch.
Tests/NoSpaceTest.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 {
5 5
 
6 6
     function testNoXMLSpace() {
7
-        $xml = simplexml_load_file( 'xml_file.xml' );
7
+        $xml = simplexml_load_file('xml_file.xml');
8 8
         $xml = NoXMLSpace::noSpace($xml);
9 9
         
10 10
         $this->assertEquals('Hello World', $xml->message);
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -3,11 +3,11 @@
 block discarded – undo
3 3
 class NoSpaceTest extends PHPUnit_Framework_TestCase
4 4
 {
5 5
 
6
-    public function testNoXMLSpace() {
7
-        $xml = simplexml_load_file( 'xml_file.xml' );
8
-        $xml = NoXMLSpace::noSpace($xml);
6
+	public function testNoXMLSpace() {
7
+		$xml = simplexml_load_file( 'xml_file.xml' );
8
+		$xml = NoXMLSpace::noSpace($xml);
9 9
         
10
-        $this->assertEquals('Hello World', $xml->message);
11
-    }
10
+		$this->assertEquals('Hello World', $xml->message);
11
+	}
12 12
   
13 13
 }
Please login to merge, or discard this patch.