* [FIX] Fixed wrong behavior when searching for accounts on accounts manager. Thanks to @Weptun for the feedback. Closes #1271

* [ADD] Added missing tests
* [MOD] Code cleanup

Signed-off-by: Rubén D <nuxsmin@syspass.org>
This commit is contained in:
Rubén D
2019-04-21 23:12:45 +02:00
parent b3906afa13
commit 2318796c00
366 changed files with 5141 additions and 3752 deletions

View File

@@ -24,9 +24,13 @@
namespace SP\Modules\Api\Controllers;
use DI\DependencyException;
use DI\NotFoundException;
use Exception;
use SP\Core\Acl\ActionsInterface;
use SP\Core\Events\Event;
use SP\Core\Events\EventMessage;
use SP\Core\Exceptions\InvalidClassException;
use SP\DataModel\ClientData;
use SP\DataModel\ItemSearchData;
use SP\Modules\Api\Controllers\Help\ClientHelp;
@@ -66,7 +70,7 @@ final class ClientController extends ControllerBase
);
$this->returnResponse(ApiResponse::makeSuccess($clientData, $id));
} catch (\Exception $e) {
} catch (Exception $e) {
processException($e);
$this->returnResponseException($e);
@@ -96,7 +100,7 @@ final class ClientController extends ControllerBase
);
$this->returnResponse(ApiResponse::makeSuccess($clientData, $id, __('Client added')));
} catch (\Exception $e) {
} catch (Exception $e) {
processException($e);
$this->returnResponseException($e);
@@ -127,7 +131,7 @@ final class ClientController extends ControllerBase
);
$this->returnResponse(ApiResponse::makeSuccess($clientData, $clientData->getId(), __('Client updated')));
} catch (\Exception $e) {
} catch (Exception $e) {
processException($e);
$this->returnResponseException($e);
@@ -156,7 +160,7 @@ final class ClientController extends ControllerBase
);
$this->returnResponse(ApiResponse::makeSuccess($clientData, $id, __('Client deleted')));
} catch (\Exception $e) {
} catch (Exception $e) {
$this->returnResponseException($e);
processException($e);
@@ -178,7 +182,7 @@ final class ClientController extends ControllerBase
$this->eventDispatcher->notifyEvent('search.client', new Event($this));
$this->returnResponse(ApiResponse::makeSuccess($this->clientService->search($itemSearchData)->getDataAsArray()));
} catch (\Exception $e) {
} catch (Exception $e) {
processException($e);
$this->returnResponseException($e);
@@ -186,9 +190,9 @@ final class ClientController extends ControllerBase
}
/**
* @throws \DI\DependencyException
* @throws \DI\NotFoundException
* @throws \SP\Core\Exceptions\InvalidClassException
* @throws DependencyException
* @throws NotFoundException
* @throws InvalidClassException
*/
protected function initialize()
{