Completed
Pull Request — master (#3)
by boston
03:45
created
Ajax/bootstrap/html/base/PropertyWrapper.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace Ajax\bootstrap\html\base;
4 4
 
5 5
 use Ajax\service\JArray;
6
-use Ajax\service\AjaxCall;
7 6
 
8 7
 class PropertyWrapper {
9 8
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 				$value1=reset($input);
18 18
 				if (is_object($value1)) {
19 19
 					$output=PropertyWrapper::wrapObjects($input, $js, $separator=' ');
20
-				} else
20
+				}else
21 21
 					$output=PropertyWrapper::wrapStrings($input, $separator=' ', $valueQuote='"');
22 22
 			}
23 23
 		}
@@ -26,17 +26,17 @@  discard block
 block discarded – undo
26 26
 
27 27
 	public static function wrapStrings($input, $separator=' ', $valueQuote='"') {
28 28
 		if (JArray::isAssociative($input)===true) {
29
-			$result=implode($separator, array_map(function ($v, $k) use($valueQuote) {
29
+			$result=implode($separator, array_map(function($v, $k) use($valueQuote) {
30 30
 				return $k.'='.$valueQuote.$v.$valueQuote;
31 31
 			}, $input, array_keys($input)));
32
-		} else {
32
+		}else {
33 33
 			$result=implode($separator, array_values($input));
34 34
 		}
35 35
 		return $result;
36 36
 	}
37 37
 
38 38
 	public static function wrapObjects($input, $js=NULL, $separator=' ') {
39
-		return implode($separator, array_map(function ($v) use($js) {
39
+		return implode($separator, array_map(function($v) use($js) {
40 40
 			return $v->compile($js);
41 41
 		}, $input));
42 42
 	}
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlModal.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 use Phalcon\Mvc\View;
6 6
 use Ajax\JsUtils;
7 7
 use Ajax\bootstrap\html\base\BaseHtml;
8
-use Phalcon\Mvc\Dispatcher;
9 8
 use Phalcon\Mvc\Controller;
10 9
 
11 10
 /**
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 class HtmlModal extends BaseHtml {
17 17
 	protected $title="Titre de ma boîte";
18 18
 	protected $content="";
19
-	protected $buttons=array ();
19
+	protected $buttons=array();
20 20
 	protected $showOnStartup=false;
21 21
 	protected $draggable=false;
22 22
 	protected $validCondition=NULL;
@@ -29,10 +29,10 @@  discard block
 block discarded – undo
29 29
 	public function __construct($identifier, $title="", $content="", $buttonCaptions=array()) {
30 30
 		parent::__construct($identifier);
31 31
 		$this->_template=include 'templates/tplModal.php';
32
-		$this->buttons=array ();
32
+		$this->buttons=array();
33 33
 		$this->title=$title;
34 34
 		$this->content=$content;
35
-		foreach ( $buttonCaptions as $button ) {
35
+		foreach ($buttonCaptions as $button) {
36 36
 			$this->addButton($button);
37 37
 		}
38 38
 	}
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	 * @param string $value
68 68
 	 * @return HtmlButton
69 69
 	 */
70
-	public function addOkayButton($value="Okay",$jsCode="") {
70
+	public function addOkayButton($value="Okay", $jsCode="") {
71 71
 		$btn=$this->addButton($value, "btn-primary");
72 72
 		$btn->onClick("if(".$this->getValidCondition()."){ ".$jsCode."$('#".$this->identifier."').modal('hide');}");
73 73
 		return $btn;
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	public function getValidCondition() {
85 85
 		if ($this->validCondition==NULL) {
86 86
 			return $this->getDefaultValidCondition();
87
-		} else {
87
+		}else {
88 88
 			return $this->validCondition;
89 89
 		}
90 90
 	}
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 * @param $params The parameters to pass to the view
118 118
 	 */
119 119
 	public function renderContent($view, $controller, $action, $params=NULL) {
120
-		$template=$view->getRender($controller, $action, $params, function ($view) {
120
+		$template=$view->getRender($controller, $action, $params, function($view) {
121 121
 			$view->setRenderLevel(View::LEVEL_ACTION_VIEW);
122 122
 		});
123 123
 		$this->content=$template;
@@ -129,12 +129,12 @@  discard block
 block discarded – undo
129 129
 	 * @param string $controller a Phalcon controller
130 130
 	 * @param string $action a Phalcon action
131 131
 	 */
132
-	public function forward($initialController,$controller,$action){
133
-		$dispatcher = $initialController->dispatcher;
132
+	public function forward($initialController, $controller, $action) {
133
+		$dispatcher=$initialController->dispatcher;
134 134
 		$dispatcher->setControllerName($controller);
135 135
 		$dispatcher->setActionName($action);
136 136
 		$dispatcher->dispatch();
137
-		$template=$initialController->view->getRender($dispatcher->getControllerName(), $dispatcher->getActionName(),$dispatcher->getParams(), function ($view) {
137
+		$template=$initialController->view->getRender($dispatcher->getControllerName(), $dispatcher->getActionName(), $dispatcher->getParams(), function($view) {
138 138
 			$view->setRenderLevel(View::LEVEL_ACTION_VIEW);
139 139
 		});
140 140
 		$this->content=$template;
@@ -145,10 +145,10 @@  discard block
 block discarded – undo
145 145
 	 * @see BaseHtml::run()
146 146
 	 */
147 147
 	public function run(JsUtils $js) {
148
-		if($this->content instanceof BaseHtml){
148
+		if ($this->content instanceof BaseHtml) {
149 149
 			$this->content->run($js);
150 150
 		}
151
-		$this->_bsComponent=$js->bootstrap()->modal("#".$this->identifier, array (
151
+		$this->_bsComponent=$js->bootstrap()->modal("#".$this->identifier, array(
152 152
 				"show" => $this->showOnStartup
153 153
 		));
154 154
 		if ($this->draggable)
Please login to merge, or discard this patch.
Ajax/bootstrap/html/phalcon/PhBsSelect.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use Ajax\bootstrap\html\phalcon\PhBsElement;
6 6
 use Phalcon\Forms\Element\Select;
7
-use Ajax\bootstrap\html\base\HtmlDoubleElement;
8 7
 use Ajax\bootstrap\html\html5\HtmlSelect;
9 8
 
10 9
 class PhBsSelect extends PhBsElement {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 		parent::__construct($name, $attributes);
14 14
 		$list=new HtmlSelect($name);
15 15
 		$list->setTagName("select");
16
-		$this->renderer=new PhBsRenderer(new Select($name, array (), $attributes), $list);
16
+		$this->renderer=new PhBsRenderer(new Select($name, array(), $attributes), $list);
17 17
 		$this->setOptions($options);
18 18
 	}
19 19
 
Please login to merge, or discard this patch.
Ajax/bootstrap/components/Collapse.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
 	}
66 66
 
67 67
 	protected function compileEvents() {
68
-		foreach ( $this->events as $event => $jsCode ) {
68
+		foreach ($this->events as $event => $jsCode) {
69 69
 			$this->jquery_code_for_compile []="$( \"".$this->collapsed."\" ).on(\"".$event."\" , function (e) {".$jsCode."});";
70 70
 		}
71 71
 	}
Please login to merge, or discard this patch.
Ajax/bootstrap/components/GenericComponent.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@
 block discarded – undo
9 9
 	 * @see \Ajax\bootstrap\components\SimpleBsComponent::getScript()
10 10
 	 */
11 11
 	public function getScript() {
12
-		$this->jquery_code_for_compile=array ();
13
-		foreach ( $this->jsCodes as $jsCode ) {
14
-			$this->jquery_code_for_compile []=$jsCode->compile(array (
12
+		$this->jquery_code_for_compile=array();
13
+		foreach ($this->jsCodes as $jsCode) {
14
+			$this->jquery_code_for_compile []=$jsCode->compile(array(
15 15
 					"identifier" => $this->attachTo 
16 16
 			));
17 17
 		}
Please login to merge, or discard this patch.
Ajax/bootstrap/components/Modal.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
 		if ($value) {
58 58
 			$this->jsCodes ["draggable"]=new Draggable();
59 59
 			$this->setBackdrop(false);
60
-		} else if (array_key_exists("draggable", $this->jsCodes)) {
60
+		}else if (array_key_exists("draggable", $this->jsCodes)) {
61 61
 			unset($this->jsCodes ["draggable"]);
62 62
 			unset($this->params ["backdrop"]);
63 63
 		}
Please login to merge, or discard this patch.
Ajax/bootstrap/components/SimpleBsComponent.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
 use Ajax\common\JsCode;
7 7
 
8 8
 class SimpleBsComponent extends SimpleComponent {
9
-	protected $events=array ();
10
-	protected $jsCodes=array ();
9
+	protected $events=array();
10
+	protected $jsCodes=array();
11 11
 
12 12
 	public function addEvent($event, $jsCode) {
13 13
 		$this->events [$event]=$jsCode;
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
 
16 16
 	public function getScript() {
17 17
 		parent::getScript();
18
-		foreach ( $this->jsCodes as $jsCode ) {
19
-			$this->jquery_code_for_compile []=$jsCode->compile(array (
18
+		foreach ($this->jsCodes as $jsCode) {
19
+			$this->jquery_code_for_compile []=$jsCode->compile(array(
20 20
 					"identifier" => $this->attachTo 
21 21
 			));
22 22
 		}
Please login to merge, or discard this patch.
Ajax/bootstrap/components/Splitbutton.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@
 block discarded – undo
9 9
 	 * @see \Ajax\common\SimpleComponent::compileEvents()
10 10
 	 */
11 11
 	protected function compileEvents() {
12
-		foreach ( $this->events as $event => $jsCode ) {
12
+		foreach ($this->events as $event => $jsCode) {
13 13
 			if ($event==="buttonClick") {
14 14
 				$this->jquery_code_for_compile []="$( \"#split-".preg_replace('/[^a-zA-Z0-9\-.]/s', '', $this->attachTo)."\" ).on(\"click\" , function( event, data ) {".$jsCode."});";
15
-			} else {
15
+			}else {
16 16
 				$this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});";
17 17
 			}
18 18
 		}
Please login to merge, or discard this patch.
Ajax/bootstrap/components/Tabs.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
 	public function __construct(JsUtils $js) {
20 20
 		parent::__construct($js);
21
-		$this->tabs=array ();
21
+		$this->tabs=array();
22 22
 	}
23 23
 
24 24
 	public function getTabs() {
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	}
36 36
 
37 37
 	public function getTab($index) {
38
-		if ($index>0&&$index<sizeof($this->tabs))
38
+		if ($index>0 && $index<sizeof($this->tabs))
39 39
 			return $this->tabs [$index];
40 40
 	}
41 41
 
Please login to merge, or discard this patch.