1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-08 06:06:45 +02:00

feat(endpoints): use Atomastic Components for endpoints #478

This commit is contained in:
Awilum
2020-11-19 20:51:17 +03:00
parent ed496c2c13
commit 19ab54dcc8
6 changed files with 6 additions and 13 deletions

View File

@@ -9,12 +9,10 @@ declare(strict_types=1);
namespace Flextype;
use Flextype\Component\Filesystem\Filesystem;
/**
* Validate access token
*/
function validate_access_token($token) : bool
{
return Filesystem::has(PATH['project'] . '/tokens/access/' . $token . '/token.yaml');
return flextype('filesystem')->exists(PATH['project'] . '/tokens/access/' . $token . '/token.yaml');
}

View File

@@ -9,7 +9,6 @@ declare(strict_types=1);
namespace Flextype;
use Flextype\Component\Filesystem\Filesystem;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Http\Response;
use function array_replace_recursive;
@@ -22,7 +21,7 @@ use function is_array;
*/
function validate_entries_token($token) : bool
{
return Filesystem::has(PATH['project'] . '/tokens/entries/' . $token . '/token.yaml');
return flextype('filesystem')->exists(PATH['project'] . '/tokens/entries/' . $token . '/token.yaml');
}
/**

View File

@@ -9,7 +9,6 @@ declare(strict_types=1);
namespace Flextype;
use Flextype\Component\Filesystem\Filesystem;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Http\Response;
use function array_replace_recursive;
@@ -22,7 +21,7 @@ use function is_dir;
*/
function validate_files_token($token) : bool
{
return Filesystem::has(PATH['project'] . '/tokens/files/' . $token . '/token.yaml');
return flextype('filesystem')->exists(PATH['project'] . '/tokens/files/' . $token . '/token.yaml');
}
/**

View File

@@ -9,7 +9,6 @@ declare(strict_types=1);
namespace Flextype;
use Flextype\Component\Filesystem\Filesystem;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Http\Response;
use function array_replace_recursive;
@@ -20,7 +19,7 @@ use function count;
*/
function validate_folders_token($token) : bool
{
return Filesystem::has(PATH['project'] . '/tokens/folders/' . $token . '/token.yaml');
return flextype('filesystem')->exists(PATH['project'] . '/tokens/folders/' . $token . '/token.yaml');
}
/**

View File

@@ -9,7 +9,6 @@ declare(strict_types=1);
namespace Flextype;
use Flextype\Component\Filesystem\Filesystem;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Http\Response;
use function array_replace_recursive;
@@ -19,7 +18,7 @@ use function array_replace_recursive;
*/
function validate_images_token($token) : bool
{
return Filesystem::has(PATH['project'] . '/tokens/images/' . $token . '/token.yaml');
return flextype('filesystem')->exists(PATH['project'] . '/tokens/images/' . $token . '/token.yaml');
}
/**

View File

@@ -9,7 +9,6 @@ declare(strict_types=1);
namespace Flextype;
use Flextype\Component\Filesystem\Filesystem;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Http\Response;
use function array_replace_recursive;
@@ -19,7 +18,7 @@ use function array_replace_recursive;
*/
function validate_registry_token($token) : bool
{
return Filesystem::has(PATH['project'] . '/tokens/registry/' . $token . '/token.yaml');
return flextype('filesystem')->exists(PATH['project'] . '/tokens/registry/' . $token . '/token.yaml');
}
/**