mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-12-01 04:40:45 +09:00
Apply PHP Code Styling & Quality Changes (#1708)
Co-authored-by: FOSSBilling Bot <fossbilling-bot>
This commit is contained in:
1 parent
c4c67be42f
commit
6afde30ea7
3 files changed
+9
-9
No files matched your search
+4
-3
@@ -834,16 +834,17 @@ $di['table_export_csv'] = $di->protect(function (string $table, string $outputNa
|
||||
exit;
|
||||
});
|
||||
|
||||
/**
|
||||
/*
|
||||
* Converts markdown into HTML and returns the result.
|
||||
*
|
||||
*
|
||||
* @param string|null $content The content to convert
|
||||
*
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
$di['parse_markdown'] = $di->protect(function (?string $content) {
|
||||
$parser = new League\CommonMark\GithubFlavoredMarkdownConverter(['html_input' => 'escape', 'allow_unsafe_links' => false, 'max_nesting_level' => 50]);
|
||||
$content ??= '';
|
||||
|
||||
return $parser->convert($content);
|
||||
});
|
||||
|
||||
|
||||
@@ -50,9 +50,7 @@ class Admin extends \Api_Abstract
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the readme as HTML for a given extension
|
||||
*
|
||||
* @return string
|
||||
* Gets the readme as HTML for a given extension.
|
||||
*/
|
||||
public function get_extension_readme($data): string
|
||||
{
|
||||
@@ -60,8 +58,9 @@ class Admin extends \Api_Abstract
|
||||
'extension_id' => 'Extension ID was not passed',
|
||||
];
|
||||
|
||||
$this->di['validator']->checkRequiredParamsForArray($required, $data);
|
||||
$extensionInfo = $this->di['extension_manager']->getExtension($data['extension_id']);
|
||||
$this->di['validator']->checkRequiredParamsForArray($required, $data);
|
||||
$extensionInfo = $this->di['extension_manager']->getExtension($data['extension_id']);
|
||||
|
||||
return $this->di['parse_markdown']($extensionInfo['readme']);
|
||||
}
|
||||
|
||||
|
||||
@@ -688,7 +688,7 @@ class Service implements \FOSSBilling\InjectionAwareInterface
|
||||
$author = $this->di['db']->load('Client', $model->client_id);
|
||||
}
|
||||
|
||||
if(!$author){
|
||||
if (!$author) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user