forked from deblan/side_menu
add constructor property promotion
add return type of methods
This commit is contained in:
parent
05c35b9a63
commit
7c5654f3bc
14 changed files with 77 additions and 387 deletions
|
|
@ -22,37 +22,25 @@ use OCA\SideMenu\AppInfo\Application;
|
|||
use OCP\AppFramework\Controller;
|
||||
use OCP\AppFramework\Http\DataDownloadResponse;
|
||||
use OCP\AppFramework\Http\RedirectResponse;
|
||||
use OCP\AppFramework\Http\Response;
|
||||
use OCP\IConfig;
|
||||
use OCP\IRequest;
|
||||
use OCP\IURLGenerator;
|
||||
|
||||
class AdminSettingController extends Controller
|
||||
{
|
||||
/**
|
||||
* @var IConfig
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* @var IURLGenerator
|
||||
*/
|
||||
protected $urlGenerator;
|
||||
|
||||
public function __construct($appName, IRequest $request, IConfig $config, IURLGenerator $urlGenerator)
|
||||
{
|
||||
public function __construct(
|
||||
$appName,
|
||||
IRequest $request,
|
||||
protected IConfig $config,
|
||||
protected IURLGenerator $urlGenerator
|
||||
) {
|
||||
parent::__construct($appName, $request);
|
||||
|
||||
$this->config = $config;
|
||||
$this->urlGenerator = $urlGenerator;
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function removeCache()
|
||||
public function removeCache(): RedirectResponse
|
||||
{
|
||||
$this->config->setAppValue(Application::APP_ID, 'cache-categories', '[]');
|
||||
|
||||
|
|
@ -63,10 +51,8 @@ class AdminSettingController extends Controller
|
|||
|
||||
/**
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function exportConfiguration()
|
||||
public function exportConfiguration(): DataDownloadResponse
|
||||
{
|
||||
$keys = $this->config->getAppKeys(Application::APP_ID);
|
||||
$appConfig = [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue