Skip to content

Commit a7d880c

Browse files
committed
Fix PSR-4 warnings
1 parent c653a46 commit a7d880c

17 files changed

+253
-171
lines changed
File renamed without changes.
File renamed without changes.

Diff for: Ajax/ui/components/Accordion.php

+42-24
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
<?php
2-
3-
namespace Ajax\ui\Components;
2+
namespace Ajax\ui\components;
43

54
use Ajax\JsUtils;
6-
use Ajax\ui\Properties\Animation;
5+
use Ajax\ui\properties\Animation;
76
use Ajax\common\components\SimpleComponent;
87
use Ajax\service\JString;
98

109
/**
1110
* Composant JQuery UI Accordion
11+
*
1212
* @author jc
1313
* @version 1.001
1414
*/
1515
class Accordion extends SimpleComponent {
1616

1717
public function __construct(JsUtils $js) {
1818
parent::__construct($js);
19-
$this->params=array (
20-
"active" => 0
19+
$this->params = array(
20+
"active" => 0
2121
);
22-
$this->uiName="accordion";
22+
$this->uiName = "accordion";
2323
}
2424

2525
/**
@@ -29,7 +29,9 @@ public function __construct(JsUtils $js) {
2929
* This requires the collapsible option to be true.
3030
* Integer: The zero-based index of the panel that is active (open).
3131
* A negative value selects panels going backward from the last panel.
32-
* @param Boolean $value default : 0
32+
*
33+
* @param Boolean $value
34+
* default : 0
3335
* @return $this
3436
*/
3537
public function setActive($value) {
@@ -45,14 +47,16 @@ public function setActive($value) {
4547
* Object: Animation settings with easing and duration properties.
4648
* Can also contain a down property with any of the above options.
4749
* "Down" animations occur when the panel being activated has a lower index than the currently active panel.
48-
* @param mixed $value default : {}
50+
*
51+
* @param mixed $value
52+
* default : {}
4953
* @return $this
5054
*/
5155
public function setAnimate($value) {
5256
if ($value instanceof Animation)
53-
$value=$value->getParams();
57+
$value = $value->getParams();
5458
else if (is_string($value)) {
55-
$animation=new Animation();
59+
$animation = new Animation();
5660
$animation->setEasing($value);
5761
}
5862
$this->setParam("animate", $value);
@@ -62,7 +66,9 @@ public function setAnimate($value) {
6266
/**
6367
* Whether all the sections can be closed at once.
6468
* Allows collapsing the active section.
65-
* @param Boolean $value default : false
69+
*
70+
* @param Boolean $value
71+
* default : false
6672
* @return $this
6773
*/
6874
public function setCollapsible($value) {
@@ -71,7 +77,9 @@ public function setCollapsible($value) {
7177

7278
/**
7379
* Disables the accordion if set to true.
74-
* @param Boolean $value default : false
80+
*
81+
* @param Boolean $value
82+
* default : false
7583
* @return $this
7684
*/
7785
public function setDisabled($value) {
@@ -81,7 +89,9 @@ public function setDisabled($value) {
8189
/**
8290
* The event that accordion headers will react to in order to activate the associated panel.
8391
* Multiple events can be specified, separated by a space.
84-
* @param string $value default : click
92+
*
93+
* @param string $value
94+
* default : click
8595
* @return $this
8696
*/
8797
public function setEvent($value) {
@@ -94,8 +104,10 @@ public function setEvent($value) {
94104
*
95105
* find() on the main accordion element.
96106
* Content panels must be the sibling immediately after their associated headers.
97-
* @param string $value css/JQuery Selector
98-
* default : "> li > :first-child,> :not(li):even"
107+
*
108+
* @param string $value
109+
* css/JQuery Selector
110+
* default : "> li > :first-child,> :not(li):even"
99111
* @return $this
100112
*/
101113
public function setHeader($value) {
@@ -108,14 +120,16 @@ public function setHeader($value) {
108120
* "auto": All panels will be set to the height of the tallest panel.
109121
* "fill": Expand to the available height based on the accordion's parent height.
110122
* "content": Each panel will be only as tall as its content.
111-
* @param String $value default : content
123+
*
124+
* @param String $value
125+
* default : content
112126
* @return $this
113127
*/
114128
public function setHeightStyle($value) {
115-
return $this->setParamCtrl("heightStyle", $value, array (
116-
"auto",
117-
"fill",
118-
"content"
129+
return $this->setParamCtrl("heightStyle", $value, array(
130+
"auto",
131+
"fill",
132+
"content"
119133
));
120134
}
121135

@@ -124,14 +138,15 @@ public function setHeightStyle($value) {
124138
* Set to false to have no icons displayed.
125139
* header (string, default: "ui-icon-triangle-1-e")
126140
* activeHeader (string, default: "ui-icon-triangle-1-s")
127-
* @param String $value default : { "header": "ui-icon-triangle-1-e", "activeHeader": "ui-icon-triangle-1-s" }
141+
*
142+
* @param String $value
143+
* default : { "header": "ui-icon-triangle-1-e", "activeHeader": "ui-icon-triangle-1-s" }
128144
* @return $this
129145
*/
130146
public function setIcons($value) {
131147
if (is_string($value)) {
132-
if (JString::startsWith($value, "{"))
133-
;
134-
$value="%".$value."%";
148+
if (JString::startsWith($value, "{"));
149+
$value = "%" . $value . "%";
135150
}
136151
$this->setParam("icons", $value);
137152
return $this;
@@ -141,6 +156,7 @@ public function setIcons($value) {
141156
* Triggered after a panel has been activated (after animation completes).
142157
* If the accordion was previously collapsed, ui.oldHeader and ui.oldPanel will be empty jQuery objects.
143158
* If the accordion is collapsing, ui.newHeader and ui.newPanel will be empty jQuery objects.
159+
*
144160
* @param string $jsCode
145161
* @return $this
146162
*/
@@ -153,6 +169,7 @@ public function onActivate($jsCode) {
153169
* Can be canceled to prevent the panel from activating.
154170
* If the accordion is currently collapsed, ui.oldHeader and ui.oldPanel will be empty jQuery objects.
155171
* If the accordion is collapsing, ui.newHeader and ui.newPanel will be empty jQuery objects.
172+
*
156173
* @param string $jsCode
157174
* @return $this
158175
*/
@@ -163,6 +180,7 @@ public function onBeforeActivate($jsCode) {
163180
/**
164181
* Triggered when the accordion is created.
165182
* If the accordion is collapsed, ui.header and ui.panel will be empty jQuery objects.
183+
*
166184
* @param string $jsCode
167185
* @return $this
168186
*/

Diff for: Ajax/ui/components/Autocomplete.php

+29-12
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
11
<?php
2-
32
namespace Ajax\ui\Components;
43

54
use Ajax\JsUtils;
6-
use Ajax\ui\Properties\Position;
5+
use Ajax\ui\properties\Position;
76
use Ajax\common\components\SimpleComponent;
87
use Ajax\service\JString;
98

109
/**
1110
* JQuery UI Autocomplete component
11+
*
1212
* @author jc
1313
* @version 1.001
1414
*/
1515
class Autocomplete extends SimpleComponent {
1616

1717
public function __construct(JsUtils $js) {
1818
parent::__construct($js);
19-
$this->uiName="autocomplete";
19+
$this->uiName = "autocomplete";
2020
$this->setParam("minLength", 3);
2121
}
2222

2323
/**
2424
* Define source property with an ajax request based on $url
2525
* $url must return a JSON array of values
26+
*
2627
* @param String $url
2728
* @return $this
2829
*/
2930
public function setAjaxSource($url) {
3031
if (JString::startsWith($url, "/")) {
31-
$url=$this->js->getUrl($url);
32+
$url = $this->js->getUrl($url);
3233
}
33-
$ajax="%function (request, response) {
34+
$ajax = "%function (request, response) {
3435
$.ajax({
3536
url: '{$url}',
3637
dataType: 'jsonp',
@@ -46,20 +47,22 @@ public function setAjaxSource($url) {
4647
* with a JSON Array of values
4748
* Example : ["Bordeaux","Alsace","Bourgogne"]
4849
* Example : [{value : "BO", label : "Bordeaux"}, {value : "AL", label : "Alsace"}, {value : "BOU", label : "Bourgogne"}]
50+
*
4951
* @param String $source
5052
* @return $this
5153
*/
5254
public function setSource($source) {
53-
$source=str_ireplace(array (
54-
"\"",
55-
"'"
55+
$source = str_ireplace(array(
56+
"\"",
57+
"'"
5658
), "%quote%", $source);
57-
return $this->setParam("source", "%".$source."%");
59+
return $this->setParam("source", "%" . $source . "%");
5860
}
5961

6062
/**
6163
* If set to true the first item will automatically be focused when the menu is shown.
6264
* default : false
65+
*
6366
* @param Boolean $value
6467
* @return $this
6568
*/
@@ -72,6 +75,7 @@ public function setAutofocus($value) {
7275
* A zero-delay makes sense for local data (more responsive), but can produce a lot of load for remote data,
7376
* while being less responsive.
7477
* default : 300
78+
*
7579
* @param int $value
7680
* @return $this
7781
*/
@@ -81,7 +85,9 @@ public function setDelay($value) {
8185

8286
/**
8387
* Disables the autocomplete if set to true.
84-
* @param Boolean $value default : false
88+
*
89+
* @param Boolean $value
90+
* default : false
8591
* @return $this
8692
*/
8793
public function setDisabled($value) {
@@ -92,7 +98,9 @@ public function setDisabled($value) {
9298
* The minimum number of characters a user must type before a search is performed.
9399
* Zero is useful for local data with just a few items,
94100
* but a higher value should be used when a single character search could match a few thousand items.
95-
* @param int $value default : 1
101+
*
102+
* @param int $value
103+
* default : 1
96104
* @return $this
97105
*/
98106
public function setMinLength($value) {
@@ -103,7 +111,9 @@ public function setMinLength($value) {
103111
* Identifies the position of the suggestions menu in relation to the associated input element.
104112
* The of option defaults to the input element, but you can specify another element to position against.
105113
* You can refer to the jQuery UI Position utility for more details about the various options.
106-
* @param int $position default : { my: "left top", at: "left bottom", collision: "none" }
114+
*
115+
* @param int $position
116+
* default : { my: "left top", at: "left bottom", collision: "none" }
107117
* @return $this
108118
*/
109119
public function setPosition(Position $position) {
@@ -112,6 +122,7 @@ public function setPosition(Position $position) {
112122

113123
/**
114124
* Triggered when the field is blurred, if the value has changed.
125+
*
115126
* @param string $jsCode
116127
* @return $this
117128
*/
@@ -122,6 +133,7 @@ public function onChange($jsCode) {
122133
/**
123134
* Triggered when the menu is hidden.
124135
* Not every close event will be accompanied by a change event.
136+
*
125137
* @param string $jsCode
126138
* @return $this
127139
*/
@@ -134,6 +146,7 @@ public function onClose($jsCode) {
134146
* The default action is to replace the text field's value with the value of the focused item,
135147
* though only if the event was triggered by a keyboard interaction.
136148
* Canceling this event prevents the value from being updated, but does not prevent the menu item from being focused.
149+
*
137150
* @param string $jsCode
138151
* @return $this
139152
*/
@@ -143,6 +156,7 @@ public function onFocus($jsCode) {
143156

144157
/**
145158
* Triggered when the suggestion menu is opened or updated.
159+
*
146160
* @param string $jsCode
147161
* @return $this
148162
*/
@@ -154,6 +168,7 @@ public function onOpen($jsCode) {
154168
* Triggered after a search completes, before the menu is shown.
155169
* Useful for local manipulation of suggestion data, where a custom source option callback is not required.
156170
* This event is always triggered when a search completes, even if the menu will not be shown because there are no results or the Autocomplete is disabled.
171+
*
157172
* @param string $jsCode
158173
* @return $this
159174
*/
@@ -164,6 +179,7 @@ public function onResponse($jsCode) {
164179
/**
165180
* Triggered before a search is performed, after minLength and delay are met.
166181
* If canceled, then no request will be started and no items suggested.
182+
*
167183
* @param string $jsCode
168184
* @return $this
169185
*/
@@ -175,6 +191,7 @@ public function onSearch($jsCode) {
175191
* Triggered when an item is selected from the menu.
176192
* The default action is to replace the text field's value with the value of the selected item.
177193
* Canceling this event prevents the value from being updated, but does not prevent the menu from closing.
194+
*
178195
* @param string $jsCode
179196
* @return $this
180197
*/

0 commit comments

Comments
 (0)