Skip to content

Commit

Permalink
phpstan lvl 1; rename method & drop useless param
Browse files Browse the repository at this point in the history
  • Loading branch information
trasher committed Oct 30, 2023
1 parent 3e2e162 commit 0f7e3c7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
10 changes: 3 additions & 7 deletions inc/sccm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function getDevices($where = 0, $limit = 99999999)
$PluginSccmSccmdb->disconnect();
}

public function getDatas($type, $deviceid, $limit = 99999999)
public function getProcessorsDatas($deviceid, $limit = 99999999)
{

$PluginSccmSccmdb = new PluginSccmSccmdb();
Expand All @@ -91,12 +91,8 @@ public function getDatas($type, $deviceid, $limit = 99999999)

$datas = [];

switch ($type) {
case 'processors':
$fields = ['Manufacturer00','Name00','NormSpeed00','AddressWidth00','CPUKey00','NumberOfCores00', 'NumberOfLogicalProcessors00'];
$table = 'Processor_DATA';
break;
}
$fields = ['Manufacturer00','Name00','NormSpeed00','AddressWidth00','CPUKey00','NumberOfCores00', 'NumberOfLogicalProcessors00'];
$table = 'Processor_DATA';

$query = "SELECT " . implode(',', $fields) . "\n";
$query .= " FROM " . $table . "\n";
Expand Down
3 changes: 2 additions & 1 deletion inc/sccmxml.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ public function setProcessors()

$CONTENT = $this->sxml->CONTENT[0];
$i = 0;
foreach ($PluginSccmSccm->getDatas('processors', $this->device_id) as $value) {
$cpu_data = $PluginSccmSccm->getProcessorsDatas($this->device_id);
foreach ($cpu_data as $value) {
if (!in_array($value['CPUKey00'], $cpukeys)) {
$CONTENT->addChild('CPUS');
$CPUS = $this->sxml->CONTENT[0]->CPUS[$i];
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
parameters:
parallel:
maximumNumberOfProcesses: 2
level: 0
level: 1
bootstrapFiles:
- ../../inc/based_config.php
- setup.php
Expand Down

0 comments on commit 0f7e3c7

Please sign in to comment.