Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement phpstan 5 #399

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
194 changes: 91 additions & 103 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion front/info.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@
}
Html::back();
}

/** @phpstan-ignore-next-line */
Session::setActiveTab('PluginDatainjectionModel', 'PluginDatainjectionModel$5');
Html::back();
1 change: 1 addition & 0 deletions front/mapping.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
$_POST['models_id'],
PluginDatainjectionModel::OTHERS_STEP
);
/** @phpstan-ignore-next-line */
Session::setActiveTab('PluginDatainjectionModel', 'PluginDatainjectionModel$5');
Session::addMessageAfterRedirect(
__(
Expand Down
2 changes: 2 additions & 0 deletions front/model.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
$newID = $model->add($_POST);

//Set display to the advanced options tab
/** @phpstan-ignore-next-line */
Session::setActiveTab('PluginDatainjectionModel', 'PluginDatainjectionModel$3');
Html::redirect(Toolbox::getItemTypeFormURL('PluginDatainjectionModel') . "?id=$newID");
} else if (isset($_POST["delete"])) {
Expand Down Expand Up @@ -80,6 +81,7 @@
]
)
) {
/** @phpstan-ignore-next-line */
Session::setActiveTab('PluginDatainjectionModel', 'PluginDatainjectionModel$4');
} else {
Session::addMessageAfterRedirect(
Expand Down
3 changes: 1 addition & 2 deletions hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function plugin_datainjection_install()

include_once Plugin::getPhpDir('datainjection') . "/inc/profile.class.php";

$migration = new Migration(null);
$migration = new Migration(PLUGIN_DATAINJECTION_VERSION);

$default_charset = DBConnection::getDefaultCharset();
$default_collation = DBConnection::getDefaultCollation();
Expand Down Expand Up @@ -1990,7 +1990,6 @@ function plugin_datainjection_addDefaultWhere($itemtype)
} else {
return "1 = 0"; //no model available -> force WHERE clause to get no result
}
return false;
default:
break;
}
Expand Down
2 changes: 1 addition & 1 deletion inc/autoupdatesysteminjection.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function getOptions($primary_type = '')
* @param $values array fields to add into glpi
* @param $options array options used during creation
*
* @return an array of IDs of newly created objects : for example array(Computer=>1, Networkport=>10)
* @return array of IDs of newly created objects : for example array(Computer=>1, Networkport=>10)
**/
public function addOrUpdateObject($values = [], $options = [])
{
Expand Down
2 changes: 1 addition & 1 deletion inc/backend.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public static function toUTF8($string)
{

if (!self::is_utf8($string)) {
return utf8_encode($string);
return mb_convert_encoding($string, 'UTF-8');
}
return $string;
}
Expand Down
4 changes: 2 additions & 2 deletions inc/clientinjection.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ class PluginDatainjectionClientInjection
private $results = [];

//Model used for injection
private $model;
private $model; /** @phpstan-ignore-line */

//Overall injection results
private $global_results;
private $global_results; /** @phpstan-ignore-line */


/**
Expand Down
Loading