mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-01 10:56:08 +01:00
Pass phpstan level 1 tests
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
# v1.10.0-rc.6
|
||||||
|
## mm/dd/2020
|
||||||
|
|
||||||
|
1. [](#new)
|
||||||
|
* Pass phpstan level 1 tests
|
||||||
|
|
||||||
# v1.10.0-rc.5
|
# v1.10.0-rc.5
|
||||||
## 02/03/2020
|
## 02/03/2020
|
||||||
|
|
||||||
|
|||||||
@@ -309,7 +309,17 @@ class Admin
|
|||||||
*/
|
*/
|
||||||
public static function getLastPageRoute()
|
public static function getLastPageRoute()
|
||||||
{
|
{
|
||||||
return Grav::instance()['session']->lastPageRoute ?: self::route();
|
/** @var Session $session */
|
||||||
|
$session = Grav::instance()['session'];
|
||||||
|
$route = $session->lastPageRoute;
|
||||||
|
if ($route) {
|
||||||
|
return $route;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @var Admin $admin */
|
||||||
|
$admin = Grav::instance()['admin'];
|
||||||
|
|
||||||
|
return $admin->getCurrentRoute();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAdminRoute(string $path = '', $languageCode = null): Route
|
public function getAdminRoute(string $path = '', $languageCode = null): Route
|
||||||
|
|||||||
@@ -1080,6 +1080,7 @@ class AdminController extends AdminBaseController
|
|||||||
$data = $this->post;
|
$data = $this->post;
|
||||||
$package = $data['package'] ?? '';
|
$package = $data['package'] ?? '';
|
||||||
$type = $data['type'] ?? '';
|
$type = $data['type'] ?? '';
|
||||||
|
$result = false;
|
||||||
|
|
||||||
if (!$this->authorizeTask('uninstall ' . $type, ['admin.' . $type, 'admin.super'])) {
|
if (!$this->authorizeTask('uninstall ' . $type, ['admin.' . $type, 'admin.super'])) {
|
||||||
$json_response = [
|
$json_response = [
|
||||||
@@ -1106,6 +1107,7 @@ class AdminController extends AdminBaseController
|
|||||||
$this->sendJsonResponse($json_response, 200);
|
$this->sendJsonResponse($json_response, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$dependencies = false;
|
||||||
try {
|
try {
|
||||||
$dependencies = $this->admin->dependenciesThatCanBeRemovedWhenRemoving($package);
|
$dependencies = $this->admin->dependenciesThatCanBeRemovedWhenRemoving($package);
|
||||||
$result = Gpm::uninstall($package, []);
|
$result = Gpm::uninstall($package, []);
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ use Grav\Common\Grav;
|
|||||||
use Grav\Common\Inflector;
|
use Grav\Common\Inflector;
|
||||||
use Grav\Common\Language\Language;
|
use Grav\Common\Language\Language;
|
||||||
use Grav\Common\Utils;
|
use Grav\Common\Utils;
|
||||||
|
use Grav\Framework\Flex\Interfaces\FlexObjectInterface;
|
||||||
use Grav\Framework\Form\Interfaces\FormInterface;
|
use Grav\Framework\Form\Interfaces\FormInterface;
|
||||||
use Grav\Framework\Psr7\Response;
|
use Grav\Framework\Psr7\Response;
|
||||||
use Grav\Framework\RequestHandler\Exception\NotFoundException;
|
use Grav\Framework\RequestHandler\Exception\NotFoundException;
|
||||||
@@ -172,6 +173,11 @@ abstract class AbstractController implements RequestHandlerInterface
|
|||||||
return $form;
|
return $form;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return FlexObjectInterface
|
||||||
|
*/
|
||||||
|
abstract public function getObject();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Grav instance.
|
* Get Grav instance.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user