Skip to content

Commit a98604d

Browse files
committed
typehints + cleaning
1 parent bbe42f4 commit a98604d

26 files changed

+67
-66
lines changed

Ajax/JsUtils.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ abstract public function fromDispatcher($dispatcher);
7979
* @param JqueryUI $ui
8080
* @return JqueryUI
8181
*/
82-
public function ui($ui=NULL) {
82+
public function ui(JqueryUI $ui=NULL) {
8383
if ($ui!==NULL) {
8484
$this->_ui=$ui;
8585
$ui->setJs($this);
@@ -94,9 +94,9 @@ public function ui($ui=NULL) {
9494
/**
9595
*
9696
* @param Bootstrap $bootstrap
97-
* @return \Ajax\Bootstrap
97+
* @return Bootstrap
9898
*/
99-
public function bootstrap($bootstrap=NULL) {
99+
public function bootstrap(Bootstrap $bootstrap=NULL) {
100100
if ($bootstrap!==NULL) {
101101
$this->_bootstrap=$bootstrap;
102102
$bootstrap->setJs($this);
@@ -111,9 +111,9 @@ public function bootstrap($bootstrap=NULL) {
111111
/**
112112
*
113113
* @param Semantic $semantic
114-
* @return \Ajax\Semantic
114+
* @return Semantic
115115
*/
116-
public function semantic($semantic=NULL) {
116+
public function semantic(Semantic $semantic=NULL) {
117117
if ($semantic!==NULL) {
118118
$this->_semantic=$semantic;
119119
$semantic->setJs($this);

Ajax/bootstrap/html/HtmlBreadcrumbs.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Ajax\JsUtils;
77

88
use Ajax\bootstrap\html\base\HtmlNavElement;
9+
use Ajax\common\html\HtmlDoubleElement;
910
/**
1011
* Twitter Bootstrap Breadcrumbs component
1112
* @see http://getbootstrap.com/components/#breadcrumbs
@@ -48,7 +49,7 @@ public function __construct($identifier,$elements=array(),$autoActive=true,$star
4849
$this->content=array();
4950
$this->autoActive=$autoActive;
5051
$this->absolutePaths;
51-
$this->_hrefFunction=function ($e){return $e->getContent();};
52+
$this->_hrefFunction=function (HtmlDoubleElement $e){return $e->getContent();};
5253
if(isset($hrefFunction)){
5354
$this->_hrefFunction=$hrefFunction;
5455
}

Ajax/bootstrap/html/HtmlLink.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,4 @@ public function run(JsUtils $js) {
2424
$this->addEventsOnRun($js);
2525
return $this->_bsComponent;
2626
}
27-
// TODO use Class Tag
2827
}

Ajax/bootstrap/html/content/HtmlCarouselItem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function setCaption($caption) {
4747
* @see \Ajax\bootstrap\html\base\BaseHtml::run()
4848
*/
4949
public function run(JsUtils $js) {
50-
// TODO: Auto-generated method stub
50+
5151
}
5252

5353
public function __toString() {

Ajax/bootstrap/html/content/HtmlNavzone.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ public function addElements($elements) {
7878
} else if (is_string($element)) {
7979
$this->addLink($element);
8080
}
81-
// TODO A vérifier
8281
}
8382
}
8483
return $this;

Ajax/common/html/BaseHtml.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public function wrap($before, $after="") {
176176

177177

178178
public function getElementById($identifier, $elements) {
179-
return $this->_getElementBy(function($element) use ($identifier){return $element->getIdentifier()===$identifier;}, $elements);
179+
return $this->_getElementBy(function(BaseWidget $element) use ($identifier){return $element->getIdentifier()===$identifier;}, $elements);
180180
}
181181

182182
public function getBsComponent() {

Ajax/common/html/html5/HtmlLinkTrait.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ public function getHref() {
1818
public function setTarget($value="_self") {
1919
return $this->setProperty("target", $value);
2020
}
21-
// TODO use Class Tag
2221
}

Ajax/common/html/traits/BaseHtmlPropertiesTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,6 @@ protected function setPropertyCtrl($name, $value, $typeCtrl) {
111111
}
112112

113113
protected function getElementByPropertyValue($propertyName,$value, $elements) {
114-
return $this->_self->_getElementBy(function($element) use ($propertyName,$value){return $element->propertyContains($propertyName, $value) === true;}, $elements);
114+
return $this->_self->_getElementBy(function(BaseHtml $element) use ($propertyName,$value){return $element->propertyContains($propertyName, $value) === true;}, $elements);
115115
}
116116
}

Ajax/common/traits/JsUtilsInternalTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ protected function _addToCompile($jsScript) {
1414
* @param BaseGui $library
1515
* @param mixed $view
1616
*/
17-
protected function _compileLibrary($library, &$view=NULL){
17+
protected function _compileLibrary(BaseGui $library=NULL, &$view=NULL){
1818
if ($library!=NULL) {
1919
if(isset($view))
2020
$library->compileHtml($this, $view);

Ajax/semantic/components/Modal.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,4 @@ public function showDimmer(){
2323
public function setInverted(){
2424
$this->params["inverted"]=true;
2525
}
26-
27-
// TODO other events implementation
2826
}

0 commit comments

Comments
 (0)