-
Notifications
You must be signed in to change notification settings - Fork 55
Feature/glpi 11.0 #477
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
base: main
Are you sure you want to change the base?
Feature/glpi 11.0 #477
Conversation
|
b6c7675
to
a8079e3
Compare
composer.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add phpstan-glpi
:
composer require --dev glpi-project/phpstan-glpi
setup.php
Outdated
function plugin_datainjection_geturl(): string | ||
{ | ||
/** @var array $CFG_GLPI */ | ||
global $CFG_GLPI; | ||
return sprintf('%s/plugins/datainjection/', $CFG_GLPI['url_base']); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan of using a function in this case, because it doesn't make the code easier to read.
What's more, in some cases, you have to use $CFG_GLPI[‘root_doc’]
instead of $CFG_GLPI[‘url_base’]
.
inc/commoninjectionlib.class.php
Outdated
@@ -408,7 +408,7 @@ public static function getBlacklistedOptions($itemtype) | |||
if (in_array($itemtype, $CFG_GLPI["networkport_types"])) { | |||
$raw_options_to_blacklist = array_merge( | |||
$raw_options_to_blacklist, | |||
NetworkPort::rawSearchOptionsToAdd($itemtype) | |||
NetworkPort::rawSearchOptionsToAdd($itemtype) /* @phpstan-ignore-line */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please specify the ignored error in the code comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter #1 $itemtype of static method NetworkPort::rawSearchOptionsToAdd() expects null, string given.
The function does not use $itemtype
and sets a default value, so you can remove it without changing the behavior:
NetworkPort::rawSearchOptionsToAdd()
@@ -68,6 +68,10 @@ function plugin_init_datainjection() | |||
) | |||
); | |||
} | |||
$PLUGIN_HOOKS["config_page"]['datainjection'] = "front/clientinjection.form.php"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$PLUGIN_HOOKS["config_page"]['datainjection'] = "front/clientinjection.form.php"; | |
$PLUGIN_HOOKS[Hooks::CONFIG_PAGE]['datainjection'] = "front/clientinjection.form.php"; |
daea3de
to
b040fa9
Compare
Checklist before requesting a review
Please delete options that are not relevant.
Description
Screenshots (if appropriate):