Version 5.0.0 beta 1
This commit is contained in:
1 parent
25ddeb65d6
commit
15c7beabc5
6736 files changed
+627902
-497943
No files matched your search
@@ -10,22 +10,26 @@
|
||||
*/
|
||||
|
||||
namespace IPS\Api\GraphQL\Queries;
|
||||
use GraphQL\Type\Definition\ObjectType;
|
||||
use IPS\Api\GraphQL\TypeRegistry;
|
||||
use IPS\Api\GraphQL\Types\ModuleAccessType;
|
||||
use IPS\Application;
|
||||
use function defined;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* ModuleAccess query for GraphQL API
|
||||
*/
|
||||
class _ModuleAccess
|
||||
class ModuleAccess
|
||||
{
|
||||
public function __construct($app)
|
||||
protected ?Application $app = null;
|
||||
|
||||
public function __construct( Application $app )
|
||||
{
|
||||
$this->app = $app;
|
||||
}
|
||||
@@ -33,7 +37,7 @@ class _ModuleAccess
|
||||
/*
|
||||
* @brief Query description
|
||||
*/
|
||||
public static $description = "Returns module view permissions";
|
||||
public static string $description = "Returns module view permissions";
|
||||
|
||||
/*
|
||||
* Query arguments
|
||||
@@ -46,7 +50,7 @@ class _ModuleAccess
|
||||
/**
|
||||
* Return the query return type
|
||||
*/
|
||||
public function type()
|
||||
public function type() : ModuleAccessType
|
||||
{
|
||||
return TypeRegistry::moduleAccess();
|
||||
}
|
||||
@@ -54,12 +58,12 @@ class _ModuleAccess
|
||||
/**
|
||||
* Resolves this query
|
||||
*
|
||||
* @param mixed Value passed into this resolver
|
||||
* @param array Arguments
|
||||
* @param array Context values
|
||||
* @return \IPS\Application
|
||||
* @param mixed $val Value passed into this resolver
|
||||
* @param array $args Arguments
|
||||
* @param array $context Context values
|
||||
* @return Application
|
||||
*/
|
||||
public function resolve($val, $args, $context)
|
||||
public function resolve( mixed $val, array $args, array $context ) : Application
|
||||
{
|
||||
return $this->app;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user