Completed
Push — prado4-sauce ( 31ba42...77d75b )
by Fabio
16:20 queued 08:27
created
framework/Web/UI/ActiveControls/TActiveLabel.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,8 +60,8 @@
 block discarded – undo
60 60
 	 * @param THtmlWriter the writer used for the rendering purpose
61 61
 	 */
62 62
 	protected function addAttributesToRender($writer) {
63
-	    $writer->addAttribute('id',$this->getClientID());
64
-	    parent::addAttributesToRender($writer);
63
+		$writer->addAttribute('id',$this->getClientID());
64
+		parent::addAttributesToRender($writer);
65 65
 	}
66 66
 
67 67
 	/**
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	 */
56 56
 	public function setText($value)
57 57
 	{
58
-		if(parent::getText() === $value)
58
+		if(parent::getText()===$value)
59 59
 			return;
60 60
 
61 61
 		parent::setText($value);
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	 */
72 72
 	public function setForControl($value)
73 73
 	{
74
-		if(parent::getForControl() === $value)
74
+		if(parent::getForControl()===$value)
75 75
 			return;
76 76
 
77 77
 		parent::setForControl($value);
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	 * @param THtmlWriter the writer used for the rendering purpose
88 88
 	 */
89 89
 	protected function addAttributesToRender($writer) {
90
-	    $writer->addAttribute('id',$this->getClientID());
90
+	    $writer->addAttribute('id', $this->getClientID());
91 91
 	    parent::addAttributesToRender($writer);
92 92
 	}
93 93
 }
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveDataList.php 3 patches
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
    */
32 32
   public function __construct()
33 33
   {
34
-    parent::__construct();
35
-    $this->setAdapter(new TActiveControlAdapter($this));
34
+	parent::__construct();
35
+	$this->setAdapter(new TActiveControlAdapter($this));
36 36
   }
37 37
 
38 38
   /**
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
    */
41 41
   public function getActiveControl()
42 42
   {
43
-    return $this->getAdapter()->getBaseActiveControl();
43
+	return $this->getAdapter()->getBaseActiveControl();
44 44
   }
45 45
 
46 46
   /**
@@ -52,11 +52,11 @@  discard block
 block discarded – undo
52 52
    */
53 53
   public function setDataSource($value)
54 54
   {
55
-    parent::setDataSource($value);
56
-    if($this->getActiveControl()->canUpdateClientSide()) {
57
-      $this->renderPager();
58
-      $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter());
59
-    }
55
+	parent::setDataSource($value);
56
+	if($this->getActiveControl()->canUpdateClientSide()) {
57
+	  $this->renderPager();
58
+	  $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter());
59
+	}
60 60
   }
61 61
 
62 62
   /**
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
    */
66 66
   protected function getContainerID()
67 67
   {
68
-    return $this->ClientID.'_Container';
68
+	return $this->ClientID.'_Container';
69 69
   }
70 70
 
71 71
   /**
@@ -76,13 +76,13 @@  discard block
 block discarded – undo
76 76
    */
77 77
   public function render($writer)
78 78
   {
79
-    if($this->getHasPreRendered()) {
80
-      $this->renderDataList($writer);
81
-      if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(),$writer);
82
-    }
83
-    else {
84
-      $this->getPage()->getAdapter()->registerControlToRender($this,$writer);
85
-    }
79
+	if($this->getHasPreRendered()) {
80
+	  $this->renderDataList($writer);
81
+	  if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(),$writer);
82
+	}
83
+	else {
84
+	  $this->getPage()->getAdapter()->registerControlToRender($this,$writer);
85
+	}
86 86
   }
87 87
 
88 88
   /**
@@ -92,14 +92,14 @@  discard block
 block discarded – undo
92 92
    */
93 93
   private function renderPager()
94 94
   {
95
-    $pager=$this->getPage()->findControlsByType('TActivePager', false);
96
-    foreach($pager as $item)
97
-    {
98
-      if($item->ControlToPaginate==$this->ID) {
99
-        $writer=$this->getResponse()->createHtmlWriter();
100
-        $this->getPage()->getAdapter()->registerControlToRender($item,$writer);
101
-      }
102
-    }
95
+	$pager=$this->getPage()->findControlsByType('TActivePager', false);
96
+	foreach($pager as $item)
97
+	{
98
+	  if($item->ControlToPaginate==$this->ID) {
99
+		$writer=$this->getResponse()->createHtmlWriter();
100
+		$this->getPage()->getAdapter()->registerControlToRender($item,$writer);
101
+	  }
102
+	}
103 103
   }
104 104
 
105 105
   /**
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
    */
110 110
   private function renderDataList($writer)
111 111
   {
112
-    $writer->write('<span id="'.$this->getContainerID().'">');
113
-    parent::render($writer);
114
-    $writer->write('</span>');
112
+	$writer->write('<span id="'.$this->getContainerID().'">');
113
+	parent::render($writer);
114
+	$writer->write('</span>');
115 115
   }
116 116
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,8 +79,7 @@
 block discarded – undo
79 79
     if($this->getHasPreRendered()) {
80 80
       $this->renderDataList($writer);
81 81
       if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(),$writer);
82
-    }
83
-    else {
82
+    } else {
84 83
       $this->getPage()->getAdapter()->registerControlToRender($this,$writer);
85 84
     }
86 85
   }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     parent::setDataSource($value);
56 56
     if($this->getActiveControl()->canUpdateClientSide()) {
57 57
       $this->renderPager();
58
-      $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter());
58
+      $this->getPage()->getAdapter()->registerControlToRender($this, $this->getResponse()->createHtmlWriter());
59 59
     }
60 60
   }
61 61
 
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
   {
79 79
     if($this->getHasPreRendered()) {
80 80
       $this->renderDataList($writer);
81
-      if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(),$writer);
81
+      if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(), $writer);
82 82
     }
83 83
     else {
84
-      $this->getPage()->getAdapter()->registerControlToRender($this,$writer);
84
+      $this->getPage()->getAdapter()->registerControlToRender($this, $writer);
85 85
     }
86 86
   }
87 87
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     {
98 98
       if($item->ControlToPaginate==$this->ID) {
99 99
         $writer=$this->getResponse()->createHtmlWriter();
100
-        $this->getPage()->getAdapter()->registerControlToRender($item,$writer);
100
+        $this->getPage()->getAdapter()->registerControlToRender($item, $writer);
101 101
       }
102 102
     }
103 103
   }
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TCallbackClientSide.php 2 patches
Doc Comments   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 	}
200 200
 
201 201
 	/**
202
-	 * @return boolean true to post the inputs of the form on callback, default
202
+	 * @return string true to post the inputs of the form on callback, default
203 203
 	 * is post the inputs on callback.
204 204
 	 */
205 205
 	public function getPostState()
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 	}
218 218
 
