Skip to content

Commit

Permalink
code improvements from strict type tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ximex committed Mar 27, 2018
1 parent 477ea11 commit ea56066
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
1 change: 0 additions & 1 deletion adm_program/modules/profile/roles_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ function getRoleMemberships($htmlListId, User $user, \PDOStatement $roleStatemen
{
$roleMemHTML .= '<a class="admidio-icon-link"><img src="'.THEME_URL.'/icons/dummy.png" alt=""/></a>';
}

}

// only show info if system setting is activated
Expand Down
2 changes: 1 addition & 1 deletion adm_program/system/classes/HtmlForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public function addButton($id, $text, array $options = array())

if ($optionsAll['data-admidio'] !== '')
{
$this->addAttribute('data-admidio', $optionsAll['data-admidio']);
$this->addAttribute('data-admidio', (string) $optionsAll['data-admidio']);
}

if ($optionsAll['onClickText'] !== '')
Expand Down
2 changes: 1 addition & 1 deletion adm_program/system/classes/TableAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ public function setValue($columnName, $newValue, $checkValue = true)
// now mark all other columns with values of this object as changed
foreach ($this->dbColumns as $column => $value)
{
if (strlen($value) > 0)
if (strlen((string) $value) > 0)
{
$this->columnsInfos[$column]['changed'] = true;
}
Expand Down
9 changes: 5 additions & 4 deletions adm_program/system/classes/TableUserField.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ public function getValue($columnName, $format = '')
$value = parent::getValue($columnName, $format);
}

if ($value === null)
{
return '';
}

if ($format !== 'database')
{
switch ($columnName)
Expand Down Expand Up @@ -297,10 +302,6 @@ public function getValue($columnName, $format = '')
}
}

if ($value === null)
{
return '';
}
return $value;
}

Expand Down
10 changes: 5 additions & 5 deletions adm_program/system/function.php
Original file line number Diff line number Diff line change
Expand Up @@ -501,13 +501,13 @@ function admFuncVariableIsValid(array $array, $variableName, $datatype, array $o
* Creates a html fragment with information about user and time when the recordset was created
* and when it was at last edited. Therefore all necessary data must be set in the function
* parameters. If userId is not set then the function will show **deleted user**.
* @param int $userIdCreated Id of the user who create the recordset.
* @param string $timestampCreate Date and time of the moment when the user create the recordset.
* @param int $userIdEdited Id of the user last changed the recordset.
* @param string $timestampEdited Date and time of the moment when the user last changed the recordset
* @param int $userIdCreated Id of the user who create the recordset.
* @param string $timestampCreate Date and time of the moment when the user create the recordset.
* @param int $userIdEdited Id of the user last changed the recordset.
* @param string|null $timestampEdited Date and time of the moment when the user last changed the recordset
* @return string Returns a html string with usernames who creates item and edit item the last time
*/
function admFuncShowCreateChangeInfoById($userIdCreated, $timestampCreate, $userIdEdited = 0, $timestampEdited = '')
function admFuncShowCreateChangeInfoById($userIdCreated, $timestampCreate, $userIdEdited = 0, $timestampEdited = null)
{
global $gDb, $gProfileFields, $gL10n, $gSettingsManager;

Expand Down

0 comments on commit ea56066

Please sign in to comment.