Completed
Push — 3.2 ( 7b06ed...40a0aa )
by David
09:20
created
src/views/installStep2.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 <div class="control-group">
30 30
 	<label class="control-label">Store dates / timestamps in UTC:</label>
31 31
 	<div class="controls">
32
-		<input type="checkbox" name="storeInUtc" value="1" <?php echo $this->storeInUtc?'checked="checked"':"" ?>></input>
32
+		<input type="checkbox" name="storeInUtc" value="1" <?php echo $this->storeInUtc ? 'checked="checked"' : "" ?>></input>
33 33
 		<span class="help-block">Select this option if you want timestamps to be stored in UTC.
34 34
 		If your application supports several time zones, you should select this option to store all dates in
35 35
 		the same time zone.</span>
Please login to merge, or discard this patch.
src/Mouf/Database/TDBM/Filters/InFilter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	 * @param string $columnName
86 86
 	 * @param array<string> $values
87 87
 	 */
88
-	public function __construct($tableName=null, $columnName=null, $values=array()) {
88
+	public function __construct($tableName = null, $columnName = null, $values = array()) {
89 89
 		$this->tableName = $tableName;
90 90
 		$this->columnName = $columnName;
91 91
 		$this->values = $values;
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 			}
118 118
 		}
119 119
 
120
-		return $this->tableName.'.'.$this->columnName.' IN ('.implode(',',$values_sql).")";
120
+		return $this->tableName.'.'.$this->columnName.' IN ('.implode(',', $values_sql).")";
121 121
 	}
122 122
 
123 123
 	/**
Please login to merge, or discard this patch.
src/Mouf/Database/TDBM/Filters/OrderByColumn.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
 	 * @param string $columnName
87 87
 	 * @param string $order
88 88
 	 */