219 219
 	/**
220
-	 * @return integer callback request timeout.
220
+	 * @return string callback request timeout.
221 221
 	 */
222 222
 	public function getRequestTimeOut()
223 223
 	{
@@ -261,6 +261,7 @@  discard block
 block discarded – undo
261 261
 	 * update. This will automatically set HasPrority to true.
262 262
 	 * @param boolean true enables the callback response to update the
263 263
 	 * viewstate.
264
+	 * @param boolean $value
264 265
 	 */
265 266
 	public function setEnablePageStateUpdate($value)
266 267
 	{
@@ -269,7 +270,7 @@  discard block
 block discarded – undo
269 270
 	}
270 271
 
271 272
 	/**
272
-	 * @return boolean client-side viewstate will be updated on callback
273
+	 * @return boolean|string client-side viewstate will be updated on callback
273 274
 	 * response if true. Default is true.
274 275
 	 */
275 276
 	public function getEnablePageStateUpdate()
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 	 */
265 265
 	public function setEnablePageStateUpdate($value)
266 266
 	{
267
-		$enabled = TPropertyValue::ensureBoolean($value);
267
+		$enabled=TPropertyValue::ensureBoolean($value);
268 268
 		$this->setOption('EnablePageStateUpdate', $enabled);
269 269
 	}
270 270
 
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 	 */
275 275
 	public function getEnablePageStateUpdate()
276 276
 	{
277
-		$option = $this->getOption('EnablePageStateUpdate');
277
+		$option=$this->getOption('EnablePageStateUpdate');
278 278
 		return ($option===null) ? true : $option;
279 279
 	}
280 280
 
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 	public function setPostBackTarget($value)
293 293
 	{
294 294
 		if($value instanceof TControl)
295
-			$value = $value->getUniqueID();
295
+			$value=$value->getUniqueID();
296 296
 		$this->setOption('EventTarget', $value);
297 297
 	}
298 298
 
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveDataGrid.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
 	}
69 69
 
70 70
 	/**
71
-	* Creates a new callback control, sets the adapter to
72
-	* TActiveControlAdapter.
73
-	*/
71
+	 * Creates a new callback control, sets the adapter to
72
+	 * TActiveControlAdapter.
73
+	 */
74 74
 	public function __construct() {
75 75
 		parent::__construct();
76 76
 		$this->setAdapter(new TActiveControlAdapter($this));
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	 * @param string $value container tag
112 112
 	 */
113 113
 	public function setSurroundingTag($value) {
114
-    $this->_surroundingTag=TPropertyValue::ensureString($value);
114
+	$this->_surroundingTag=TPropertyValue::ensureString($value);
115 115
 	}
116 116
 
117 117
 	/**
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 		parent::setDataSource($value);
90 90
 		if($this->getActiveControl()->canUpdateClientSide()) {
91 91
 			$this->renderPager();
92
-			$this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter());
92
+			$this->getPage()->getAdapter()->registerControlToRender($this, $this->getResponse()->createHtmlWriter());
93 93
 		}
94 94
 	}
95 95
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 	 * @param string CommandParameter corresponding to the OnCommand event of the button
132 132
 	 * @return mixed the button instance
133 133
 	 */
134
-	protected function createPagerButton($pager,$buttonType,$enabled,$text,$commandName,$commandParameter) {
134
+	protected function createPagerButton($pager, $buttonType, $enabled, $text, $commandName, $commandParameter) {
135 135
 		if($buttonType===TDataGridPagerButtonType::LinkButton) {
136 136
 			if($enabled)
137 137
 				$button=new TActiveLinkButton;
@@ -174,10 +174,10 @@  discard block
 block discarded – undo
174 174
 	public function render($writer) {
175 175
 		if($this->getHasPreRendered()) {
176 176
 			$this->renderDataGrid($writer);
177
-			if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getSurroundingTagId(),$writer);
177
+			if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getSurroundingTagId(), $writer);
178 178
 		}
179 179
 		else {
180
-			$this->getPage()->getAdapter()->registerControlToRender($this,$writer);
180
+			$this->getPage()->getAdapter()->registerControlToRender($this, $writer);
181 181
 		}
182 182
 	}
183 183
 
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 		foreach($pager as $item) {
192 192
 			if($item->ControlToPaginate==$this->ID) {
193 193
 				$writer=$this->getResponse()->createHtmlWriter();
194
-				$this->getPage()->getAdapter()->registerControlToRender($item,$writer);
194
+				$this->getPage()->getAdapter()->registerControlToRender($item, $writer);
195 195
 			}
196 196
 		}
197 197
 	}
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 	 * @param THtmlWriter writer for the rendering purpose
204 204
 	 */
205 205
 	private function renderDataGrid($writer) {
206
-	  $writer->addAttribute('id',$this->getSurroundingTagID());
206
+	  $writer->addAttribute('id', $this->getSurroundingTagID());
207 207
 	  $writer->renderBeginTag($this->getSurroundingTag());
208 208
 		parent::render($writer);
209 209
 		$writer->renderEndTag();
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -140,8 +140,7 @@  discard block
 block discarded – undo
140 140
 				$button->setText($text);
141 141
 				return $button;
142 142
 			}
143
-		}
144
-		else {
143
+		} else {
145 144
 			$button=new TActiveButton;
146 145
 			if(!$enabled)
147 146
 				$button->setEnabled(false);
@@ -175,8 +174,7 @@  discard block
 block discarded – undo
175 174
 		if($this->getHasPreRendered()) {
176 175
 			$this->renderDataGrid($writer);
177 176
 			if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getSurroundingTagId(),$writer);
178
-		}
179
-		else {
177
+		} else {
180 178
 			$this->getPage()->getAdapter()->registerControlToRender($this,$writer);
181 179
 		}
182 180
 	}
Please login to merge, or discard this patch.
framework/Collections/TAttributeCollection.php 2 patches
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -93,6 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
 	/**
95 95
 	 * @param boolean whether the keys are case-sensitive.
96
+	 * @param boolean $value
96 97
 	 */
97 98
 	public function setCaseSensitive($value)
