Skip to content

Commit 30b0965

Browse files
committed
Fix scrut bugs
1 parent 5f63ee6 commit 30b0965

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

.scrutinizer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
filter:
22
excluded_paths:
33
- Ajax/JsUtils.php
4-
- Ajax/php/yii/URI.php
4+
- Ajax/php/
55
checks:
66
php:
77
code_rating: true

Ajax/common/Widget.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ abstract class Widget extends HtmlDoubleElement {
3636
*/
3737
protected $_toolbar;
3838
/**
39-
* @var PositionInTable
39+
* @var string
4040
*/
4141
protected $_toolbarPosition;
4242

@@ -73,7 +73,7 @@ protected function _init($instanceViewer,$contentKey,$content,$edition){
7373

7474
/**
7575
* @param int|string $fieldName
76-
* @return int|string
76+
* @return int|string|boolean
7777
*/
7878
protected function _getIndex($fieldName){
7979
$index=$fieldName;
@@ -250,7 +250,7 @@ public function addInToolbar($element,$callback=NULL){
250250
*/
251251
public function addItemInToolbar($caption,$icon=NULL,$callback=NULL){
252252
$result=$this->addInToolbar($caption,$callback);
253-
if(isset($icon))
253+
if(isset($icon) && method_exists($result, "addIcon"))
254254
$result->addIcon($icon);
255255
return $result;
256256
}
@@ -274,7 +274,7 @@ public function addItemsInToolbar(array $items,$callback=NULL){
274274
}
275275

276276
/**
277-
* @param string $value
277+
* @param mixed $value
278278
* @param array $items
279279
* @param callable $callback function($element)
280280
* @return \Ajax\common\html\HtmlDoubleElement
@@ -399,11 +399,10 @@ public function getForm() {
399399
}
400400

401401
public function run(JsUtils $js){
402-
$result=parent::run($js);
402+
parent::run($js);
403403
if(isset($this->_form)){
404-
$result=$this->runForm($js);
404+
$this->runForm($js);
405405
}
406-
return $result;
407406
}
408407

409408
protected function runForm(JsUtils $js){

Ajax/semantic/html/collections/HtmlBreadcrumb.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class HtmlBreadcrumb extends HtmlSemNavElement {
3636

3737
/**
3838
*
39-
* @var object<Closure> the function who generates the href elements. default : function($e){return $e->getContent()}
39+
* @var callable the function who generates the href elements. default : function($e){return $e->getContent()}
4040
*/
4141
protected $_hrefFunction;
4242

@@ -91,17 +91,18 @@ public function setActive($index=null) {
9191
}
9292

9393
/**
94-
* Add new elements in breadcrumbs corresponding to request dispatcher : controllerName, actionName, parameters
94+
* Adds new elements in breadcrumbs corresponding to request dispatcher : controllerName, actionName, parameters
9595
* @param JsUtils $js
9696
* @param object $dispatcher the request dispatcher
97-
* @return \Ajax\bootstrap\html\HtmlBreadcrumbs
97+
* @return HtmlBreadcrumb
9898
*/
9999
public function fromDispatcher(JsUtils $js,$dispatcher, $startIndex=0) {
100+
$this->startIndex=$startIndex;
100101
return $this->addItems($js->fromDispatcher($dispatcher));
101102
}
102103

103104
/**
104-
* Return the url of the element at $index or the breadcrumbs url if $index is ommited
105+
* Returns the url of the element at $index or the breadcrumbs url if $index is ommited
105106
* @param int $index
106107
* @param string $separator
107108
* @return string
@@ -123,7 +124,7 @@ public function getHref($index=null, $separator="/") {
123124
* sets the function who generates the href elements.
124125
* default : function($element){return $element->getContent()}
125126
* @param callable $_hrefFunction
126-
* @return \Ajax\bootstrap\html\HtmlBreadcrumbs
127+
* @return HtmlBreadcrumb
127128
*/
128129
public function setHrefFunction($_hrefFunction) {
129130
$this->_hrefFunction=$_hrefFunction;

0 commit comments

Comments
 (0)