mirror of
https://github.com/flextype/flextype.git
synced 2025-08-05 12:47:45 +02:00
refactor(rest-api): fix not reachable code
This commit is contained in:
@@ -162,10 +162,6 @@ $app->post('/api/files', function (Request $request, Response $response) use ($f
|
||||
// Set response code
|
||||
$response_code = Filesystem::has($create_file) ? 200 : 404;
|
||||
|
||||
// Return response
|
||||
return $response
|
||||
->withJson($response_data, $response_code);
|
||||
|
||||
// Update calls counter
|
||||
Filesystem::write($files_token_file_path, $flextype['yaml']->encode(array_replace_recursive($files_token_file_data, ['calls' => $files_token_file_data['calls'] + 1])));
|
||||
|
||||
@@ -252,10 +248,6 @@ $app->put('/api/files', function (Request $request, Response $response) use ($fl
|
||||
// Set response code
|
||||
$response_code = ($rename_file === true) ? 200 : 404;
|
||||
|
||||
// Return response
|
||||
return $response
|
||||
->withJson($response_data, $response_code);
|
||||
|
||||
// Update calls counter
|
||||
Filesystem::write($files_token_file_path, $flextype['yaml']->encode(array_replace_recursive($files_token_file_data, ['calls' => $files_token_file_data['calls'] + 1])));
|
||||
|
||||
|
Reference in New Issue
Block a user