98 99
 	{
@@ -126,6 +127,7 @@  discard block
 block discarded – undo
126 127
 	 * Removes an item from the map by its key.
127 128
 	 * This overrides the parent implementation by converting the key to lower case first if CaseSensitive is false.
128 129
 	 * @param mixed the key of the item to be removed
130
+	 * @param string $key
129 131
 	 * @return mixed the removed value, null if no such key exists.
130 132
 	 */
131 133
 	public function remove($key)
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
 	protected function __getZappableSleepProps(&$exprops)
54 54
 	{
55 55
 		parent::__getZappableSleepProps($exprops);
56
-		if ($this->_caseSensitive===false)
57
-			$exprops[] = "\0TAttributeCollection\0_caseSensitive";
56
+		if($this->_caseSensitive===false)
57
+			$exprops[]="\0TAttributeCollection\0_caseSensitive";
58 58
 	}
59 59
 
60 60
 	/**
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	 */
68 68
 	public function __get($name)
69 69
 	{
70
-		return $this->contains($name)?$this->itemAt($name):parent::__get($name);
70
+		return $this->contains($name) ? $this->itemAt($name) : parent::__get($name);
71 71
 	}
72 72
 
73 73
 	/**
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
 	 * @param mixed the property value or event handler
79 79
 	 * @throws TInvalidOperationException If the property is not defined or read-only.
80 80
 	 */
81
-	public function __set($name,$value)
81
+	public function __set($name, $value)
82 82
 	{
83
-		$this->add($name,$value);
83
+		$this->add($name, $value);
84 84
 	}
85 85
 
86 86
 	/**
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	 */
108 108
 	public function itemAt($key)
109 109
 	{
110
-		return parent::itemAt($this->_caseSensitive?$key:strtolower($key));
110
+		return parent::itemAt($this->_caseSensitive ? $key : strtolower($key));
111 111
 	}
112 112
 
113 113
 
@@ -117,9 +117,9 @@  discard block
 block discarded – undo
117 117
 	 * @param mixed key
118 118
 	 * @param mixed value
119 119
 	 */
120
-	public function add($key,$value)
120
+	public function add($key, $value)
121 121
 	{
122
-		parent::add($this->_caseSensitive?$key:strtolower($key),$value);
122
+		parent::add($this->_caseSensitive ? $key : strtolower($key), $value);
123 123
 	}
124 124
 
125 125
 	/**
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	 */
131 131
 	public function remove($key)
132 132
 	{
133
-		return parent::remove($this->_caseSensitive?$key:strtolower($key));
133
+		return parent::remove($this->_caseSensitive ? $key : strtolower($key));
134 134
 	}
135 135
 
136 136
 	/**
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 	 */
142 142
 	public function contains($key)
143 143
 	{
144
-		return parent::contains($this->_caseSensitive?$key:strtolower($key));
144
+		return parent::contains($this->_caseSensitive ? $key : strtolower($key));
145 145
 	}
146 146
 
147 147
 	/**
Please login to merge, or discard this patch.
framework/I18N/TGlobalization.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
 	}
91 91
 
92 92
 	/**
93
-	 * @return string default culture
93
+	 * @return boolean default culture
94 94
 	 */
95 95
 	public function getTranslateDefaultCulture()
96 96
 	{
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -29,13 +29,13 @@  discard block
 block discarded – undo
29 29
 	 * Default character set is 'UTF-8'.
30 30
 	 * @var string
31 31
 	 */
32
-	private $_defaultCharset = 'UTF-8';
32
+	private $_defaultCharset='UTF-8';
33 33
 
34 34
 	/**
35 35
 	 * Default culture is 'en'.
36 36
 	 * @var string
37 37
 	 */
38
-	private $_defaultCulture = 'en';
38
+	private $_defaultCulture='en';
39 39
 
40 40
 	/**
41 41
 	 * The current charset.
@@ -77,11 +77,11 @@  discard block
 block discarded – undo
77 77
 		if($config!==null)
78 78
 		{
79 79
 			if($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP)
80
-				$translation = isset($config['translate'])?$config['translate']:null;
80
+				$translation=isset($config['translate']) ? $config['translate'] : null;
81 81
 			else
82 82
 			{
83
-				$t = $config->getElementByTagName('translation');
84
-				$translation = ($t)?$t->getAttributes():null;
83
+				$t=$config->getElementByTagName('translation');
84
+				$translation=($t) ? $t->getAttributes() : null;
85 85
 			}
86 86
 			if($translation)
87 87
 				$this->setTranslationConfiguration($translation);
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	 */
103 103
 	public function setTranslateDefaultCulture($value)
104 104
 	{
105
-		$this->_translateDefaultCulture = TPropertyValue::ensureBoolean($value);
105
+		$this->_translateDefaultCulture=TPropertyValue::ensureBoolean($value);
106 106
 	}
107 107
 
108 108
 	/**
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 	 */
119 119
 	public function setDefaultCulture($culture)
120 120
 	{
121
-		$this->_defaultCulture = str_replace('-','_',$culture);
121
+		$this->_defaultCulture=str_replace('-', '_', $culture);
122 122
 	}
123 123
 
124 124
 	/**
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 	 */
135 135
 	public function setDefaultCharset($charset)
136 136
 	{
137
-		$this->_defaultCharset = $charset;
137
+		$this->_defaultCharset=$charset;
138 138
 	}
139 139
 
140 140
 	/**
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 	 */
151 151
 	public function setCulture($culture)
152 152
 	{
153
-		$this->_culture = str_replace('-','_',$culture);
153
+		$this->_culture=str_replace('-', '_', $culture);
154 154
 	}
155 155
 
156 156
 	/**
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 	 */
167 167
 	public function setCharset($charset)
168 168
 	{
169
-		$this->_charset = $charset;
169
+		$this->_charset=$charset;
170 170
 	}
171 171
 
172 172
 	/**
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 	 */
175 175
 	public function getTranslationConfiguration()
176 176
 	{
177
-		return (!$this->_translateDefaultCulture && ($this->getDefaultCulture() == $this->getCulture()))
177
+		return (!$this->_translateDefaultCulture && ($this->getDefaultCulture()==$this->getCulture()))
178 178
 			? null
179 179
 			: $this->_translation;
180 180
 	}
@@ -196,11 +196,11 @@  discard block
 block discarded – undo
196 196
 	 */
197 197
 	protected function setTranslationConfiguration($config)
198 198
 	{
199
-		if($config['type'] == 'XLIFF' || $config['type'] == 'gettext')
199
+		if($config['type']=='XLIFF' || $config['type']=='gettext')
200 200
 		{
201 201
 			if($config['source'])
202 202
 			{
203
-				$config['source'] = Prado::getPathOfNamespace($config['source']);
203
+				$config['source']=Prado::getPathOfNamespace($config['source']);
204 204
 				if(!is_dir($config['source']))
205 205
 				{
206 206
 					if(@mkdir($config['source'])===false)
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 		}
217 217
 		if($config['cache'])
218 218
 		{
219
-			$config['cache'] = $this->getApplication()->getRunTimePath().'/i18n';
219
+			$config['cache']=$this->getApplication()->getRunTimePath().'/i18n';
220 220
 			if(!is_dir($config['cache']))
221 221
 			{
222 222
 				if(@mkdir($config['cache'])===false)
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 				chmod($config['cache'], PRADO_CHMOD); //make it deletable
226 226
 			}
227 227
 		}
228
-		$this->_translation = $config;
228
+		$this->_translation=$config;
229 229
 	}
230 230
 
231 231
 	/**
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 	 */
242 242
 	public function setTranslationCatalogue($value)
243 243
 	{
244
-		$this->_translation['catalogue'] = $value;
244
+		$this->_translation['catalogue']=$value;
245 245
 	}
246 246
 
247 247
 	/**
@@ -252,11 +252,11 @@  discard block
 block discarded – undo
252 252
 	 */
253 253
 	public function getCultureVariants($culture=null)
254 254
 	{
255
-		if($culture===null) $culture = $this->getCulture();
256
-		$variants = explode('_', $culture);
257
-		$result = array();
255
+		if($culture===null) $culture=$this->getCulture();
256
+		$variants=explode('_', $culture);
257
+		$result=array();
258 258
 		for(; count($variants) > 0; array_pop($variants))
259
-			$result[] = implode('_', $variants);
259
+			$result[]=implode('_', $variants);
260 260
 		return $result;
261 261
 	}
262 262
 
@@ -279,17 +279,17 @@  discard block
 block discarded – undo
279 279
 	 * @param string culture string, null to use current culture
280 280
 	 * @return array list of possible localized resource files.
281 281
 	 */
282
-	public function getLocalizedResource($file,$culture=null)
282
+	public function getLocalizedResource($file, $culture=null)
283 283
 	{
284
-		$files = array();
285
-		$variants = $this->getCultureVariants($culture);
286
-		$path = pathinfo($file);
284
+		$files=array();
285
+		$variants=$this->getCultureVariants($culture);
286
+		$path=pathinfo($file);
287 287
 		foreach($variants as $variant)
288
-			$files[] = $path['dirname'].DIRECTORY_SEPARATOR.$variant.DIRECTORY_SEPARATOR.$path['basename'];
289
-		$filename = substr($path['basename'],0,strrpos($path['basename'],'.'));
288
+			$files[]=$path['dirname'].DIRECTORY_SEPARATOR.$variant.DIRECTORY_SEPARATOR.$path['basename'];
289
+		$filename=substr($path['basename'], 0, strrpos($path['basename'], '.'));
290 290
 		foreach($variants as $variant)
291
-			$files[] = $path['dirname'].DIRECTORY_SEPARATOR.$filename.'.'.$variant.'.'.$path['extension'];
292
-		$files[] = $file;
291
+			$files[]=$path['dirname'].DIRECTORY_SEPARATOR.$filename.'.'.$variant.'.'.$path['extension'];
292
+		$files[]=$file;
293 293
 		return $files;
294 294
 	}
295 295
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -233,8 +233,7 @@  discard block
 block discarded – undo
233 233
 				$newid=substr($id,$pos+1);
234 234
 				if ($control!==null)
235 235
 					$control=$control->$newid;
236
-			}
237
-			else
236
+			} else
238 237
 			{
239 238
 				// TCheckBoxList overrides findControl() with a fake implementation
240 239
 				// but accepts a second parameter to use the standard one
@@ -296,8 +295,7 @@  discard block
 block discarded – undo
296 295
 		{
297 296
 			$group=$this->getValidationGroup();
298 297
 			return $this->getPage()->getValidators($group)->getCount()>0;
299
-		}
300
-		else
298
+		} else
301 299
 			return false;
302 300
 	}
303 301
 
Please login to merge, or discard this patch.
framework/Security/TUser.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -73,6 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
 	/**
75 75
 	 * @param string username
76
+	 * @param string $value
76 77
 	 */
77 78
 	public function setName($value)
78 79
 	{
@@ -89,6 +90,7 @@  discard block
 block discarded – undo
89 90
 
90 91
 	/**
91 92
 	 * @param boolean if the user is a guest
93
+	 * @param boolean $value
92 94
 	 */
93 95
 	public function setIsGuest($value)
94 96
 	{
@@ -170,6 +172,7 @@  discard block
 block discarded – undo
170 172
 	 *
171 173
 	 * @param string variable name
172 174
 	 * @param mixed default value
175
+	 * @param string $key
173 176
 	 * @return mixed the value of the variable. If it doesn't exist, the provided default value will be returned
174 177
 	 * @see setState
175 178
 	 */
@@ -190,6 +193,7 @@  discard block
 block discarded – undo
190 193
 	 * @param string variable name
191 194
 	 * @param mixed variable value
192 195
 	 * @param mixed default value. If $value===$defaultValue, the variable will be removed from persistent storage.
196
+	 * @param string $key
193 197
 	 * @see getState
194 198
 	 */
195 199
 	protected function setState($key,$value,$defaultValue=null)
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 */
69 69
 	public function getName()
70 70
 	{
71
-		return $this->getState('Name','');
71
+		return $this->getState('Name', '');
72 72
 	}
73 73
 
74 74
 	/**
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	 */
77 77
 	public function setName($value)
78 78
 	{
79
-		$this->setState('Name',$value,'');
79
+		$this->setState('Name', $value, '');
80 80
 	}
81 81
 
82 82
 	/**
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	 */
85 85
 	public function getIsGuest()
86 86
 	{
87
-		return $this->getState('IsGuest',true);
87
+		return $this->getState('IsGuest', true);
88 88
 	}
89 89
 
90 90
 	/**
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 			$this->setName($this->_manager->getGuestName());
98 98
 			$this->setRoles(array());
99 99
 		}
100
-		$this->setState('IsGuest',$isGuest);
100
+		$this->setState('IsGuest', $isGuest);
101 101
 	}
102 102
 
103 103
 	/**
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 	 */
106 106
 	public function getRoles()
107 107
 	{
108
-		return $this->getState('Roles',array());
108
+		return $this->getState('Roles', array());
109 109
 	}
110 110
 
111 111
 	/**
@@ -114,16 +114,16 @@  discard block
 block discarded – undo
114 114
 	public function setRoles($value)
115 115
 	{
116 116
 		if(is_array($value))
117
-			$this->setState('Roles',$value,array());
117
+			$this->setState('Roles', $value, array());
118 118
 		else
119 119
 		{
120 120
 			$roles=array();
121
-			foreach(explode(',',$value) as $role)
121
+			foreach(explode(',', $value) as $role)
122 122
 			{
123 123
 				if(($role=trim($role))!=='')
124 124
 					$roles[]=$role;
125 125
 			}
126
-			$this->setState('Roles',$roles,array());
126
+			$this->setState('Roles', $roles, array());
127 127
 		}
128 128
 	}
129 129
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 	public function isInRole($role)
135 135
 	{
136 136
 		foreach($this->getRoles() as $r)
137
-			if(strcasecmp($role,$r)===0)
137
+			if(strcasecmp($role, $r)===0)
138 138
 				return true;
139 139
 		return false;
140 140
 	}
@@ -173,9 +173,9 @@  discard block
 block discarded – undo
173 173
 	 * @return mixed the value of the variable. If it doesn't exist, the provided default value will be returned
174 174
 	 * @see setState
175 175
 	 */
176
-	protected function getState($key,$defaultValue=null)
176
+	protected function getState($key, $defaultValue=null)
177 177
 	{
178
-		return isset($this->_state[$key])?$this->_state[$key]:$defaultValue;
178
+		return isset($this->_state[$key]) ? $this->_state[$key] : $defaultValue;
179 179
 	}
180 180
 
181 181
 	/**
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	 * @param mixed default value. If $value===$defaultValue, the variable will be removed from persistent storage.
193 193
 	 * @see getState
194 194
 	 */
195
-	protected function setState($key,$value,$defaultValue=null)
195
+	protected function setState($key, $value, $defaultValue=null)
196 196
 	{
197 197
 		if($value===$defaultValue)
198 198
 			unset($this->_state[$key]);
Please login to merge, or discard this patch.
framework/Web/TAssetManager.php 3 patches
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -215,6 +215,7 @@  discard block
 block discarded – undo
215 215
 	 * This method does not perform any publishing. It merely tells you
216 216
 	 * if the file path is published, what the URL will be to access it.
217 217
 	 * @param string directory or file path being published
218
+	 * @param string $path
218 219
 	 * @return string the published URL for the file path
219 220
 	 */
220 221
 	public function getPublishedUrl($path)
@@ -230,6 +231,7 @@  discard block
 block discarded – undo
230 231
 	 * Generate a CRC32 hash for the directory path. Collisions are higher
231 232
 	 * than MD5 but generates a much smaller hash string.
232 233
 	 * @param string string to be hashed.
234
+	 * @param string $dir
233 235
 	 * @return string hashed string.
234 236
 	 */
235 237
 	protected function hash($dir)
@@ -243,6 +245,8 @@  discard block
 block discarded – undo
243 245
 	 * or has an older file modification time.
244 246
 	 * @param string source file path
245 247
 	 * @param string destination directory (if not exists, it will be created)
248
+	 * @param string $src
249
+	 * @param string $dst
246 250
 	 */
247 251
 	protected function copyFile($src,$dst)
248 252
 	{
@@ -265,6 +269,8 @@  discard block
 block discarded – undo
265 269
 	 * File modification time is used to ensure the copied files are latest.
266 270
 	 * @param string the source directory
267 271
 	 * @param string the destination directory
272
+	 * @param string $src
273
+	 * @param string $dst
268 274
 	 * @todo a generic solution to ignore certain directories and files
269 275
 	 */
270 276
 	public function copyDirectory($src,$dst)
@@ -306,6 +312,8 @@  discard block
 block discarded – undo
306 312
 	 * @param string tar filename
307 313
 	 * @param string MD5 checksum for the corresponding tar file.
308 314
 	 * @param boolean Wether or not to check the time stamp of the file for publishing. Defaults to false.
315
+	 * @param string $tarfile
316
+	 * @param string $md5sum
309 317
 	 * @return string URL path to the directory where the tar file was extracted.
310 318
 	 */
311 319
 	public function publishTarFile($tarfile, $md5sum, $checkTimestamp=false)
@@ -336,6 +344,7 @@  discard block
 block discarded – undo
336 344
 	 * N.B Tar file must not be compressed.
337 345
 	 * @param string tar file
338 346
 	 * @param string path where the contents of tar file are to be extracted
347
+	 * @param string $destination
339 348
 	 * @return boolean true if extract successful, false otherwise.
340 349
 	 */
341 350
 	protected function deployTarFile($path,$destination)
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -163,8 +163,7 @@  discard block
 block discarded – undo
163 163
 			if(!is_file($dst.DIRECTORY_SEPARATOR.$fileName) || $checkTimestamp || $this->getApplication()->getMode()!==TApplicationMode::Performance)
164 164
 				$this->copyFile($fullpath,$dst);
165 165
 			return $this->_published[$path]=$this->_baseUrl.'/'.$dir.'/'.$fileName;
166
-		}
167
-		else
166
+		} else
168 167
 		{
169 168
 			$dir=$this->hash($fullpath);
170 169
 			if(!is_dir($this->_basePath.DIRECTORY_SEPARATOR.$dir) || $checkTimestamp || $this->getApplication()->getMode()!==TApplicationMode::Performance)
@@ -287,8 +286,7 @@  discard block
 block discarded – undo
287 286
 						@copy($src.DIRECTORY_SEPARATOR.$file,$dst.DIRECTORY_SEPARATOR.$file);
288 287
 						@chmod($dst.DIRECTORY_SEPARATOR.$file, PRADO_CHMOD);
289 288
 					}
290
-				}
291
-				else
289
+				} else
292 290
 					$this->copyDirectory($src.DIRECTORY_SEPARATOR.$file,$dst.DIRECTORY_SEPARATOR.$file);
293 291
 			}
