diff --git a/datamodels/2.x/itop-portal-base/portal/src/views/bricks/browse/mode_mosaic.html.twig b/datamodels/2.x/itop-portal-base/portal/src/views/bricks/browse/mode_mosaic.html.twig
index bfff8e8bc..0bd7a1472 100644
--- a/datamodels/2.x/itop-portal-base/portal/src/views/bricks/browse/mode_mosaic.html.twig
+++ b/datamodels/2.x/itop-portal-base/portal/src/views/bricks/browse/mode_mosaic.html.twig
@@ -49,7 +49,7 @@
{
$('#brick_mosaic_overlay').hide();
$("#brick_content_mosaic").show();
- }
+ };
// Show the requested level
var showLevel = function(sLevelAlias, sItemId)
{
diff --git a/datamodels/2.x/itop-portal-base/portal/src/views/bricks/browse/mode_tree.html.twig b/datamodels/2.x/itop-portal-base/portal/src/views/bricks/browse/mode_tree.html.twig
index 30bf8cadb..ba7da2527 100644
--- a/datamodels/2.x/itop-portal-base/portal/src/views/bricks/browse/mode_tree.html.twig
+++ b/datamodels/2.x/itop-portal-base/portal/src/views/bricks/browse/mode_tree.html.twig
@@ -48,7 +48,7 @@
var sNodeCollapsedClass = 'glyphicon-menu-right';
var sNodeExpandedClass = 'glyphicon-menu-down';
var sNodeLoadingClass = 'glyphicon-refresh keep-spinning';
- var iSearchDelay = 500
+ var iSearchDelay = 500;
var sBrowseMode = '{{ sBrowseMode }}';
var oLevelsProperties = {{ aLevelsProperties|raw }};
var oRawDatas = {{ aItems|raw }};
@@ -76,7 +76,7 @@
{
$('#brick_tree_overlay').hide();
$("#brick_content_tree").show();
- }
+ };
// Registers the toggle listeners on the tree nodes. Used after every AJAX calls.
var registerToggleListeners = function()
{
diff --git a/datamodels/2.x/itop-portal-base/portal/src/views/bricks/manage/layout-table.html.twig b/datamodels/2.x/itop-portal-base/portal/src/views/bricks/manage/layout-table.html.twig
index 4df733ce6..8872e9924 100644
--- a/datamodels/2.x/itop-portal-base/portal/src/views/bricks/manage/layout-table.html.twig
+++ b/datamodels/2.x/itop-portal-base/portal/src/views/bricks/manage/layout-table.html.twig
@@ -225,7 +225,7 @@
$(function () {
$('[data-toggle="tooltip"]').tooltip()
- })
+ });
showTableLoader($('#table-{{ sAreaId }}'));
var oTable{{ sAreaId }} = $('#table-{{ sAreaId }}').DataTable({
diff --git a/datamodels/2.x/itop-portal-base/portal/src/views/layout.html.twig b/datamodels/2.x/itop-portal-base/portal/src/views/layout.html.twig
index a63a81eaa..189a12116 100644
--- a/datamodels/2.x/itop-portal-base/portal/src/views/layout.html.twig
+++ b/datamodels/2.x/itop-portal-base/portal/src/views/layout.html.twig
@@ -397,11 +397,11 @@
return false;
}
return true;
- }
+ };
var GetContentLoaderTemplate = function()
{
return '
{{ 'Page:PleaseWait'|dict_s }}
';
- }
+ };
var ShowLoginDialog = function()
{
var oModalElem = $('#modal-for-alert').clone();
diff --git a/datamodels/2.x/itop-portal-base/portal/web/js/export.js b/datamodels/2.x/itop-portal-base/portal/web/js/export.js
index c11fd1ef2..3c147bf58 100644
--- a/datamodels/2.x/itop-portal-base/portal/web/js/export.js
+++ b/datamodels/2.x/itop-portal-base/portal/web/js/export.js
@@ -104,6 +104,8 @@ function ExportRun(data) {
$('#export-error').html(data.message);
$('#export-cancel').hide();
$('#export-close').show();
+ break;
+
default:
}
}
diff --git a/datamodels/2.x/itop-portal-base/portal/web/js/portal_form_field.js b/datamodels/2.x/itop-portal-base/portal/web/js/portal_form_field.js
index 38c2f48e8..3749b9f4c 100644
--- a/datamodels/2.x/itop-portal-base/portal/web/js/portal_form_field.js
+++ b/datamodels/2.x/itop-portal-base/portal/web/js/portal_form_field.js
@@ -10,7 +10,7 @@ $(function()
options:
{
on_validation_callback: function(me, oResult){
- me.element.removeClass('has-success has-warning has-error')
+ me.element.removeClass('has-success has-warning has-error');
me.element.find('.help-block').html('');
if(!oResult.is_valid)
{
diff --git a/sources/application/search/criterionconversion/criteriontooql.class.inc.php b/sources/application/search/criterionconversion/criteriontooql.class.inc.php
index dd5139a31..025fe51e3 100644
--- a/sources/application/search/criterionconversion/criteriontooql.class.inc.php
+++ b/sources/application/search/criterionconversion/criteriontooql.class.inc.php
@@ -197,13 +197,18 @@ class CriterionToOQL extends CriterionConversionAbstract
return "({$sRef} != '')";
}
- /**
- * @param DBObjectSearch $oSearch
- * @param $sRef
- * @param $aCriteria
- *
- * @return mixed|string
- */
+ /**
+ * @param \DBObjectSearch $oSearch
+ * @param string $sRef
+ * @param array $aCriteria
+ *
+ * @return mixed|string
+ *
+ * @throws \CoreException
+ * @throws \MissingQueryArgument
+ * @throws \MySQLException
+ * @throws \MySQLHasGoneAwayException
+ */
protected static function InToOql($oSearch, $sRef, $aCriteria)
{
$sAttCode = $aCriteria['code'];
diff --git a/sources/application/search/searchform.class.inc.php b/sources/application/search/searchform.class.inc.php
index 72e0696df..db3bb7e09 100644
--- a/sources/application/search/searchform.class.inc.php
+++ b/sources/application/search/searchform.class.inc.php
@@ -271,11 +271,13 @@ class SearchForm
return $sHtml;
}
- /**
- * @param DBObjectSet $oSet
- *
- * @return array
- */
+ /**
+ * @param \DBObjectSet $oSet
+ *
+ * @return array
+ *
+ * @throws \CoreException
+ */
public function GetFields($oSet)
{
$oSearch = $oSet->GetFilter();
@@ -470,17 +472,17 @@ class SearchForm
return array('values' => $aAllowedValues);
}
- /**
- * @param \DBObjectSearch $oSearch
- * @param array $aFields
- *
- * @param array $aArgs
- *
- * @param bool $bIsRemovable
- *
- * @return array
- * @throws \MissingQueryArgument
- */
+ /**
+ * @param \DBObjectSearch $oSearch
+ * @param array $aFields
+ * @param array $aArgs
+ * @param bool $bIsRemovable
+ *
+ * @return array
+ *
+ * @throws \CoreException
+ * @throws \MissingQueryArgument
+ */
public function GetCriterion($oSearch, $aFields, $aArgs = array(), $bIsRemovable = true)
{
$aOrCriterion = array();
@@ -593,16 +595,21 @@ class SearchForm
return $aFields;
}
- /**
- * @param $sClass
- * @param $sClassAlias
- * @param $sAttCode
- * @param AttributeDefinition $oAttDef
- * @param $aFields
- * @param bool $bHasIndex
- *
- * @return mixed
- */
+ /**
+ * @param string $sClass
+ * @param string $sClassAlias
+ * @param string $sAttCode
+ * @param \AttributeDefinition $oAttDef
+ * @param array $aFields
+ * @param bool $bHasIndex
+ *
+ * @return mixed
+ *
+ * @throws \CoreException
+ * @throws \MissingQueryArgument
+ * @throws \MySQLException
+ * @throws \MySQLHasGoneAwayException
+ */
private function AppendField($sClass, $sClassAlias, $sAttCode, $oAttDef, $aFields, $bHasIndex = false)
{
if (!is_null($oAttDef) && ($oAttDef->GetSearchType() != AttributeDefinition::SEARCH_WIDGET_TYPE_RAW))
@@ -680,12 +687,14 @@ class SearchForm
return $aFields;
}
- /**
- * @param DBObjectSearch $oSearch
- * @param $aContextParams
- *
- * @return array
- */
+ /**
+ * @param \DBObjectSearch $oSearch
+ * @param array $aContextParams
+ *
+ * @return array
+ *
+ * @throws \CoreException
+ */
protected function GetDefaultCriterion($oSearch, &$aContextParams = array())
{
$aAndCriterion = array();
diff --git a/sources/form/field/datetimefield.class.inc.php b/sources/form/field/datetimefield.class.inc.php
index 16f4dd4ef..c82a9e549 100644
--- a/sources/form/field/datetimefield.class.inc.php
+++ b/sources/form/field/datetimefield.class.inc.php
@@ -19,6 +19,8 @@
namespace Combodo\iTop\Form\Field;
+use Closure;
+
/**
* A field for Dates and Date & Times, supporting custom formats
*/
@@ -32,7 +34,7 @@ class DateTimeField extends StringField
* Overloaded constructor
*
* @param string $sId
- * @param Closure $onFinalizeCallback (Used in the $oForm->AddField($sId, ..., function() use ($oManager, $oForm, '...') { ... } ); )
+ * @param \Closure $onFinalizeCallback (Used in the $oForm->AddField($sId, ..., function() use ($oManager, $oForm, '...') { ... } ); )
*/
public function __construct($sId, Closure $onFinalizeCallback = null)
{
@@ -52,13 +54,13 @@ class DateTimeField extends StringField
/**
*
- * @param string $sDateTimeFormat
+ * @param string $sPHPDateTimeFormat
*
* @return \Combodo\iTop\Form\Field\DateTimeField
*/
- public function SetPHPDateTimeFormat($sDateTimeFormat)
+ public function SetPHPDateTimeFormat($sPHPDateTimeFormat)
{
- $this->sPHPDateTimeFormat = $sDateTimeFormat;
+ $this->sPHPDateTimeFormat = $sPHPDateTimeFormat;
return $this;
}
@@ -68,18 +70,18 @@ class DateTimeField extends StringField
*/
public function GetJSDateTimeFormat()
{
- return $this->sDateTimeFormat;
+ return $this->sJSDateTimeFormat;
}
/**
*
- * @param string $sDateTimeFormat
+ * @param string $sJSDateTimeFormat
*
* @return \Combodo\iTop\Form\Field\DateTimeField
*/
- public function SetJSDateTimeFormat($sDateTimeFormat)
+ public function SetJSDateTimeFormat($sJSDateTimeFormat)
{
- $this->sDateTimeFormat = $sDateTimeFormat;
+ $this->sJSDateTimeFormat = $sJSDateTimeFormat;
return $this;
}
diff --git a/sources/form/field/multiplechoicesfield.class.inc.php b/sources/form/field/multiplechoicesfield.class.inc.php
index 30c655c8d..7d866df1e 100644
--- a/sources/form/field/multiplechoicesfield.class.inc.php
+++ b/sources/form/field/multiplechoicesfield.class.inc.php
@@ -113,7 +113,7 @@ abstract class MultipleChoicesField extends Field
{
if (array_key_exists($value, $this->currentValue))
{
- unset($this->currentValue[$sId]);
+ unset($this->currentValue[$value]);
}
return $this;
}
diff --git a/sources/form/field/stringfield.class.inc.php b/sources/form/field/stringfield.class.inc.php
index 57171133a..73fb6d589 100644
--- a/sources/form/field/stringfield.class.inc.php
+++ b/sources/form/field/stringfield.class.inc.php
@@ -19,7 +19,6 @@
namespace Combodo\iTop\Form\Field;
-use \Combodo\iTop\Form\Field\TextField;
class StringField extends TextField
{
diff --git a/sources/form/field/urlfield.class.inc.php b/sources/form/field/urlfield.class.inc.php
index 981032857..0b72aa1d5 100644
--- a/sources/form/field/urlfield.class.inc.php
+++ b/sources/form/field/urlfield.class.inc.php
@@ -20,6 +20,7 @@
namespace Combodo\iTop\Form\Field;
use Str;
+use Closure;
/**
* Description of UrlField
@@ -36,7 +37,7 @@ class UrlField extends StringField
* Default constructor
*
* @param string $sId
- * @param Closure $onFinalizeCallback (Used in the $oForm->AddField($sId, ..., function() use ($oManager, $oForm, '...') { ... } ); )
+ * @param \Closure $onFinalizeCallback (Used in the $oForm->AddField($sId, ..., function() use ($oManager, $oForm, '...') { ... } ); )
*/
public function __construct($sId, Closure $onFinalizeCallback = null)
{
diff --git a/sources/renderer/console/fieldrenderer/consoleselectobjectfieldrenderer.class.inc.php b/sources/renderer/console/fieldrenderer/consoleselectobjectfieldrenderer.class.inc.php
index 935f9a21d..fd54fd352 100644
--- a/sources/renderer/console/fieldrenderer/consoleselectobjectfieldrenderer.class.inc.php
+++ b/sources/renderer/console/fieldrenderer/consoleselectobjectfieldrenderer.class.inc.php
@@ -28,7 +28,17 @@ use Combodo\iTop\Form\Field\SelectObjectField;
class ConsoleSelectObjectFieldRenderer extends FieldRenderer
{
- public function Render()
+ /**
+ * @return RenderingOutput
+ *
+ * @throws \Exception
+ * @throws \CoreException
+ * @throws \CoreUnexpectedValue
+ * @throws \MissingQueryArgument
+ * @throws \MySQLException
+ * @throws \MySQLHasGoneAwayException
+ */
+ public function Render()
{
$oOutput = new RenderingOutput();
@@ -124,13 +134,13 @@ class ConsoleSelectObjectFieldRenderer extends FieldRenderer
if (($iCount == 1) && $bMandatory)
{
// When there is only once choice, select it by default
- $sSelected = ' checked';
+ $sSelected = 'checked';
}
else
{
- $sSelected = ($value == $iObject) ? ' checked' : '';
+ $sSelected = ($value == $iObject) ? 'checked' : '';
}
- $oOutput->AddHtml("