Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/close_stale_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
issues: write # for actions/stale to close stale issues
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v10
- uses: actions/stale@v11
with:
stale-issue-message: >-
There has been no activity on this issue for some time and therefore it is considered stale
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../PluginsMakefile.mk
4 changes: 2 additions & 2 deletions ajax/dropdownReplaceFindDevice.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
throw new AccessDeniedHttpException(__s("You don't have permission to perform this action."));
}

if (class_exists($_REQUEST['itemtype']) && is_a($_REQUEST['itemtype'], CommonDBTM::class, true)) {
$item = getItemForItemtype($_REQUEST['itemtype']);
if ($item instanceof CommonDBTM) {
$itemtypeisplugin = isPluginItemType($_REQUEST['itemtype']);
$item = new $_REQUEST['itemtype']();
$table = getTableForItemType($_REQUEST['itemtype']);
$options = [];
$count = 0;
Expand Down
45 changes: 21 additions & 24 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,27 @@
* -------------------------------------------------------------------------
*/

use Rector\Configuration\RectorConfigBuilder;

require_once __DIR__ . '/../../src/Plugin.php';

use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\Config\RectorConfig;
use Rector\ValueObject\PhpVersion;
$baseline_file = __DIR__ . '/../../PluginsRector.php';
if (!file_exists($baseline_file)) {
throw new RuntimeException(
sprintf(
'Unable to find "%s". Running rector on a plugin requires a GLPI development checkout that ships PluginsRector.php.',
$baseline_file,
),
);
}

$baseline = require $baseline_file;

/** @var RectorConfigBuilder $config */
$config = $baseline([
__DIR__ . '/ajax',
__DIR__ . '/front',
__DIR__ . '/inc',
]);

return RectorConfig::configure()
->withPaths([
__DIR__ . '/ajax',
__DIR__ . '/front',
__DIR__ . '/inc',
])
->withPhpVersion(PhpVersion::PHP_82)
->withCache(
cacheDirectory: __DIR__ . '/var/rector',
cacheClass: FileCacheStorage::class,
)
->withRootFiles()
->withParallel(timeoutSeconds: 300)
->withImportNames(removeUnusedImports: true)
->withPreparedSets(
deadCode: true,
codeQuality: true,
codingStyle: true,
)
->withPhpSets(php82: true) // apply PHP sets up to PHP 8.2
;
return $config;
Loading