294 292
 			closedir($folder);
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -91,9 +91,9 @@  discard block
 block discarded – undo
91 91
 		if($this->_basePath===null)
92 92
 			$this->_basePath=dirname($application->getRequest()->getApplicationFilePath()).DIRECTORY_SEPARATOR.self::DEFAULT_BASEPATH;
93 93
 		if(!is_writable($this->_basePath) || !is_dir($this->_basePath))
94
-			throw new TConfigurationException('assetmanager_basepath_invalid',$this->_basePath);
94
+			throw new TConfigurationException('assetmanager_basepath_invalid', $this->_basePath);
95 95
 		if($this->_baseUrl===null)
96
-			$this->_baseUrl=rtrim(dirname($application->getRequest()->getApplicationUrl()),'/\\').'/'.self::DEFAULT_BASEPATH;
96
+			$this->_baseUrl=rtrim(dirname($application->getRequest()->getApplicationUrl()), '/\\').'/'.self::DEFAULT_BASEPATH;
97 97
 		$application->setAssetManager($this);
98 98
 		$this->_initialized=true;
99 99
 	}
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 		{
121 121
 			$this->_basePath=Prado::getPathOfNamespace($value);
122 122
 			if($this->_basePath===null || !is_dir($this->_basePath) || !is_writable($this->_basePath))
123
-				throw new TInvalidDataValueException('assetmanager_basepath_invalid',$value);
123
+				throw new TInvalidDataValueException('assetmanager_basepath_invalid', $value);
124 124
 		}
