apply StyleCI recommendation

This commit is contained in:
El RIDO 2021-06-13 11:16:29 +02:00
parent fa4fe2852d
commit 68b097087d
No known key found for this signature in database
GPG Key ID: 0F5C940A6BD81F92
3 changed files with 4 additions and 6 deletions

View File

@ -110,7 +110,7 @@ class Request
case 'POST': case 'POST':
// it might be a creation or a deletion, the latter is detected below // it might be a creation or a deletion, the latter is detected below
$this->_operation = 'create'; $this->_operation = 'create';
$this->_params = Json::decode( $this->_params = Json::decode(
file_get_contents(self::$_inputStream) file_get_contents(self::$_inputStream)
); );
break; break;
@ -130,7 +130,7 @@ class Request
if (array_key_exists('pasteid', $this->_params) && !empty($this->_params['pasteid'])) { if (array_key_exists('pasteid', $this->_params) && !empty($this->_params['pasteid'])) {
if (array_key_exists('deletetoken', $this->_params) && !empty($this->_params['deletetoken'])) { if (array_key_exists('deletetoken', $this->_params) && !empty($this->_params['deletetoken'])) {
$this->_operation = 'delete'; $this->_operation = 'delete';
} else if ($this->_operation != 'create') { } elseif ($this->_operation != 'create') {
$this->_operation = 'read'; $this->_operation = 'read';
} }
} elseif (array_key_exists('jsonld', $this->_params) && !empty($this->_params['jsonld'])) { } elseif (array_key_exists('jsonld', $this->_params) && !empty($this->_params['jsonld'])) {

View File

@ -1,13 +1,11 @@
<?php <?php
use Google\Auth\HttpHandler\HttpHandlerFactory;
use Google\Cloud\Core\Exception\BadRequestException; use Google\Cloud\Core\Exception\BadRequestException;
use Google\Cloud\Core\Exception\NotFoundException; use Google\Cloud\Core\Exception\NotFoundException;
use Google\Cloud\Storage\Bucket; use Google\Cloud\Storage\Bucket;
use Google\Cloud\Storage\Connection\ConnectionInterface; use Google\Cloud\Storage\Connection\ConnectionInterface;
use Google\Cloud\Storage\StorageClient; use Google\Cloud\Storage\StorageClient;
use Google\Cloud\Storage\StorageObject; use Google\Cloud\Storage\StorageObject;
use GuzzleHttp\Client;
use PrivateBin\Data\GoogleCloudStorage; use PrivateBin\Data\GoogleCloudStorage;
use PrivateBin\Persistence\ServerSalt; use PrivateBin\Persistence\ServerSalt;

View File

@ -343,9 +343,9 @@ class ModelTest extends PHPUnit_Framework_TestCase
*/ */
public function testInvalidPasteFormat() public function testInvalidPasteFormat()
{ {
$pasteData = Helper::getPastePost(); $pasteData = Helper::getPastePost();
$pasteData['adata'][1] = 'format does not exist'; $pasteData['adata'][1] = 'format does not exist';
$paste = $this->_model->getPaste(); $paste = $this->_model->getPaste();
$paste->setData($pasteData); $paste->setData($pasteData);
} }