89
-	public function __construct($tableName=null, $columnName=null, $order=null) {
89
+	public function __construct($tableName = null, $columnName = null, $order = null) {
90 90
 		$this->tableName = $tableName;
91 91
 		$this->columnName = $columnName;
92 92
 		$this->order = $order;
Please login to merge, or discard this patch.
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,6 @@
 block discarded – undo
84 84
 	 * 
85 85
 	 * @param string $tableName
86 86
 	 * @param string $columnName
87
-	 * @param string $value
88 87
 	 */
89 88
 	public function __construct($tableName=null, $columnName=null, $order=null) {
90 89
 		$this->tableName = $tableName;
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace Mouf\Database\TDBM\Filters;
3 3
 
4
-use Mouf\Database\DBConnection\ConnectionInterface;
5
-
6 4
 /*
7 5
  Copyright (C) 2006-2011 David Négrier - THE CODING MACHINE
8 6
 
Please login to merge, or discard this patch.
src/Mouf/Database/TDBM/Filters/NotFilter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
 	 * 
60 60
 	 * @param FilterInterface $filter
61 61
 	 */
62
-	public function __construct($filter=null) {
62
+	public function __construct($filter = null) {
63 63
 		$this->filter = $filter;
64 64
 	}
65 65
 
Please login to merge, or discard this patch.
src/Mouf/Database/TDBM/Filters/SqlStringFilter.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	 * 
63 63
 	 * @param string $sqlString
64 64
 	 */
65
-	public function __construct($sqlString=null) {
65
+	public function __construct($sqlString = null) {
66 66
 		$this->sqlString = $sqlString;
67 67
 	}
68 68
 
@@ -95,32 +95,32 @@  discard block
 block discarded – undo
95 95
 		// First, let's remove all the stuff in quotes:
96 96
 
97 97
 		// Let's remove all the \' found
98
-		$work_str = str_replace("\\'",'',$this->sqlString);
98
+		$work_str = str_replace("\\'", '', $this->sqlString);
99 99
 		// Now, let's split the string using '
100 100
 		$work_table = explode("'", $work_str);
101 101
 
102
-		if (count($work_table)==0)
102
+		if (count($work_table) == 0)
103 103
 		return '';
104 104
 
105 105
 		// if we start with a ', let's remove the first text
106
-		if (strstr($work_str,"'")===0)
106
+		if (strstr($work_str, "'") === 0)
107 107
 		array_shift($work_table);
108 108
 			
109
-		if (count($work_table)==0)
109
+		if (count($work_table) == 0)
110 110
 		return '';
111 111
 
112 112
 		// Now, let's take only the stuff outside the quotes.
113 113
 		$work_str2 = '';
114 114
 
115
-		$i=0;
115
+		$i = 0;
116 116
 		foreach ($work_table as $str_fragment) {
117
-			if (($i % 2) == 0)
117
+			if (($i%2) == 0)
118 118
 			$work_str2 .= $str_fragment.' ';
119 119
 			$i++;
120 120
 		}
121 121
 
122 122
 		// Now, let's run a regexp to find all the strings matching the pattern xxx.yyy
123
-		preg_match_all('/([a-zA-Z_](?:[a-zA-Z0-9_]*))\.(?:[a-zA-Z_](?:[a-zA-Z0-9_]*))/', $work_str2,$capture_result);
123
+		preg_match_all('/([a-zA-Z_](?:[a-zA-Z0-9_]*))\.(?:[a-zA-Z_](?:[a-zA-Z0-9_]*))/', $work_str2, $capture_result);
124 124
 
125 125
 		$tables_used = $capture_result[1];
126 126
 		// remove doubles:
Please login to merge, or discard this patch.
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -99,23 +99,27 @@
 block discarded – undo
99 99
 		// Now, let's split the string using '
100 100
 		$work_table = explode("'", $work_str);
101 101
 
102
-		if (count($work_table)==0)
103
-		return '';
102
+		if (count($work_table)==0) {
103
+				return '';
104
+		}
104 105
 
105 106
 		// if we start with a ', let's remove the first text
106
-		if (strstr($work_str,"'")===0)
107
-		array_shift($work_table);
107
+		if (strstr($work_str,"'")===0) {
108
+				array_shift($work_table);
109
+		}
108 110
 			
109
-		if (count($work_table)==0)
110
-		return '';
111
+		if (count($work_table)==0) {
112
+				return '';
113
+		}
111 114
 
112 115
 		// Now, let's take only the stuff outside the quotes.
113 116
 		$work_str2 = '';
114 117
 
115 118
 		$i=0;
116 119
 		foreach ($work_table as $str_fragment) {
117
-			if (($i % 2) == 0)
118
-			$work_str2 .= $str_fragment.' ';
120
+			if (($i % 2) == 0) {
121
+						$work_str2 .= $str_fragment.' ';
122
+			}
119 123
 			$i++;
120 124
 		}
121 125
 
Please login to merge, or discard this patch.
src/Mouf/Database/TDBM/Filters/BetweenFilter.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@
 block discarded – undo
101 101
      * @param string $value1
102 102
      * @param string $value2
103 103
 	 */
104
-	public function __construct($tableName=null, $columnName=null, $value1=null, $value2=null) {
104
+	public function __construct($tableName = null, $columnName = null, $value1 = null, $value2 = null) {
105 105
 		$this->tableName = $tableName;
106 106
 		$this->columnName = $columnName;
107 107
 		$this->value1 = $value1;
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
 	 * 
99 99
 	 * @param string $tableName
100 100
 	 * @param string $columnName
101
-	 * @param string $value
101
+	 * @param string $value1
102 102
 	 */
103 103
 	public function __construct($tableName=null, $columnName=null, $value1=null, $value2=null) {
104 104
 		$this->tableName = $tableName;
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 namespace Mouf\Database\TDBM\Filters;
3 3
 
4 4
 use Mouf\Database\TDBM\TDBMException;
5
-
6 5
 use Mouf\Database\DBConnection\ConnectionInterface;
7 6
 
8 7
 /*
Please login to merge, or discard this patch.
src/Mouf/Database/TDBM/Filters/DifferentFilter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
85 85
 	 * @param string $columnName
86 86
 	 * @param string $value
87 87
 	 */
88
-	public function __construct($tableName=null, $columnName=null, $value=null) {
88
+	public function __construct($tableName = null, $columnName = null, $value = null) {
89 89
 		$this->tableName = $tableName;
90 90
 		$this->columnName = $columnName;
91 91
 		$this->value = $value;
Please login to merge, or discard this patch.
src/Mouf/Database/TDBM/AmbiguityException.php 3 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 	public function explainAmbiguity() {
20 20
 		$all_paths = $this->getAllPossiblePaths();
21 21
 
22
-		$i=0;
22
+		$i = 0;
23 23
 		$width_px = 0;
24 24
 		$height_px = 0;
25 25
 		$global_height_px = 0;
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 
51 51
 	private static function getAllPossiblePathsRec($sub_table_paths)
52 52
 	{
53
-		if (count($sub_table_paths)==0)
53
+		if (count($sub_table_paths) == 0)
54 54
 		return array();
55 55
 
56 56
 		$table_path = array_shift($sub_table_paths);
57
-		$possible_sub_paths =  AmbiguityException::getAllPossiblePathsRec($sub_table_paths);
57
+		$possible_sub_paths = AmbiguityException::getAllPossiblePathsRec($sub_table_paths);
58 58
 		$return_table_paths = array();
59 59
 		foreach ($table_path['paths'] as $path) {
60 60
 			if (count($possible_sub_paths)>0)
Please login to merge, or discard this patch.
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -50,8 +50,9 @@  discard block
 block discarded – undo
50 50
 
51 51
 	private static function getAllPossiblePathsRec($sub_table_paths)
52 52
 	{
53
-		if (count($sub_table_paths)==0)
54
-		return array();
53
+		if (count($sub_table_paths)==0) {
54
+				return array();
55
+		}
55 56
 
56 57
 		$table_path = array_shift($sub_table_paths);
57 58
 		$possible_sub_paths =  AmbiguityException::getAllPossiblePathsRec($sub_table_paths);
@@ -63,9 +64,9 @@  discard block
 block discarded – undo
63 64
 				{
64 65
 					$return_table_paths[] = array_merge(array(array('paths'=>array($path))), $possible_sub_path);
65 66
 				}
67
+			} else {
68
+						$return_table_paths[] = array(array('paths'=>array($path)));
66 69
 			}
67
-			else
68
-			$return_table_paths[] = array(array('paths'=>array($path)));
69 70
 		}
70 71
 		return $return_table_paths;
71 72
 	}
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -170,6 +170,9 @@
 block discarded – undo
170 170
 	
171 171
 	protected $errorMsg;
172 172
 	
173
+	/**
174
+	 * @param string $msg
175
+	 */
173 176
 	private function displayErrorMsg($msg) {
174 177
 		$this->errorMsg = $msg;
175 178
 		$this->content->addFile(dirname(__FILE__)."/../../../../views/installError.php", $this);
Please login to merge, or discard this patch.
src/Mouf/Database/TDBM/TDBMObjectArray.php 3 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 class TDBMObjectArray extends \ArrayObject implements \JsonSerializable {
29 29
 	public function __get($var) {
30 30
 		$cnt = count($this);
31
-		if ($cnt==1)
31
+		if ($cnt == 1)
32 32
 		{
33 33
 			return $this[0]->__get($var);
34 34
 		}
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
 	public function __set($var, $value) {
46 46
 		$cnt = count($this);
47
-		if ($cnt==1)
47
+		if ($cnt == 1)
48 48
 		{
49 49
 			return $this[0]->__set($var, $value);
50 50
 		}
@@ -69,13 +69,13 @@  discard block
 block discarded – undo
69 69
 	 */
70 70
     public function __call($func_name, $values) {
71 71
 
72
-		if (strpos($func_name,"getarray_") === 0) {
72
+		if (strpos($func_name, "getarray_") === 0) {
73 73
 			$column = substr($func_name, 9);
74 74
 			return $this->getarray($column);
75
-		} elseif (strpos($func_name,"setarray_") === 0) {
75
+		} elseif (strpos($func_name, "setarray_") === 0) {
76 76
 			$column = substr($func_name, 9);
77 77
 			return $this->setarray($column, $values[0]);
78
-		} elseif (count($this)==1) {
78
+		} elseif (count($this) == 1) {
79 79
 			$this[0]->__call($func_name, $values);
80 80
 		}
81 81
 		else
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 		}
100 100
 	}
101 101
 	
102
-	public function jsonSerialize(){
102
+	public function jsonSerialize() {
103 103
 		return (array) $this;
104 104
 	}
105 105
 }
Please login to merge, or discard this patch.
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -31,12 +31,10 @@  discard block
 block discarded – undo
31 31
 		if ($cnt==1)
32 32
 		{
33 33
 			return $this[0]->__get($var);
34
-		}
35
-		elseif ($cnt>1)
34
+		} elseif ($cnt>1)
36 35
 		{
37 36
 			throw new TDBMException('Array contains many objects! Use getarray_'.$var.' to retrieve an array of '.$var);
38
-		}
39
-		else
37
+		} else
40 38
 		{
41 39
 			throw new TDBMException('Array contains no objects');
42 40
 		}
@@ -47,12 +45,10 @@  discard block
 block discarded – undo
47 45
 		if ($cnt==1)
48 46
 		{
49 47
 			return $this[0]->__set($var, $value);
50
-		}
51
-		elseif ($cnt>1)
48
+		} elseif ($cnt>1)
52 49
 		{
53 50
 			throw new TDBMException('Array contains many objects! Use setarray_'.$var.' to set the array of '.$var);
54
-		}
55
-		else
51
+		} else
56 52
 		{
57 53
 			throw new TDBMException('Array contains no objects');
58 54
 		}
@@ -77,8 +73,7 @@  discard block
 block discarded – undo
77 73
 			return $this->setarray($column, $values[0]);
78 74
 		} elseif (count($this)==1) {
79 75
 			$this[0]->__call($func_name, $values);
80
-		}
81
-		else
76
+		} else
82 77
 		{
83 78
 			throw new TDBMException("Method ".$func_name." not found");
84 79
 		}
Please login to merge, or discard this patch.
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -84,6 +84,9 @@  discard block
 block discarded – undo
84 84
 
85 85
 	}
86 86
 
87
+	/**
88
+	 * @param string $column
89
+	 */
87 90
 	private function getarray($column) {
88 91
 		$arr = array();
89 92
 		foreach ($this as $object) {
@@ -92,6 +95,9 @@  discard block
 block discarded – undo
92 95
 		return $arr;
93 96
 	}
94 97
 
98
+	/**
99
+	 * @param string $column
100
+	 */
95 101
 	private function setarray($column, $value) {
96 102
 		foreach ($this as $object) {
97 103
 			$object->__set($column, $value);
Please login to merge, or discard this patch.