125 125
 	}
126 126
 
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 		if($this->_initialized)
142 142
 			throw new TInvalidOperationException('assetmanager_baseurl_unchangeable');
143 143
 		else
144
-			$this->_baseUrl=rtrim($value,'/');
144
+			$this->_baseUrl=rtrim($value, '/');
145 145
 	}
146 146
 
147 147
 	/**
@@ -158,19 +158,19 @@  discard block
 block discarded – undo
158 158
 	 * @throws TInvalidDataValueException if the file path to be published is
159 159
 	 * invalid
160 160
 	 */
161
-	public function publishFilePath($path,$checkTimestamp=false)
161
+	public function publishFilePath($path, $checkTimestamp=false)
162 162
 	{
163 163
 		if(isset($this->_published[$path]))
164 164
 			return $this->_published[$path];
165 165
 		else if(empty($path) || ($fullpath=realpath($path))===false)
166
-			throw new TInvalidDataValueException('assetmanager_filepath_invalid',$path);
166
+			throw new TInvalidDataValueException('assetmanager_filepath_invalid', $path);
167 167
 		else if(is_file($fullpath))
168 168
 		{
169 169
 			$dir=$this->hash(dirname($fullpath));
170 170
 			$fileName=basename($fullpath);
171 171
 			$dst=$this->_basePath.DIRECTORY_SEPARATOR.$dir;
172 172
 			if(!is_file($dst.DIRECTORY_SEPARATOR.$fileName) || $checkTimestamp || $this->getApplication()->getMode()!==TApplicationMode::Performance)
173
-				$this->copyFile($fullpath,$dst);
173
+				$this->copyFile($fullpath, $dst);
174 174
 			return $this->_published[$path]=$this->_baseUrl.'/'.$dir.'/'.$fileName;
175 175
 		}
176 176
 		else
@@ -178,8 +178,8 @@  discard block
 block discarded – undo
178 178
 			$dir=$this->hash($fullpath);
179 179
 			if(!is_dir($this->_basePath.DIRECTORY_SEPARATOR.$dir) || $checkTimestamp || $this->getApplication()->getMode()!==TApplicationMode::Performance)
180 180
 			{
181
-				Prado::trace("Publishing directory $fullpath",'Prado\Web\TAssetManager');
182
-				$this->copyDirectory($fullpath,$this->_basePath.DIRECTORY_SEPARATOR.$dir);
181
+				Prado::trace("Publishing directory $fullpath", 'Prado\Web\TAssetManager');
182
+				$this->copyDirectory($fullpath, $this->_basePath.DIRECTORY_SEPARATOR.$dir);
183 183
 			}
184 184
 			return $this->_published[$path]=$this->_baseUrl.'/'.$dir;
185 185
 		}
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 	 */
201 201
 	protected function setPublished($values=array())
