1
0
Fork 0
mirror of synced 2024-07-02 13:10:38 +12:00

Merge branch '0.7.x' of github.com:appwrite/appwrite into swoole-and-functions

This commit is contained in:
Eldad Fux 2020-10-30 07:52:12 +02:00
commit 33d13d91e1
36 changed files with 82 additions and 82 deletions

View file

@ -413,7 +413,6 @@ App::error(function ($error, $utopia, $request, $response, $layout, $project) {
$response->dynamic(new Document($output), $response->dynamic(new Document($output),
$utopia->isDevelopment() ? Response::MODEL_ERROR_DEV : Response::MODEL_LOCALE); $utopia->isDevelopment() ? Response::MODEL_ERROR_DEV : Response::MODEL_LOCALE);
}, ['error', 'utopia', 'request', 'response', 'layout', 'project']); }, ['error', 'utopia', 'request', 'response', 'layout', 'project']);
App::get('/manifest.json') App::get('/manifest.json')

View file

@ -387,8 +387,7 @@ App::get('/console/version')
if ($version && isset($version['version'])) { if ($version && isset($version['version'])) {
return $response->json(['version' => $version['version']]); return $response->json(['version' => $version['version']]);
} } else {
else {
throw new Exception('Failed to check for a newer version', 500); throw new Exception('Failed to check for a newer version', 500);
} }
} catch (\Throwable $th) { } catch (\Throwable $th) {

View file

@ -9,9 +9,14 @@ use Appwrite\Auth\OAuth2;
class Box extends OAuth2 class Box extends OAuth2
{ {
/**
* @var string
*/
private $endpoint = 'https://account.box.com/api/oauth2/'; private $endpoint = 'https://account.box.com/api/oauth2/';
/**
* @var string
*/
private $resourceEndpoint = 'https://api.box.com/2.0/'; private $resourceEndpoint = 'https://api.box.com/2.0/';
/** /**
@ -19,6 +24,9 @@ class Box extends OAuth2
*/ */
protected $user = []; protected $user = [];
/**
* @var array
*/
protected $scopes = [ protected $scopes = [
'manage_app_users', 'manage_app_users',
]; ];
@ -148,5 +156,4 @@ class Box extends OAuth2
return $this->user; return $this->user;
} }
} }

View file

@ -219,7 +219,7 @@ class Document extends ArrayObject
{ {
$array = parent::getArrayCopy(); $array = parent::getArrayCopy();
$output = array(); $output = [];
foreach ($array as $key => &$value) { foreach ($array as $key => &$value) {
if (!empty($whitelist) && !\in_array($key, $whitelist)) { // Export only whitelisted fields if (!empty($whitelist) && !\in_array($key, $whitelist)) { // Export only whitelisted fields

View file

@ -16,7 +16,6 @@ class Env
*/ */
public function __construct(string $data) public function __construct(string $data)
{ {
$data = explode("\n", $data); $data = explode("\n", $data);
foreach ($data as &$row) { foreach ($data as &$row) {

View file

@ -13,7 +13,7 @@ class Storage
* *
* @var array * @var array
*/ */
public static $devices = array(); public static $devices = [];
/** /**
* Set Device. * Set Device.

View file

@ -238,8 +238,7 @@ class Response extends SwooleResponse
if (!$document->isSet($key)) { if (!$document->isSet($key)) {
if (!is_null($rule['default'])) { if (!is_null($rule['default'])) {
$document->setAttribute($key, $rule['default']); $document->setAttribute($key, $rule['default']);
} } else {
else {
throw new Exception('Model '.$model->getName().' is missing response key: '.$key); throw new Exception('Model '.$model->getName().' is missing response key: '.$key);
} }
} }

View file

@ -6,5 +6,4 @@ use Tests\E2E\Client;
trait HealthBase trait HealthBase
{ {
} }

View file

@ -6,5 +6,4 @@ use Tests\E2E\Client;
trait ProjectsBase trait ProjectsBase
{ {
} }

View file

@ -60,6 +60,5 @@ class OriginTest extends TestCase
$this->assertEquals($validator->isValid('appwrite-windows://com.company.appname'), false); $this->assertEquals($validator->isValid('appwrite-windows://com.company.appname'), false);
$this->assertEquals($validator->getDescription(), 'Invalid Origin. Register your new client (com.company.appname) as a new Windows platform on your project console dashboard'); $this->assertEquals($validator->getDescription(), 'Invalid Origin. Register your new client (com.company.appname) as a new Windows platform on your project console dashboard');
} }
} }