Skip to content

Commit

Permalink
Linting: linting code
Browse files Browse the repository at this point in the history
  • Loading branch information
WunderJacob committed Nov 6, 2024
1 parent c0dcb84 commit 1ff7344
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion classes/pluginsInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,9 @@ public function manual_install_plugins($installable) {
rename($tempdir . '/' . $extracteddirname, $finaldir);
rmdir($tempdir);
$this->feedback[$installable->type][$installable->component] = [
'success' => [get_string('upgradeplugincompleted', 'tool_wbinstaller', $installable->component)]
'success' => [
get_string('upgradeplugincompleted', 'tool_wbinstaller', $installable->component),
],
];
} else {
$this->feedback[$installable->type][$installable->component]['error'][] =
Expand Down
7 changes: 6 additions & 1 deletion classes/wbCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,12 @@ public function clean_after_installment() {
public function check_recipe($extracted) {
global $CFG;
$extractpath = $CFG->tempdir . '/zip/precheck/' . str_replace('.zip', '', $this->filename) . '/';
$jsonstring = file_get_contents($extracted . str_replace('.zip', '', $this->filename) . '/recipe.json');
$jsonstring =
file_get_contents(
$extracted .
str_replace('.zip', '', $this->filename) .
'/recipe.json'
);
$jsonarray = json_decode($jsonstring, true);
$this->get_current_step($jsonstring, count($jsonarray['steps']));
foreach ($jsonarray['steps'] as $step) {
Expand Down
3 changes: 2 additions & 1 deletion classes/wbInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ class_exists($installerclass) &&
$this->matchingids[$steptype] = $instance->get_matchingids();
$this->set_status($instance->get_status());
} else {
$this->feedback[$steptype]['needed'][$steptype]['error'][] = get_string('classnotfound', 'tool_wbinstaller', $steptype);
$this->feedback[$steptype]['needed'][$steptype]['error'][] =
get_string('classnotfound', 'tool_wbinstaller', $steptype);
}
}
$finished = $this->set_current_step($jsonstring);
Expand Down
2 changes: 1 addition & 1 deletion tests/learningpathsinstaller_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function test_check_table_exists_unvalid_valid() {
$installer->fileinfo = 'non_existing_table';
$installer->check_table_exists([], $learningpath);
$this->assertArrayHasKey('needed', $installer->feedback);
$this->assertArrayHasKey('error', $installer->feedback['needed']['Test Learning Path']);
$this->assertArrayHasKey('warning', $installer->feedback['needed']['Test Learning Path']);
$this->assertStringContainsString(
get_string('dbtablenotfound', 'tool_wbinstaller', $installer->fileinfo),
$installer->feedback['needed']['Test Learning Path']['warning'][0]
Expand Down

0 comments on commit 1ff7344

Please sign in to comment.