202 202
 	{
203
-		$this->_published = $values;
203
+		$this->_published=$values;
204 204
 	}
205 205
 
206 206
 	/**
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 	 */
244 244
 	protected function hash($dir)
245 245
 	{
246
-		return sprintf('%x',crc32($dir.Prado::getVersion()));
246
+		return sprintf('%x', crc32($dir.Prado::getVersion()));
247 247
 	}
248 248
 
249 249
 	/**
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 	 * @param string source file path
254 254
 	 * @param string destination directory (if not exists, it will be created)
255 255
 	 */
256
-	protected function copyFile($src,$dst)
256
+	protected function copyFile($src, $dst)
257 257
 	{
258 258
 		if(!is_dir($dst))
259 259
 		{
@@ -261,10 +261,10 @@  discard block
 block discarded – undo
261 261
 			@chmod($dst, PRADO_CHMOD);
262 262
 		}
263 263
 		$dstFile=$dst.DIRECTORY_SEPARATOR.basename($src);
264
-		if(@filemtime($dstFile)<@filemtime($src))
264
+		if(@filemtime($dstFile) < @filemtime($src))
265 265
 		{
266
-			Prado::trace("Publishing file $src to $dstFile",'Prado\Web\TAssetManager');
267
-			@copy($src,$dstFile);
266
+			Prado::trace("Publishing file $src to $dstFile", 'Prado\Web\TAssetManager');
267
+			@copy($src, $dstFile);
268 268
 		}
269 269
 	}
270 270
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 	 * @param string the destination directory
277 277
 	 * @todo a generic solution to ignore certain directories and files
278 278
 	 */
279
-	public function copyDirectory($src,$dst)
279
+	public function copyDirectory($src, $dst)
280 280
 	{
281 281
 		if(!is_dir($dst))
282 282
 		{
@@ -291,14 +291,14 @@  discard block
 block discarded – undo
291 291
 					continue;
292 292
 				else if(is_file($src.DIRECTORY_SEPARATOR.$file))
293 293
 				{
294
-					if(@filemtime($dst.DIRECTORY_SEPARATOR.$file)<@filemtime($src.DIRECTORY_SEPARATOR.$file))
294
+					if(@filemtime($dst.DIRECTORY_SEPARATOR.$file) < @filemtime($src.DIRECTORY_SEPARATOR.$file))
295 295
 					{
296
-						@copy($src.DIRECTORY_SEPARATOR.$file,$dst.DIRECTORY_SEPARATOR.$file);
296
+						@copy($src.DIRECTORY_SEPARATOR.$file, $dst.DIRECTORY_SEPARATOR.$file);
297 297
 						@chmod($dst.DIRECTORY_SEPARATOR.$file, PRADO_CHMOD);
298 298
 					}
299 299
 				}
300 300
 				else
301
-					$this->copyDirectory($src.DIRECTORY_SEPARATOR.$file,$dst.DIRECTORY_SEPARATOR.$file);
301
+					$this->copyDirectory($src.DIRECTORY_SEPARATOR.$file, $dst.DIRECTORY_SEPARATOR.$file);
302 302
 			}
303 303
 			closedir($folder);
304 304
 		} else {
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 		if(isset($this->_published[$md5sum]))
323 323
 			return $this->_published[$md5sum];
324 324
 		else if(($fullpath=realpath($md5sum))===false || !is_file($fullpath))
325
-			throw new TInvalidDataValueException('assetmanager_tarchecksum_invalid',$md5sum);
325
+			throw new TInvalidDataValueException('assetmanager_tarchecksum_invalid', $md5sum);
326 326
 		else
327 327
 		{
328 328
 			$dir=$this->hash(dirname($fullpath));
@@ -330,10 +330,10 @@  discard block
 block discarded – undo
330 330
 			$dst=$this->_basePath.DIRECTORY_SEPARATOR.$dir;
331 331
 			if(!is_file($dst.DIRECTORY_SEPARATOR.$fileName) || $checkTimestamp || $this->getApplication()->getMode()!==TApplicationMode::Performance)
332 332
 			{
333
-				if(@filemtime($dst.DIRECTORY_SEPARATOR.$fileName)<@filemtime($fullpath))
333
+				if(@filemtime($dst.DIRECTORY_SEPARATOR.$fileName) < @filemtime($fullpath))
334 334
 				{
335
-					$this->copyFile($fullpath,$dst);
336
-					$this->deployTarFile($tarfile,$dst);
335
+					$this->copyFile($fullpath, $dst);
336
+					$this->deployTarFile($tarfile, $dst);
337 337
 				}
338 338
 			}
339 339
 			return $this->_published[$md5sum]=$this->_baseUrl.'/'.$dir;
@@ -347,13 +347,13 @@  discard block
 block discarded – undo
347 347
 	 * @param string path where the contents of tar file are to be extracted
348 348
 	 * @return boolean true if extract successful, false otherwise.
349 349
 	 */
350
-	protected function deployTarFile($path,$destination)
350
+	protected function deployTarFile($path, $destination)
351 351
 	{
352 352
 		if(($fullpath=realpath($path))===false || !is_file($fullpath))
353
-			throw new TIOException('assetmanager_tarfile_invalid',$path);
353
+			throw new TIOException('assetmanager_tarfile_invalid', $path);
354 354
 		else
355 355
 		{
356
-			$tar = new TTarFileExtractor($fullpath);
356
+			$tar=new TTarFileExtractor($fullpath);
357 357
 			return $tar->extract($destination);
358 358
 		}
359 359
 	}
Please login to merge, or discard this patch.
framework/Data/DataGateway/TTableGateway.php 3 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -416,8 +416,7 @@
 block discarded – undo
416 416
 		{
417 417
 			$useArgs = !is_array($parameters) && is_array($args);
418 418
 			return new TSqlCriteria($criteria,$useArgs ? $args : $parameters);
419
-		}
420
-		else if($criteria instanceof TSqlCriteria)
419
+		} else if($criteria instanceof TSqlCriteria)
421 420
 			return $criteria;
422 421
 		else
423 422
 			throw new TDbException('dbtablegateway_invalid_criteria');
Please login to merge, or discard this patch.
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	 * @param string|TDbTableInfo table or view name or table information.
88 88
 	 * @param TDbConnection database connection.
89 89
 	 */
90
-	public function __construct($table,$connection)
90
+	public function __construct($table, $connection)
91 91
 	{
92 92
 		$this->_connection=$connection;
93 93
 		if(is_string($table))
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	 */
104 104
 	protected function setTableInfo($tableInfo)
105 105
 	{
106
-		$builder = $tableInfo->createCommandBuilder($this->getDbConnection());
106
+		$builder=$tableInfo->createCommandBuilder($this->getDbConnection());
107 107
 		$this->initCommandBuilder($builder);
108 108
 	}
109 109
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 	protected function setTableName($tableName)
115 115
 	{
116 116
 		Prado::using('System.Data.Common.TDbMetaData');
117
-		$meta = TDbMetaData::getInstance($this->getDbConnection());
117
+		$meta=TDbMetaData::getInstance($this->getDbConnection());
118 118
 		$this->initCommandBuilder($meta->createCommandBuilder($tableName));
119 119
 	}
120 120
 
@@ -133,9 +133,9 @@  discard block
 block discarded – undo
133 133
 	 */
134 134
 	protected function initCommandBuilder($builder)
135 135
 	{
136
-		$this->_command = new TDataGatewayCommand($builder);
137
-		$this->_command->OnCreateCommand[] = array($this, 'onCreateCommand');
138
-		$this->_command->OnExecuteCommand[] = array($this, 'onExecuteCommand');
136
+		$this->_command=new TDataGatewayCommand($builder);
137
+		$this->_command->OnCreateCommand[]=array($this, 'onCreateCommand');
138
+		$this->_command->OnExecuteCommand[]=array($this, 'onExecuteCommand');
139 139
 	}
140 140
 
141 141
 	/**
@@ -189,8 +189,8 @@  discard block
 block discarded – undo
189 189
 	 */
190 190
 	public function findBySql($sql, $parameters=array())
191 191
 	{
192
-		$args = func_num_args() > 1 ? array_slice(func_get_args(),1) : null;
193
-		$criteria = $this->getCriteria($sql,$parameters, $args);
192
+		$args=func_num_args() > 1 ? array_slice(func_get_args(), 1) : null;
193
+		$criteria=$this->getCriteria($sql, $parameters, $args);
194 194
 		return $this->getCommand()->findBySql($criteria);
195 195
 	}
196 196
 
@@ -202,8 +202,8 @@  discard block
 block discarded – undo
202 202
 	 */
203 203
 	public function findAllBySql($sql, $parameters=array())
204 204
 	{
205
-		$args = func_num_args() > 1 ? array_slice(func_get_args(),1) : null;
206
-		$criteria = $this->getCriteria($sql,$parameters, $args);
205
+		$args=func_num_args() > 1 ? array_slice(func_get_args(), 1) : null;
206
+		$criteria=$this->getCriteria($sql, $parameters, $args);
207 207
 		return $this->getCommand()->findAllBySql($criteria);
208 208
 	}
209 209
 
@@ -226,8 +226,8 @@  discard block
 block discarded – undo
226 226
 	 */
227 227
 	public function find($criteria, $parameters=array())
228 228
 	{
229
-		$args = func_num_args() > 1 ? array_slice(func_get_args(),1) : null;
230
-		$criteria = $this->getCriteria($criteria,$parameters, $args);
229
+		$args=func_num_args() > 1 ? array_slice(func_get_args(), 1) : null;
230
+		$criteria=$this->getCriteria($criteria, $parameters, $args);
231 231
 		return $this->getCommand()->find($criteria);
232 232
 	}
233 233
 
@@ -239,9 +239,9 @@  discard block
 block discarded – undo
239 239
 	 */
240 240
 	public function findAll($criteria=null, $parameters=array())
241 241
 	{
242
-		$args = func_num_args() > 1 ? array_slice(func_get_args(),1) : null;
242
+		$args=func_num_args() > 1 ? array_slice(func_get_args(), 1) : null;
243 243
 		if($criteria!==null)
244
-			$criteria = $this->getCriteria($criteria,$parameters, $args);
244
+			$criteria=$this->getCriteria($criteria, $parameters, $args);
245 245
 		return $this->getCommand()->findAll($criteria);
246 246
 	}
247 247
 
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 	public function findByPk($keys)
261 261
 	{
262 262
 		if(func_num_args() > 1)
263
-			$keys = func_get_args();
263
+			$keys=func_get_args();
264 264
 		return $this->getCommand()->findByPk($keys);
265 265
 	}
266 266
 
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 	public function findAllByPks($keys)
285 285
 	{
286 286
 		if(func_num_args() > 1)
287
-			$keys = func_get_args();
287
+			$keys=func_get_args();
288 288
 		return $this->getCommand()->findAllByPk($keys);
289 289
 	}
290 290
 
@@ -301,8 +301,8 @@  discard block
 block discarded – undo
301 301
 	 */
302 302
 	public function deleteAll($criteria, $parameters=array())
303 303
 	{
304
-		$args = func_num_args() > 1 ? array_slice(func_get_args(),1) : null;
305
-		$criteria = $this->getCriteria($criteria,$parameters, $args);
304
+		$args=func_num_args() > 1 ? array_slice(func_get_args(), 1) : null;
305
+		$criteria=$this->getCriteria($criteria, $parameters, $args);
306 306
 		return $this->getCommand()->delete($criteria);
307 307
 	}
308 308
 
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 	public function deleteByPk($keys)
333 333
 	{
334 334
 		if(func_num_args() > 1)
335
-			$keys = func_get_args();
335
+			$keys=func_get_args();
336 336
 		return $this->getCommand()->deleteByPk($keys);
337 337
 	}
338 338
 
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 	public function deleteAllByPks($keys)
343 343
 	{
344 344
 		if(func_num_args() > 1)
345
-			$keys = func_get_args();
345
+			$keys=func_get_args();
346 346
 		return $this->deleteByPk($keys);
347 347
 	}
348 348
 
@@ -352,11 +352,11 @@  discard block
 block discarded – undo
352 352
 	 * @param mixed parameter values.
353 353
 	 * @return int number of records.
354 354
 	 */
355
-	public function count($criteria=null,$parameters=array())
355
+	public function count($criteria=null, $parameters=array())
356 356
 	{
357
-		$args = func_num_args() > 1 ? array_slice(func_get_args(),1) : null;
357
+		$args=func_num_args() > 1 ? array_slice(func_get_args(), 1) : null;
358 358
 		if($criteria!==null)
359
-			$criteria = $this->getCriteria($criteria,$parameters, $args);
359
+			$criteria=$this->getCriteria($criteria, $parameters, $args);
360 360
 		return $this->getCommand()->count($criteria);
361 361
 	}
362 362
 
@@ -376,8 +376,8 @@  discard block
 block discarded – undo
376 376
 	 */
377 377
 	public function update($data, $criteria, $parameters=array())
378 378
 	{
379
-		$args = func_num_args() > 2 ? array_slice(func_get_args(),2) : null;
380
-		$criteria = $this->getCriteria($criteria,$parameters, $args);
379
+		$args=func_num_args() > 2 ? array_slice(func_get_args(), 2) : null;
380
+		$criteria=$this->getCriteria($criteria, $parameters, $args);
381 381
 		return $this->getCommand()->update($data, $criteria);
382 382
 	}
383 383
 
@@ -414,8 +414,8 @@  discard block
 block discarded – undo
414 414
 	{
415 415
 		if(is_string($criteria))
416 416
 		{
417
-			$useArgs = !is_array($parameters) && is_array($args);
418
-			return new TSqlCriteria($criteria,$useArgs ? $args : $parameters);
417
+			$useArgs=!is_array($parameters) && is_array($args);
418
+			return new TSqlCriteria($criteria, $useArgs ? $args : $parameters);
419 419
 		}
420 420
 		else if($criteria instanceof TSqlCriteria)
421 421
 			return $criteria;
@@ -452,21 +452,21 @@  discard block
 block discarded – undo
452 452
 	 * @return mixed single record if method name starts with "findBy", 0 or more records
453 453
 	 * if method name starts with "findAllBy"
454 454
 	 */
455
-	public function __call($method,$args)
455
+	public function __call($method, $args)
456 456
 	{
457
-		$delete =false;
458
-		if($findOne = substr(strtolower($method),0,6)==='findby')
459
-			$condition = $method[6]==='_' ? substr($method,7) : substr($method,6);
460
-		else if(substr(strtolower($method),0,9)==='findallby')
461
-			$condition = $method[9]==='_' ? substr($method,10) : substr($method,9);
462
-		else if($delete = substr(strtolower($method),0,8)==='deleteby')
463
-			$condition = $method[8]==='_' ? substr($method,9) : substr($method,8);
464
-		else if($delete = substr(strtolower($method),0,11)==='deleteallby')
465
-			$condition = $method[11]==='_' ? substr($method,12) : substr($method,11);
457
+		$delete=false;
458
+		if($findOne=substr(strtolower($method), 0, 6)==='findby')
459
+			$condition=$method[6]==='_' ? substr($method, 7) : substr($method, 6);
460
+		else if(substr(strtolower($method), 0, 9)==='findallby')
461
+			$condition=$method[9]==='_' ? substr($method, 10) : substr($method, 9);
462
+		else if($delete=substr(strtolower($method), 0, 8)==='deleteby')
463
+			$condition=$method[8]==='_' ? substr($method, 9) : substr($method, 8);
464
+		else if($delete=substr(strtolower($method), 0, 11)==='deleteallby')
465
+			$condition=$method[11]==='_' ? substr($method, 12) : substr($method, 11);
466 466
 		else
467 467
 			return null;
468 468
 
469
-		$criteria = $this->getCommand()->createCriteriaFromString($method, $condition, $args);
469
+		$criteria=$this->getCommand()->createCriteriaFromString($method, $condition, $args);
470 470
 		if($delete)
471 471
 			return $this->deleteAll($criteria);
472 472
 		else
Please login to merge, or discard this patch.
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -103,6 +103,7 @@  discard block
 block discarded – undo
103 103
 
104 104
 	/**
105 105
 	 * @param TDbTableInfo table or view information.
106
+	 * @param TDbTableInfo $tableInfo
106 107
 	 */
107 108
 	protected function setTableInfo($tableInfo)
108 109
 	{
@@ -113,6 +114,7 @@  discard block
 block discarded – undo
113 114
 	/**
114 115
 	 * Sets up the command builder for the given table.
115 116
 	 * @param string table or view name.
117
+	 * @param string $tableName
116 118
 	 */
117 119
 	protected function setTableName($tableName)
118 120
 	{
@@ -224,6 +226,7 @@  discard block
 block discarded – undo
224 226
 	 *
225 227
 	 * @param string|TSqlCriteria SQL condition or criteria object.
226 228
 	 * @param mixed parameter values.
229
+	 * @param TSqlCriteria $criteria
227 230
 	 * @return array matching record object.
228 231
 	 */
229 232
 	public function find($criteria, $parameters=array())
@@ -237,6 +240,7 @@  discard block
 block discarded – undo
237 240
 	 * Accepts same parameters as find(), but returns TDbDataReader instead.
238 241
 	 * @param string|TSqlCriteria SQL condition or criteria object.
239 242
 	 * @param mixed parameter values.
243
+	 * @param TSqlCriteria $criteria
240 244
 	 * @return TDbDataReader matching records.
241 245
 	 */
242 246
 	public function findAll($criteria=null, $parameters=array())
@@ -299,6 +303,7 @@  discard block
 block discarded – undo
299 303
 	 * </code>
300 304
 	 * @param string delete condition.
301 305
 	 * @param array condition parameters.
306
+	 * @param TSqlCriteria $criteria
302 307
 	 * @return integer number of records deleted.
303 308
 	 */
304 309
 	public function deleteAll($criteria, $parameters=array())
Please login to merge, or discard this patch.