diff --git a/app/modules/api/Controllers/AccountController.php b/app/modules/api/Controllers/AccountController.php index 15d17b57..4f138ef4 100644 --- a/app/modules/api/Controllers/AccountController.php +++ b/app/modules/api/Controllers/AccountController.php @@ -24,12 +24,12 @@ namespace SP\Modules\Api\Controllers; -use SP\Account\AccountRequest; -use SP\Account\AccountSearchFilter; use SP\Core\Acl\ActionsInterface; use SP\Core\Crypt\Crypt; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; +use SP\Services\Account\AccountRequest; +use SP\Services\Account\AccountSearchFilter; use SP\Services\Account\AccountService; use SP\Services\Api\ApiResponse; @@ -166,7 +166,7 @@ class AccountController extends ControllerBase $accountSearchFilter->setLimitCount($this->apiService->getParamInt('count', false, 50)); $accountSearchFilter->setSortOrder($this->apiService->getParamInt('order', false, AccountSearchFilter::SORT_DEFAULT)); - $this->returnResponse(new ApiResponse($this->accountService->getByFilter($accountSearchFilter)->getData())); + $this->returnResponse(new ApiResponse($this->accountService->getByFilter($accountSearchFilter))); } catch (\Exception $e) { $this->returnResponseException($e); diff --git a/app/modules/api/Init.php b/app/modules/api/Init.php index 8e0554c3..3333d02f 100644 --- a/app/modules/api/Init.php +++ b/app/modules/api/Init.php @@ -34,7 +34,7 @@ use SP\Services\Upgrade\UpgradeAppService; use SP\Services\Upgrade\UpgradeDatabaseService; use SP\Services\Upgrade\UpgradeUtil; use SP\Storage\Database\Database; -use SP\Storage\Database\DBUtil; +use SP\Storage\Database\DatabaseUtil; use SP\Util\HttpUtil; /** @@ -57,6 +57,7 @@ class Init extends ModuleBase * Module constructor. * * @param Container $container + * * @throws \DI\DependencyException * @throws \DI\NotFoundException */ @@ -70,6 +71,7 @@ class Init extends ModuleBase /** * @param string $controller + * * @throws InitializationException * @throws \DI\DependencyException * @throws \DI\NotFoundException @@ -105,7 +107,7 @@ class Init extends ModuleBase $this->checkUpgrade(); // Checks if the database is set up - DBUtil::checkDatabaseExist($this->container->get(Database::class)->getDbHandler(), $this->configData->getDbName()); + DatabaseUtil::checkDatabaseExist($this->container->get(Database::class)->getDbHandler(), $this->configData->getDbName()); // Initialize event handlers $this->initEventHandlers(); diff --git a/app/modules/web/Controllers/ConfigMailController.php b/app/modules/web/Controllers/ConfigMailController.php index c45f5bfe..ccdddcf1 100644 --- a/app/modules/web/Controllers/ConfigMailController.php +++ b/app/modules/web/Controllers/ConfigMailController.php @@ -32,7 +32,7 @@ use SP\Core\Events\EventMessage; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\ConfigTrait; use SP\Providers\Mail\MailParams; -use SP\Services\MailService; +use SP\Services\Mail\MailService; /** * Class ConfigMailController diff --git a/app/modules/web/Controllers/ConfigManagerController.php b/app/modules/web/Controllers/ConfigManagerController.php index f11c4c06..8b38559c 100644 --- a/app/modules/web/Controllers/ConfigManagerController.php +++ b/app/modules/web/Controllers/ConfigManagerController.php @@ -42,7 +42,7 @@ use SP\Services\Task\Task; use SP\Services\User\UserService; use SP\Services\UserGroup\UserGroupService; use SP\Services\UserProfile\UserProfileService; -use SP\Storage\Database\DBUtil; +use SP\Storage\Database\DatabaseUtil; use SP\Storage\Database\MySQLHandler; use SP\Util\Checks; use SP\Util\Util; @@ -331,7 +331,7 @@ class ConfigManagerController extends ControllerBase $template->setBase('config'); $template->addTemplate('info'); - $template->assign('dbInfo', DBUtil::getDBinfo($this->dic->get(MySQLHandler::class))); + $template->assign('dbInfo', DatabaseUtil::getDBinfo($this->dic->get(MySQLHandler::class))); $template->assign('dbName', $this->configData->getDbName() . '@' . $this->configData->getDbHost()); $template->assign('configBackupDate', date('r', $this->dic->get(ConfigService::class)->getByParam('config_backup_date', 0))); $template->assign('plugins', PluginUtil::getLoadedPlugins()); diff --git a/app/modules/web/Controllers/Helpers/Account/AccountActionsHelper.php b/app/modules/web/Controllers/Helpers/Account/AccountActionsHelper.php index d5ff8d95..1e681ddb 100644 --- a/app/modules/web/Controllers/Helpers/Account/AccountActionsHelper.php +++ b/app/modules/web/Controllers/Helpers/Account/AccountActionsHelper.php @@ -24,14 +24,14 @@ namespace SP\Modules\Web\Controllers\Helpers\Account; -use SP\Account\AccountAcl; -use SP\Account\AccountSearchItem; use SP\Core\Acl\Acl; use SP\Core\Acl\ActionsInterface; use SP\Core\UI\ThemeIcons; use SP\Html\DataGrid\DataGridAction; use SP\Html\DataGrid\DataGridActionType; use SP\Modules\Web\Controllers\Helpers\HelperBase; +use SP\Services\Account\AccountAcl; +use SP\Services\Account\AccountSearchItem; /** * Class AccountIconsHelper @@ -73,11 +73,12 @@ class AccountActionsHelper extends HelperBase /** * Set icons for view * - * @param AccountAcl $accountAcl - * @param AccountActionsDto $accountActionsDto + * @param \SP\Services\Account\AccountAcl $accountAcl + * @param AccountActionsDto $accountActionsDto + * * @return DataGridAction[] */ - public function getActionsForAccount(AccountAcl $accountAcl, AccountActionsDto $accountActionsDto) + public function getActionsForAccount(\SP\Services\Account\AccountAcl $accountAcl, AccountActionsDto $accountActionsDto) { $actions = []; @@ -248,8 +249,9 @@ class AccountActionsHelper extends HelperBase /** * Set icons for view * - * @param AccountAcl $accountAcl - * @param AccountActionsDto $accountActionsDto + * @param \SP\Services\Account\AccountAcl $accountAcl + * @param AccountActionsDto $accountActionsDto + * * @return DataGridAction[] */ public function getActionsGrouppedForAccount(AccountAcl $accountAcl, AccountActionsDto $accountActionsDto) @@ -417,7 +419,7 @@ class AccountActionsHelper extends HelperBase $action->setTitle(__('Ver Clave')); $action->addClass('btn-action'); $action->setIcon($this->icons->getIconViewPass()); - $action->setRuntimeFilter(AccountSearchItem::class, 'isShowViewPass'); + $action->setRuntimeFilter(\SP\Services\Account\AccountSearchItem::class, 'isShowViewPass'); $action->addData('action-route', Acl::getActionRoute(ActionsInterface::ACCOUNT_VIEW_PASS)); $action->addData('action-full', 1); $action->addData('action-sk', $this->sk); diff --git a/app/modules/web/Controllers/Helpers/Account/AccountHelper.php b/app/modules/web/Controllers/Helpers/Account/AccountHelper.php index ad376079..fe906f94 100644 --- a/app/modules/web/Controllers/Helpers/Account/AccountHelper.php +++ b/app/modules/web/Controllers/Helpers/Account/AccountHelper.php @@ -24,7 +24,6 @@ namespace SP\Modules\Web\Controllers\Helpers\Account; -use SP\Account\AccountAcl; use SP\Core\Acl\AccountPermissionException; use SP\Core\Acl\Acl; use SP\Core\Acl\ActionsInterface; @@ -37,6 +36,7 @@ use SP\Modules\Web\Controllers\Helpers\HelperBase; use SP\Modules\Web\Controllers\Traits\ItemTrait; use SP\Mvc\View\Components\SelectItemAdapter; use SP\Repositories\NoSuchItemException; +use SP\Services\Account\AccountAcl; use SP\Services\Account\AccountAclService; use SP\Services\Account\AccountHistoryService; use SP\Services\Account\AccountService; @@ -79,7 +79,7 @@ class AccountHelper extends HelperBase */ private $actionId; /** - * @var AccountAcl + * @var \SP\Services\Account\AccountAcl */ private $accountAcl; /** @@ -212,7 +212,7 @@ class AccountHelper extends HelperBase * * @param AccountDetailsResponse $accountDetailsResponse * - * @return AccountAcl + * @return \SP\Services\Account\AccountAcl * @throws AccountPermissionException * @throws \SP\Core\Exceptions\ConstraintException * @throws \SP\Core\Exceptions\QueryException @@ -297,7 +297,7 @@ class AccountHelper extends HelperBase public function setViewForBlank($actionId) { $this->actionId = $actionId; - $this->accountAcl = new AccountAcl($actionId); + $this->accountAcl = new \SP\Services\Account\AccountAcl($actionId); $this->checkActionAccess(); diff --git a/app/modules/web/Controllers/Helpers/Account/AccountHistoryHelper.php b/app/modules/web/Controllers/Helpers/Account/AccountHistoryHelper.php index 767af039..640f9ff9 100644 --- a/app/modules/web/Controllers/Helpers/Account/AccountHistoryHelper.php +++ b/app/modules/web/Controllers/Helpers/Account/AccountHistoryHelper.php @@ -24,7 +24,6 @@ namespace SP\Modules\Web\Controllers\Helpers\Account; -use SP\Account\AccountAcl; use SP\Core\Acl\AccountPermissionException; use SP\Core\Acl\Acl; use SP\Core\Acl\UnauthorizedPageException; @@ -33,6 +32,7 @@ use SP\DataModel\AccountHistoryData; use SP\DataModel\Dto\AccountAclDto; use SP\Modules\Web\Controllers\Helpers\HelperBase; use SP\Mvc\View\Components\SelectItemAdapter; +use SP\Services\Account\AccountAcl; use SP\Services\Account\AccountAclService; use SP\Services\Account\AccountHistoryService; use SP\Services\Category\CategoryService; diff --git a/app/modules/web/Controllers/Helpers/Account/AccountSearchHelper.php b/app/modules/web/Controllers/Helpers/Account/AccountSearchHelper.php index 04bb620e..eaa3298b 100644 --- a/app/modules/web/Controllers/Helpers/Account/AccountSearchHelper.php +++ b/app/modules/web/Controllers/Helpers/Account/AccountSearchHelper.php @@ -24,8 +24,6 @@ namespace SP\Modules\Web\Controllers\Helpers\Account; -use SP\Account\AccountSearchFilter; -use SP\Account\AccountSearchItem; use SP\Core\Acl\Acl; use SP\Core\Acl\ActionsInterface; use SP\Html\DataGrid\DataGrid; @@ -37,6 +35,8 @@ use SP\Html\DataGrid\DataGridPager; use SP\Html\DataGrid\DataGridSort; use SP\Modules\Web\Controllers\Helpers\HelperBase; use SP\Mvc\View\Components\SelectItemAdapter; +use SP\Services\Account\AccountSearchFilter; +use SP\Services\Account\AccountSearchItem; use SP\Services\Account\AccountSearchService; use SP\Services\Category\CategoryService; use SP\Services\Client\ClientService; @@ -66,7 +66,7 @@ class AccountSearchHelper extends HelperBase */ private $isAjax = false; /** - * @var AccountSearchFilter + * @var \SP\Services\Account\AccountSearchFilter */ private $accountSearchFilter; @@ -118,13 +118,13 @@ class AccountSearchHelper extends HelperBase AccountSearchItem::$accountLink = $userPreferences->isAccountLink(); AccountSearchItem::$topNavbar = $userPreferences->isTopNavbar(); - AccountSearchItem::$optionalActions = $userPreferences->isOptionalActions(); + \SP\Services\Account\AccountSearchItem::$optionalActions = $userPreferences->isOptionalActions(); AccountSearchItem::$wikiEnabled = $this->configData->isWikiEnabled(); AccountSearchItem::$dokuWikiEnabled = $this->configData->isDokuwikiEnabled(); - AccountSearchItem::$publicLinkEnabled = $this->configData->isPublinksEnabled(); + \SP\Services\Account\AccountSearchItem::$publicLinkEnabled = $this->configData->isPublinksEnabled(); AccountSearchItem::$isDemoMode = $this->configData->isDemoEnabled(); - if (AccountSearchItem::$wikiEnabled) { + if (\SP\Services\Account\AccountSearchItem::$wikiEnabled) { $wikiFilter = array_map(function ($value) { return preg_quote($value, '/'); }, $this->configData->getWikiFilter()); @@ -213,35 +213,35 @@ class AccountSearchHelper extends HelperBase $GridSortCustomer = new DataGridSort(); $GridSortCustomer->setName(__('Cliente')) ->setTitle(__('Ordenar por Cliente')) - ->setSortKey(AccountSearchFilter::SORT_CLIENT) + ->setSortKey(\SP\Services\Account\AccountSearchFilter::SORT_CLIENT) ->setIconUp($icons->getIconUp()) ->setIconDown($icons->getIconDown()); $GridSortName = new DataGridSort(); $GridSortName->setName(__('Nombre')) ->setTitle(__('Ordenar por Nombre')) - ->setSortKey(AccountSearchFilter::SORT_NAME) + ->setSortKey(\SP\Services\Account\AccountSearchFilter::SORT_NAME) ->setIconUp($icons->getIconUp()) ->setIconDown($icons->getIconDown()); $GridSortCategory = new DataGridSort(); $GridSortCategory->setName(__('Categoría')) ->setTitle(__('Ordenar por Categoría')) - ->setSortKey(AccountSearchFilter::SORT_CATEGORY) + ->setSortKey(\SP\Services\Account\AccountSearchFilter::SORT_CATEGORY) ->setIconUp($icons->getIconUp()) ->setIconDown($icons->getIconDown()); $GridSortLogin = new DataGridSort(); $GridSortLogin->setName(__('Usuario')) ->setTitle(__('Ordenar por Usuario')) - ->setSortKey(AccountSearchFilter::SORT_LOGIN) + ->setSortKey(\SP\Services\Account\AccountSearchFilter::SORT_LOGIN) ->setIconUp($icons->getIconUp()) ->setIconDown($icons->getIconDown()); $GridSortUrl = new DataGridSort(); $GridSortUrl->setName(__('URL / IP')) ->setTitle(__('Ordenar por URL / IP')) - ->setSortKey(AccountSearchFilter::SORT_URL) + ->setSortKey(\SP\Services\Account\AccountSearchFilter::SORT_URL) ->setIconUp($icons->getIconUp()) ->setIconDown($icons->getIconDown()); @@ -297,7 +297,7 @@ class AccountSearchHelper extends HelperBase /** * Set search filters * - * @return AccountSearchFilter + * @return \SP\Services\Account\AccountSearchFilter */ private function getFilters() { diff --git a/app/modules/web/Controllers/UserController.php b/app/modules/web/Controllers/UserController.php index 56c46fa4..25fb4c06 100644 --- a/app/modules/web/Controllers/UserController.php +++ b/app/modules/web/Controllers/UserController.php @@ -36,7 +36,7 @@ use SP\Modules\Web\Controllers\Traits\JsonTrait; use SP\Modules\Web\Forms\UserForm; use SP\Mvc\Controller\CrudControllerInterface; use SP\Mvc\View\Components\SelectItemAdapter; -use SP\Services\MailService; +use SP\Services\Mail\MailService; use SP\Services\User\UserService; use SP\Services\UserGroup\UserGroupService; use SP\Services\UserPassRecover\UserPassRecoverService; diff --git a/app/modules/web/Controllers/UserPassResetController.php b/app/modules/web/Controllers/UserPassResetController.php index c90a8091..dc7480d6 100644 --- a/app/modules/web/Controllers/UserPassResetController.php +++ b/app/modules/web/Controllers/UserPassResetController.php @@ -32,7 +32,7 @@ use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Helpers\LayoutHelper; use SP\Modules\Web\Controllers\Traits\JsonTrait; use SP\Repositories\Track\TrackRequest; -use SP\Services\MailService; +use SP\Services\Mail\MailService; use SP\Services\Track\TrackService; use SP\Services\User\UserService; use SP\Services\UserPassRecover\UserPassRecoverService; diff --git a/app/modules/web/Forms/AccountForm.php b/app/modules/web/Forms/AccountForm.php index ecf2e4bb..da7b2668 100644 --- a/app/modules/web/Forms/AccountForm.php +++ b/app/modules/web/Forms/AccountForm.php @@ -24,9 +24,9 @@ namespace SP\Modules\Web\Forms; -use SP\Account\AccountRequest; use SP\Core\Acl\ActionsInterface; use SP\Core\Exceptions\ValidationException; +use SP\Services\Account\AccountRequest; /** * Class AccountForm @@ -44,6 +44,7 @@ class AccountForm extends FormBase implements FormInterface * Validar el formulario * * @param $action + * * @return bool * @throws \SP\Core\Exceptions\ValidationException */ diff --git a/app/modules/web/Init.php b/app/modules/web/Init.php index 5f330771..1c0dd4a9 100644 --- a/app/modules/web/Init.php +++ b/app/modules/web/Init.php @@ -42,7 +42,7 @@ use SP\Services\Upgrade\UpgradeDatabaseService; use SP\Services\Upgrade\UpgradeUtil; use SP\Services\UserProfile\UserProfileService; use SP\Storage\Database\Database; -use SP\Storage\Database\DBUtil; +use SP\Storage\Database\DatabaseUtil; use SP\Util\HttpUtil; /** @@ -163,7 +163,7 @@ class Init extends ModuleBase } // Checks if the database is set up - if (!DBUtil::checkDatabaseExist($this->container->get(Database::class)->getDbHandler(), $this->configData->getDbName())) { + if (!DatabaseUtil::checkDatabaseExist($this->container->get(Database::class)->getDbHandler(), $this->configData->getDbName())) { $this->router->response() ->redirect('index.php?r=error/databaseError') ->send(); diff --git a/app/modules/web/themes/material-blue/views/account/account-history.inc b/app/modules/web/themes/material-blue/views/account/account-history.inc index e5aeda1e..7acec6d8 100644 --- a/app/modules/web/themes/material-blue/views/account/account-history.inc +++ b/app/modules/web/themes/material-blue/views/account/account-history.inc @@ -1,5 +1,5 @@ diff --git a/app/modules/web/themes/material-blue/views/account/account-permissions.inc b/app/modules/web/themes/material-blue/views/account/account-permissions.inc index 955dd773..d03a5ea5 100644 --- a/app/modules/web/themes/material-blue/views/account/account-permissions.inc +++ b/app/modules/web/themes/material-blue/views/account/account-permissions.inc @@ -1,8 +1,8 @@ diff --git a/app/modules/web/themes/material-blue/views/account/account.inc b/app/modules/web/themes/material-blue/views/account/account.inc index 840833d5..b74a6ab6 100644 --- a/app/modules/web/themes/material-blue/views/account/account.inc +++ b/app/modules/web/themes/material-blue/views/account/account.inc @@ -1,8 +1,8 @@ 0; diff --git a/app/modules/web/themes/material-blue/views/account/details.inc b/app/modules/web/themes/material-blue/views/account/details.inc index 6f4ea532..e92b24bf 100644 --- a/app/modules/web/themes/material-blue/views/account/details.inc +++ b/app/modules/web/themes/material-blue/views/account/details.inc @@ -1,5 +1,5 @@ diff --git a/app/modules/web/themes/material-blue/views/account/files.inc b/app/modules/web/themes/material-blue/views/account/files.inc index ec6e662a..d77ca557 100644 --- a/app/modules/web/themes/material-blue/views/account/files.inc +++ b/app/modules/web/themes/material-blue/views/account/files.inc @@ -1,7 +1,7 @@ diff --git a/app/modules/web/themes/material-blue/views/account/search-header.inc b/app/modules/web/themes/material-blue/views/account/search-header.inc index 47603027..1fa222f6 100644 --- a/app/modules/web/themes/material-blue/views/account/search-header.inc +++ b/app/modules/web/themes/material-blue/views/account/search-header.inc @@ -1,7 +1,7 @@ diff --git a/app/modules/web/themes/material-blue/views/account/search-index.inc b/app/modules/web/themes/material-blue/views/account/search-index.inc index 1018070f..2f5059f4 100644 --- a/app/modules/web/themes/material-blue/views/account/search-index.inc +++ b/app/modules/web/themes/material-blue/views/account/search-index.inc @@ -1,7 +1,7 @@ @@ -15,7 +15,7 @@ getDataHeaderTemplate(); ?> - +
* Returns an encoded string of the read data. * If nothing was read, it must return an empty string. @@ -91,6 +93,7 @@ class CryptSessionHandler extends \SessionHandler * Write session data * * @link http://php.net/manual/en/sessionhandler.write.php + * * @param string $id The session id. * @param string $data
* The encoded session data. This data is the @@ -99,6 +102,7 @@ class CryptSessionHandler extends \SessionHandler * string and passing it as this parameter. * Please note sessions use an alternative serialization method. *
+ * * @return bool* The return value (usually TRUE on success, FALSE on failure). * Note this value is returned internally to PHP for processing. diff --git a/lib/SP/Core/Crypt/Hash.php b/lib/SP/Core/Crypt/Hash.php index 93e65b24..59e5b617 100644 --- a/lib/SP/Core/Crypt/Hash.php +++ b/lib/SP/Core/Crypt/Hash.php @@ -29,7 +29,7 @@ namespace SP\Core\Crypt; * * @package SP\Core\Crypt */ -class Hash +final class Hash { /** * Longitud máxima aceptada para hashing @@ -41,6 +41,7 @@ class Hash * * @param string $key con la clave a comprobar * @param string $hash con el hash a comprobar + * * @return bool */ public static function checkHashKey($key, $hash) @@ -53,6 +54,7 @@ class Hash * * @param string $key * @param bool $isCheck Indica si la operación es de comprobación o no + * * @return string */ private static function getKey(&$key, $isCheck = true) @@ -72,6 +74,7 @@ class Hash * Generar un hash de una clave criptográficamente segura * * @param string $key con la clave a 'hashear' + * * @return string con el hash de la clave */ public static function hashKey($key) @@ -84,6 +87,7 @@ class Hash * * @param $message * @param $key + * * @return string */ public static function signMessage($message, $key) @@ -97,6 +101,7 @@ class Hash * @param $message * @param $key * @param $hash + * * @return bool */ public static function checkMessage($message, $key, $hash) diff --git a/lib/SP/Core/Crypt/OldCrypt.php b/lib/SP/Core/Crypt/OldCrypt.php index df181304..e0137d47 100644 --- a/lib/SP/Core/Crypt/OldCrypt.php +++ b/lib/SP/Core/Crypt/OldCrypt.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -33,8 +33,10 @@ defined('APP_ROOT') || die(); /** * Esta clase es la encargada de realizar el encriptado/desencriptado de claves + * + * @deprecated Since 2.1 */ -class OldCrypt +final class OldCrypt { public static $strInitialVector; @@ -43,6 +45,7 @@ class OldCrypt * * @param string $pwd con la clave a 'hashear' * @param bool $prefixSalt Añadir el salt al hash + * * @return string con el hash de la clave */ public static function mkHashPassword($pwd, $prefixSalt = true) @@ -58,6 +61,7 @@ class OldCrypt * * @param string $salt * @param bool $random + * * @return string con el salt creado */ public static function makeHashSalt($salt = null, $random = true) @@ -116,7 +120,8 @@ class OldCrypt * * @param string $customPwd con la clave a encriptar * @param string $masterPwd con la clave maestra - * @return string con la clave encriptada + * + * @return array con la clave encriptada */ public static function mkCustomMPassEncrypt($customPwd, $masterPwd) { @@ -132,6 +137,7 @@ class OldCrypt * @param string $strValue con los datos a encriptar * @param string $strPassword con la clave maestra * @param string $cryptIV con el IV + * * @return string con los datos encriptados */ private static function encrypt($strValue, $strPassword, $cryptIV) @@ -154,6 +160,7 @@ class OldCrypt * * @param mixed $data string Los datos a encriptar * @param string $pwd La clave de encriptación + * * @return array * @throws SPException */ @@ -201,6 +208,7 @@ class OldCrypt * * @param string $data con los datos a encriptar * @param string $masterPwd con la clave maestra + * * @return bool */ public static function mkEncrypt($data, $masterPwd) @@ -216,6 +224,7 @@ class OldCrypt * @param string $cryptData Los datos a desencriptar * @param string $cryptIV con el IV * @param string $password La clave maestra + * * @return string con los datos desencriptados */ public static function getDecrypt($cryptData, $cryptIV, $password) @@ -239,6 +248,7 @@ class OldCrypt * * @param string $string La cadena de la que deriva la key * @param null $salt El salt utilizado + * * @return string */ public static function generateAesKey($string, $salt = null) diff --git a/lib/SP/Core/Crypt/SecureKeyCookie.php b/lib/SP/Core/Crypt/SecureKeyCookie.php index 0d0b930b..fbff805b 100644 --- a/lib/SP/Core/Crypt/SecureKeyCookie.php +++ b/lib/SP/Core/Crypt/SecureKeyCookie.php @@ -33,7 +33,7 @@ use SP\Http\Request; * * @package SP\Core\Crypt */ -class SecureKeyCookie extends Cookie +final class SecureKeyCookie extends Cookie { /** * Nombre de la cookie @@ -51,7 +51,8 @@ class SecureKeyCookie extends Cookie * * @return SecureKeyCookie */ - public static function factory(Request $request) { + public static function factory(Request $request) + { return new self(self::COOKIE_NAME, $request); } diff --git a/lib/SP/Core/Crypt/Session.php b/lib/SP/Core/Crypt/Session.php index 0b6cb90a..03235005 100644 --- a/lib/SP/Core/Crypt/Session.php +++ b/lib/SP/Core/Crypt/Session.php @@ -31,12 +31,13 @@ use SP\Core\Context\SessionContext; * * @package SP\Core\Crypt */ -class Session +final class Session { /** * Devolver la clave maestra de la sesión * * @param SessionContext $sessionContext + * * @return string * @throws \Defuse\Crypto\Exception\CryptoException */ @@ -47,6 +48,7 @@ class Session /** * @param SessionContext $sessionContext + * * @return string */ private static function getKey(SessionContext $sessionContext) @@ -59,6 +61,7 @@ class Session * * @param $data * @param SessionContext $sessionContext + * * @throws \Defuse\Crypto\Exception\CryptoException */ public static function saveSessionKey($data, SessionContext $sessionContext) @@ -70,6 +73,7 @@ class Session * Regenerar la clave de sesión * * @param SessionContext $sessionContext + * * @throws \Defuse\Crypto\Exception\CryptoException */ public static function reKey(SessionContext $sessionContext) diff --git a/lib/SP/Core/Crypt/Vault.php b/lib/SP/Core/Crypt/Vault.php index 06b054db..8a94788e 100644 --- a/lib/SP/Core/Crypt/Vault.php +++ b/lib/SP/Core/Crypt/Vault.php @@ -29,7 +29,7 @@ namespace SP\Core\Crypt; * * @package SP\Core\Crypt */ -class Vault +final class Vault { /** * @var string diff --git a/lib/SP/Core/DataCollection.php b/lib/SP/Core/DataCollection.php index 84d25095..aa1d7a8f 100644 --- a/lib/SP/Core/DataCollection.php +++ b/lib/SP/Core/DataCollection.php @@ -61,9 +61,11 @@ abstract class DataCollection implements IteratorAggregate, ArrayAccess, Countab * Whether a offset exists * * @link http://php.net/manual/en/arrayaccess.offsetexists.php + * * @param mixed $offset
* An offset to check for. *
+ * * @return boolean true on success or false on failure. * *@@ -79,6 +81,7 @@ abstract class DataCollection implements IteratorAggregate, ArrayAccess, Countab * See if an attribute exists in the collection * * @param string $key The name of the parameter + * * @return boolean */ public function exists($key) @@ -91,9 +94,11 @@ abstract class DataCollection implements IteratorAggregate, ArrayAccess, Countab * Offset to retrieve * * @link http://php.net/manual/en/arrayaccess.offsetget.php + * * @param mixed $offset
* The offset to retrieve. *
+ * * @return mixed Can return all value types. * @since 5.0.0 */ @@ -109,6 +114,7 @@ abstract class DataCollection implements IteratorAggregate, ArrayAccess, Countab * * @param string $key The name of the parameter to return * @param mixed $default_val The default value of the parameter if it contains no value + * * @return mixed */ public function get($key, $default_val = null) @@ -124,12 +130,14 @@ abstract class DataCollection implements IteratorAggregate, ArrayAccess, Countab * Offset to set * * @link http://php.net/manual/en/arrayaccess.offsetset.php + * * @param mixed $offset* The offset to assign the value to. *
* @param mixed $value* The value to set. *
+ * * @return void * @since 5.0.0 */ @@ -143,6 +151,7 @@ abstract class DataCollection implements IteratorAggregate, ArrayAccess, Countab * * @param string $key The name of the parameter to set * @param mixed $value The value of the parameter to set + * * @return DataCollection */ public function set($key, $value) @@ -156,9 +165,11 @@ abstract class DataCollection implements IteratorAggregate, ArrayAccess, Countab * Offset to unset * * @link http://php.net/manual/en/arrayaccess.offsetunset.php + * * @param mixed $offset* The offset to unset. *
+ * * @return void * @since 5.0.0 */ @@ -171,6 +182,7 @@ abstract class DataCollection implements IteratorAggregate, ArrayAccess, Countab * Remove an attribute from the collection * * @param string $key The name of the parameter + * * @return void */ public function remove($key) @@ -209,6 +221,7 @@ abstract class DataCollection implements IteratorAggregate, ArrayAccess, Countab * Replace the collection's attributes * * @param array $attributes The attributes to replace the collection's with + * * @return DataCollection */ public function replace(array $attributes = array()) @@ -235,7 +248,9 @@ abstract class DataCollection implements IteratorAggregate, ArrayAccess, Countab * this instance while treating it as an instance property * * @see get() + * * @param string $key The name of the parameter to return + * * @return mixed */ public function __get($key) @@ -250,8 +265,10 @@ abstract class DataCollection implements IteratorAggregate, ArrayAccess, Countab * this instance while treating it as an instance property * * @see set() + * * @param string $key The name of the parameter to set * @param mixed $value The value of the parameter to set + * * @return void */ public function __set($key, $value) @@ -266,7 +283,9 @@ abstract class DataCollection implements IteratorAggregate, ArrayAccess, Countab * from this instance while treating it as an instance property * * @see exists() + * * @param string $key The name of the parameter + * * @return boolean */ public function __isset($key) @@ -281,7 +300,9 @@ abstract class DataCollection implements IteratorAggregate, ArrayAccess, Countab * this instance while treating it as an instance property * * @see remove() + * * @param string $key The name of the parameter + * * @return void */ public function __unset($key) diff --git a/lib/SP/Core/Dic/Container.php b/lib/SP/Core/Dic/Container.php index 11f25d19..594b59ec 100644 --- a/lib/SP/Core/Dic/Container.php +++ b/lib/SP/Core/Dic/Container.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -53,6 +53,7 @@ final class Container implements DicInterface * * @param string $name * @param callable $callable + * * @internal param callable|string $class */ public function share($name, $callable = null) @@ -65,6 +66,7 @@ final class Container implements DicInterface * * @param string $name * @param callable $callable + * * @internal param callable|string $class */ public function add($name, $callable = null) @@ -76,6 +78,7 @@ final class Container implements DicInterface * Inject object * * @param $context + * * @return mixed * @throws \Psr\Container\ContainerExceptionInterface */ @@ -156,6 +159,7 @@ final class Container implements DicInterface /** * @param $id + * * @return mixed * @throws ContainerExceptionInterface */ @@ -178,6 +182,7 @@ final class Container implements DicInterface /** * @param $id + * * @return mixed */ private function getSharedObject($id) diff --git a/lib/SP/Core/Dic/ContainerException.php b/lib/SP/Core/Dic/ContainerException.php index 9472204b..e084c32f 100644 --- a/lib/SP/Core/Dic/ContainerException.php +++ b/lib/SP/Core/Dic/ContainerException.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/Core/Dic/DicInterface.php b/lib/SP/Core/Dic/DicInterface.php index f33b88d1..4862b746 100644 --- a/lib/SP/Core/Dic/DicInterface.php +++ b/lib/SP/Core/Dic/DicInterface.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -53,6 +53,7 @@ interface DicInterface extends ContainerInterface * Inject object * * @param $context + * * @return mixed */ public function inject($context); diff --git a/lib/SP/Core/Dic/InjectableTrait.php b/lib/SP/Core/Dic/InjectableTrait.php index 89bc3009..47bcce94 100644 --- a/lib/SP/Core/Dic/InjectableTrait.php +++ b/lib/SP/Core/Dic/InjectableTrait.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/Core/Dic/Injector.php b/lib/SP/Core/Dic/Injector.php index 28397ff3..2519cd59 100644 --- a/lib/SP/Core/Dic/Injector.php +++ b/lib/SP/Core/Dic/Injector.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -40,6 +40,7 @@ class Injector * * @param ContainerInterface $container * @param $context + * * @return mixed * @throws ContainerException */ diff --git a/lib/SP/Core/Dic/NotFoundException.php b/lib/SP/Core/Dic/NotFoundException.php index a265bd5c..e7e6c269 100644 --- a/lib/SP/Core/Dic/NotFoundException.php +++ b/lib/SP/Core/Dic/NotFoundException.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/Core/Events/Event.php b/lib/SP/Core/Events/Event.php index 5c650997..70bf9640 100644 --- a/lib/SP/Core/Events/Event.php +++ b/lib/SP/Core/Events/Event.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -31,7 +31,7 @@ use InvalidArgumentException; * * @package SP\Core\Events */ -class Event +final class Event { /** * @var object @@ -45,8 +45,9 @@ class Event /** * Event constructor. * - * @param object $source + * @param object $source * @param EventMessage $eventMessage + * * @throws InvalidArgumentException */ public function __construct($source, EventMessage $eventMessage = null) diff --git a/lib/SP/Core/Events/EventDispatcher.php b/lib/SP/Core/Events/EventDispatcher.php index 782afe17..612698af 100644 --- a/lib/SP/Core/Events/EventDispatcher.php +++ b/lib/SP/Core/Events/EventDispatcher.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -29,7 +29,7 @@ namespace SP\Core\Events; * * @package SP\Core\EventDispatcher */ -class EventDispatcher extends EventDispatcherBase +final class EventDispatcher extends EventDispatcherBase { } \ No newline at end of file diff --git a/lib/SP/Core/Events/EventDispatcherInterface.php b/lib/SP/Core/Events/EventDispatcherInterface.php index 4d2f46ef..eadf4230 100644 --- a/lib/SP/Core/Events/EventDispatcherInterface.php +++ b/lib/SP/Core/Events/EventDispatcherInterface.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/Core/Events/EventMessage.php b/lib/SP/Core/Events/EventMessage.php index 4b753a11..f267c3ae 100644 --- a/lib/SP/Core/Events/EventMessage.php +++ b/lib/SP/Core/Events/EventMessage.php @@ -32,7 +32,7 @@ use SP\Html\Html; * * @package SP\Core\Events */ -class EventMessage implements MessageInterface +final class EventMessage implements MessageInterface { /** * @var array Detalles de la acción en formato "detalle : descripción" @@ -67,6 +67,7 @@ class EventMessage implements MessageInterface * Devuelve la descripción de la acción realizada en formato HTML * * @param bool $translate + * * @return string */ public function getHtmlDescription($translate = false) @@ -78,6 +79,7 @@ class EventMessage implements MessageInterface * Devuelve la descripción de la acción realizada * * @param bool $translate + * * @return string */ public function getDescription($translate = false) @@ -108,6 +110,7 @@ class EventMessage implements MessageInterface * * @param $key string * @param $value string + * * @return $this */ public function addDetailHtml($key, $value) @@ -122,6 +125,7 @@ class EventMessage implements MessageInterface * * @param $key string * @param $value string + * * @return $this */ public function addDetail($key, $value) @@ -141,6 +145,7 @@ class EventMessage implements MessageInterface * Formatear una cadena para guardarla en el registro * * @param $string string La cadena a formatear + * * @return string */ private function formatString($string) @@ -152,6 +157,7 @@ class EventMessage implements MessageInterface * Establece la descripción de la acción realizada en formato HTML * * @param string $description + * * @return $this */ public function addDescriptionHtml($description = '') @@ -165,6 +171,7 @@ class EventMessage implements MessageInterface * Establece la descripción de la acción realizada * * @param string $description + * * @return $this */ public function addDescription($description = '') @@ -188,6 +195,7 @@ class EventMessage implements MessageInterface * Componer un mensaje en formato texto * * @param string $delimiter + * * @return string */ public function composeText($delimiter = PHP_EOL) @@ -199,6 +207,7 @@ class EventMessage implements MessageInterface * Devuelve los detalles de la acción realizada * * @param bool $translate + * * @return string */ public function getDetails($translate = false) @@ -216,7 +225,8 @@ class EventMessage implements MessageInterface * Devolver un detalle formateado * * @param array $detail - * @param bool $translate + * @param bool $translate + * * @return string */ protected function formatDetail(array $detail, $translate = false) @@ -259,6 +269,7 @@ class EventMessage implements MessageInterface * Devuelve los detalles en formato HTML * * @param bool $translate + * * @return string */ public function getHtmlDetails($translate = false) @@ -292,7 +303,8 @@ class EventMessage implements MessageInterface /** * @param string $type - * @param mixed $data + * @param mixed $data + * * @return EventMessage */ public function addData($type, $data) diff --git a/lib/SP/Core/Events/EventReceiver.php b/lib/SP/Core/Events/EventReceiver.php index 291d4e8c..3655dfce 100644 --- a/lib/SP/Core/Events/EventReceiver.php +++ b/lib/SP/Core/Events/EventReceiver.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/Core/Exceptions/ConfigException.php b/lib/SP/Core/Exceptions/ConfigException.php index 1d31d065..489bb39e 100644 --- a/lib/SP/Core/Exceptions/ConfigException.php +++ b/lib/SP/Core/Exceptions/ConfigException.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -29,7 +29,7 @@ namespace SP\Core\Exceptions; * * @package SP\Core\Exceptions */ -class ConfigException extends SPException +final class ConfigException extends SPException { } \ No newline at end of file diff --git a/lib/SP/Core/Exceptions/ConstraintException.php b/lib/SP/Core/Exceptions/ConstraintException.php index f92ff658..83e10a3f 100644 --- a/lib/SP/Core/Exceptions/ConstraintException.php +++ b/lib/SP/Core/Exceptions/ConstraintException.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -29,7 +29,7 @@ namespace SP\Core\Exceptions; * * @package SP\Core\Exceptions */ -class ConstraintException extends SPException +final class ConstraintException extends SPException { } \ No newline at end of file diff --git a/lib/SP/Core/Exceptions/FileNotFoundException.php b/lib/SP/Core/Exceptions/FileNotFoundException.php index 06981423..8dc5a1e4 100644 --- a/lib/SP/Core/Exceptions/FileNotFoundException.php +++ b/lib/SP/Core/Exceptions/FileNotFoundException.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -29,7 +29,7 @@ namespace SP\Core\Exceptions; * * @package SP\Core\Exceptions */ -class FileNotFoundException extends SPException +final class FileNotFoundException extends SPException { } \ No newline at end of file diff --git a/lib/SP/Core/Exceptions/InitializationException.php b/lib/SP/Core/Exceptions/InitializationException.php index 5d6d3eab..dbbc0f50 100644 --- a/lib/SP/Core/Exceptions/InitializationException.php +++ b/lib/SP/Core/Exceptions/InitializationException.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -29,7 +29,7 @@ namespace SP\Core\Exceptions; * * @package SP\Core\Exceptions */ -class InitializationException extends SPException +final class InitializationException extends SPException { } \ No newline at end of file diff --git a/lib/SP/Core/Exceptions/InvalidArgumentException.php b/lib/SP/Core/Exceptions/InvalidArgumentException.php index c4c0644c..6dddf8b7 100644 --- a/lib/SP/Core/Exceptions/InvalidArgumentException.php +++ b/lib/SP/Core/Exceptions/InvalidArgumentException.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -29,7 +29,7 @@ namespace SP\Core\Exceptions; * * @package SP\Core\Exceptions */ -class InvalidArgumentException extends SPException +final class InvalidArgumentException extends SPException { - + } \ No newline at end of file diff --git a/lib/SP/Core/Exceptions/InvalidClassException.php b/lib/SP/Core/Exceptions/InvalidClassException.php index e15a34a1..ed297afe 100644 --- a/lib/SP/Core/Exceptions/InvalidClassException.php +++ b/lib/SP/Core/Exceptions/InvalidClassException.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -29,7 +29,7 @@ namespace SP\Core\Exceptions; * * @package SP\Core\Exceptions */ -class InvalidClassException extends SPException +final class InvalidClassException extends SPException { } \ No newline at end of file diff --git a/lib/SP/Core/Exceptions/InvalidImageException.php b/lib/SP/Core/Exceptions/InvalidImageException.php index 9f632ad3..3e50328d 100644 --- a/lib/SP/Core/Exceptions/InvalidImageException.php +++ b/lib/SP/Core/Exceptions/InvalidImageException.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -29,7 +29,7 @@ namespace SP\Core\Exceptions; * * @package SP\Core\Exceptions */ -class InvalidImageException extends SPException +final class InvalidImageException extends SPException { } \ No newline at end of file diff --git a/lib/SP/Core/Exceptions/ItemException.php b/lib/SP/Core/Exceptions/ItemException.php index 849ff8be..c20a23f1 100644 --- a/lib/SP/Core/Exceptions/ItemException.php +++ b/lib/SP/Core/Exceptions/ItemException.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -30,7 +30,7 @@ namespace SP\Core\Exceptions; * * @package SP\Core\Exceptions */ -class ItemException extends \Exception +final class ItemException extends \Exception { } \ No newline at end of file diff --git a/lib/SP/Core/Exceptions/QueryException.php b/lib/SP/Core/Exceptions/QueryException.php index bf03310f..5af44747 100644 --- a/lib/SP/Core/Exceptions/QueryException.php +++ b/lib/SP/Core/Exceptions/QueryException.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -29,7 +29,7 @@ namespace SP\Core\Exceptions; * * @package SP\Core\Exceptions */ -class QueryException extends SPException +final class QueryException extends SPException { } \ No newline at end of file diff --git a/lib/SP/Core/Exceptions/SPException.php b/lib/SP/Core/Exceptions/SPException.php index 48196ac9..844c7d66 100644 --- a/lib/SP/Core/Exceptions/SPException.php +++ b/lib/SP/Core/Exceptions/SPException.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -69,6 +69,7 @@ class SPException extends \Exception /** * @param $type + * * @return mixed */ public static function getExceptionTypeName($type) diff --git a/lib/SP/Core/Exceptions/ValidationException.php b/lib/SP/Core/Exceptions/ValidationException.php index 19d34ce7..ad216d20 100644 --- a/lib/SP/Core/Exceptions/ValidationException.php +++ b/lib/SP/Core/Exceptions/ValidationException.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -29,7 +29,7 @@ namespace SP\Core\Exceptions; * * @package SP\Core\Exceptions */ -class ValidationException extends \Exception +final class ValidationException extends \Exception { } \ No newline at end of file diff --git a/lib/SP/Core/ItemsTypeInterface.php b/lib/SP/Core/ItemsTypeInterface.php index ad6d6ec3..3e4d2f83 100644 --- a/lib/SP/Core/ItemsTypeInterface.php +++ b/lib/SP/Core/ItemsTypeInterface.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/Core/Language.php b/lib/SP/Core/Language.php index 820a48f0..90a95a07 100644 --- a/lib/SP/Core/Language.php +++ b/lib/SP/Core/Language.php @@ -37,7 +37,7 @@ defined('APP_ROOT') || die(); * * @package SP */ -class Language +final class Language { /** * Lenguaje del usuario diff --git a/lib/SP/Core/Messages/LogMessage.php b/lib/SP/Core/Messages/LogMessage.php index dd0c955c..aa8004e7 100644 --- a/lib/SP/Core/Messages/LogMessage.php +++ b/lib/SP/Core/Messages/LogMessage.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -31,7 +31,7 @@ use SP\Html\Html; * * @package SP\Core\Messages */ -class LogMessage extends MessageBase +final class LogMessage extends MessageBase { /** * @var string Acción realizada @@ -54,6 +54,7 @@ class LogMessage extends MessageBase * Devuelve la descripción de la acción realizada en formato HTML * * @param bool $translate + * * @return string */ public function getHtmlDescription($translate = false) @@ -65,6 +66,7 @@ class LogMessage extends MessageBase * Devuelve la descripción de la acción realizada * * @param bool $translate + * * @return string */ public function getDescription($translate = false) @@ -89,6 +91,7 @@ class LogMessage extends MessageBase * * @param $key string * @param $value string + * * @return $this */ public function addDetailsHtml($key, $value) @@ -103,6 +106,7 @@ class LogMessage extends MessageBase * * @param $key string * @param $value string + * * @return $this */ public function addDetails($key, $value) @@ -118,10 +122,23 @@ class LogMessage extends MessageBase return $this; } + /** + * Formatear una cadena para guardarla en el registro + * + * @param $string string La cadena a formatear + * + * @return string + */ + private function formatString($string) + { + return strip_tags($string); + } + /** * Establece la descripción de la acción realizada en formato HTML * * @param string $description + * * @return $this */ public function addDescriptionHtml($description = '') @@ -135,6 +152,7 @@ class LogMessage extends MessageBase * Establece la descripción de la acción realizada * * @param string $description + * * @return $this */ public function addDescription($description = '') @@ -159,6 +177,7 @@ class LogMessage extends MessageBase * Componer un mensaje en formato texto * * @param string $delimiter + * * @return string */ public function composeText($delimiter = PHP_EOL) @@ -174,6 +193,7 @@ class LogMessage extends MessageBase * Devuelve la acción realizada * * @param bool $translate + * * @return string */ public function getAction($translate = false) @@ -185,6 +205,7 @@ class LogMessage extends MessageBase * Establece la acción realizada * * @param string $action + * * @return $this */ public function setAction($action) @@ -194,21 +215,11 @@ class LogMessage extends MessageBase return $this; } - /** - * Formatear una cadena para guardarla en el registro - * - * @param $string string La cadena a formatear - * @return string - */ - private function formatString($string) - { - return strip_tags($string); - } - /** * Devuelve los detalles de la acción realizada * * @param bool $translate + * * @return string */ public function getDetails($translate = false) @@ -234,7 +245,8 @@ class LogMessage extends MessageBase * Devolver un detalle formateado * * @param array $detail - * @param bool $translate + * @param bool $translate + * * @return string */ protected function formatDetail(array $detail, $translate = false) @@ -289,6 +301,7 @@ class LogMessage extends MessageBase * Devuelve los detalles en formato HTML * * @param bool $translate + * * @return string */ public function getHtmlDetails($translate = false) diff --git a/lib/SP/Core/Messages/MailMessage.php b/lib/SP/Core/Messages/MailMessage.php index 25f69f3f..46656a30 100644 --- a/lib/SP/Core/Messages/MailMessage.php +++ b/lib/SP/Core/Messages/MailMessage.php @@ -29,7 +29,7 @@ namespace SP\Core\Messages; * * @package SP\Core\Messages */ -class MailMessage extends MessageBase implements MessageInterface +final class MailMessage extends MessageBase implements MessageInterface { /** * Adds a blank description line @@ -59,6 +59,7 @@ class MailMessage extends MessageBase implements MessageInterface * Componer un mensaje en formato texto * * @param string $delimiter + * * @return string */ public function composeText($delimiter = PHP_EOL) diff --git a/lib/SP/Core/Messages/MessageBase.php b/lib/SP/Core/Messages/MessageBase.php index d3e2f5b2..dde700b2 100644 --- a/lib/SP/Core/Messages/MessageBase.php +++ b/lib/SP/Core/Messages/MessageBase.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -62,6 +62,7 @@ abstract class MessageBase implements MessageInterface /** * @param string $title + * * @return MessageBase */ public function setTitle($title) @@ -81,6 +82,7 @@ abstract class MessageBase implements MessageInterface /** * @param array $description + * * @return MessageBase */ public function setDescription(array $description) @@ -92,6 +94,7 @@ abstract class MessageBase implements MessageInterface /** * @param string $description + * * @return MessageBase */ public function addDescription($description) @@ -111,6 +114,7 @@ abstract class MessageBase implements MessageInterface /** * @param array $footer + * * @return MessageBase */ public function setFooter(array $footer) diff --git a/lib/SP/Core/Messages/MessageInterface.php b/lib/SP/Core/Messages/MessageInterface.php index 92b15229..1530d711 100644 --- a/lib/SP/Core/Messages/MessageInterface.php +++ b/lib/SP/Core/Messages/MessageInterface.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -35,6 +35,7 @@ interface MessageInterface * Componer un mensaje en formato texto * * @param string $delimiter + * * @return string */ public function composeText($delimiter = PHP_EOL); diff --git a/lib/SP/Core/Messages/NotificationMessage.php b/lib/SP/Core/Messages/NotificationMessage.php index bcecaaf4..269c6377 100644 --- a/lib/SP/Core/Messages/NotificationMessage.php +++ b/lib/SP/Core/Messages/NotificationMessage.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -29,7 +29,7 @@ namespace SP\Core\Messages; * * @package SP\Core\Messages */ -class NotificationMessage extends MessageBase +final class NotificationMessage extends MessageBase { /** * Componer un mensaje en formato HTML @@ -51,6 +51,7 @@ class NotificationMessage extends MessageBase * Componer un mensaje en formato texto * * @param string $delimiter + * * @return string */ public function composeText($delimiter = PHP_EOL) diff --git a/lib/SP/Core/Messages/TaskMessage.php b/lib/SP/Core/Messages/TaskMessage.php index 4ac1ab0c..727ad43d 100644 --- a/lib/SP/Core/Messages/TaskMessage.php +++ b/lib/SP/Core/Messages/TaskMessage.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -31,7 +31,7 @@ use JsonSerializable; * * @package SP\Core\Messages */ -class TaskMessage implements MessageInterface, JsonSerializable +final class TaskMessage implements MessageInterface, JsonSerializable { /** * @var string @@ -80,6 +80,7 @@ class TaskMessage implements MessageInterface, JsonSerializable /** * @param string $task + * * @return TaskMessage */ public function setTask($task) @@ -99,6 +100,7 @@ class TaskMessage implements MessageInterface, JsonSerializable /** * @param string $message + * * @return TaskMessage */ public function setMessage($message) @@ -118,6 +120,7 @@ class TaskMessage implements MessageInterface, JsonSerializable /** * @param int $time + * * @return TaskMessage */ public function setTime($time) @@ -137,6 +140,7 @@ class TaskMessage implements MessageInterface, JsonSerializable /** * @param int $progress + * * @return TaskMessage */ public function setProgress($progress) @@ -156,6 +160,7 @@ class TaskMessage implements MessageInterface, JsonSerializable /** * @param int $end + * * @return TaskMessage */ public function setEnd($end) @@ -169,6 +174,7 @@ class TaskMessage implements MessageInterface, JsonSerializable * Componer un mensaje en formato texto * * @param string $delimiter + * * @return string */ public function composeText($delimiter = ';') @@ -231,6 +237,7 @@ class TaskMessage implements MessageInterface, JsonSerializable /** * @param string $taskId + * * @return TaskMessage */ public function setTaskId($taskId) diff --git a/lib/SP/Core/Plugin/PluginBase.php b/lib/SP/Core/Plugin/PluginBase.php index 0642870c..3d440073 100644 --- a/lib/SP/Core/Plugin/PluginBase.php +++ b/lib/SP/Core/Plugin/PluginBase.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/Core/Plugin/PluginDataStore.php b/lib/SP/Core/Plugin/PluginDataStore.php index 3c767546..3bc1ff2c 100644 --- a/lib/SP/Core/Plugin/PluginDataStore.php +++ b/lib/SP/Core/Plugin/PluginDataStore.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -39,6 +39,7 @@ class PluginDataStore * Guardar los datos de un plugin * * @param PluginInterface $Plugin + * * @throws \SP\Core\Exceptions\SPException */ public static function save(PluginInterface $Plugin) @@ -55,6 +56,7 @@ class PluginDataStore * Cargar los datos de un plugin * * @param PluginInterface $Plugin + * * @return bool * @throws \SP\Core\Exceptions\InvalidClassException * @throws \SP\Core\Exceptions\SPException diff --git a/lib/SP/Core/Plugin/PluginEventReceiver.php b/lib/SP/Core/Plugin/PluginEventReceiver.php index c1cb33c6..5c21e067 100644 --- a/lib/SP/Core/Plugin/PluginEventReceiver.php +++ b/lib/SP/Core/Plugin/PluginEventReceiver.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/Core/Plugin/PluginInterface.php b/lib/SP/Core/Plugin/PluginInterface.php index d323b52b..282c1bb7 100644 --- a/lib/SP/Core/Plugin/PluginInterface.php +++ b/lib/SP/Core/Plugin/PluginInterface.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/Core/Plugin/PluginUtil.php b/lib/SP/Core/Plugin/PluginUtil.php index 78b9c819..82228217 100644 --- a/lib/SP/Core/Plugin/PluginUtil.php +++ b/lib/SP/Core/Plugin/PluginUtil.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -84,6 +84,7 @@ class PluginUtil * Cargar un plugin * * @param string $name Nombre del plugin + * * @return bool|PluginInterface * @throws \SP\Core\Exceptions\SPException */ @@ -149,6 +150,7 @@ class PluginUtil * Obtener la información de un plugin * * @param string $name Nombre del plugin + * * @return bool|PluginInterface * @throws \SP\Core\Exceptions\SPException */ diff --git a/lib/SP/Core/SessionUtil.php b/lib/SP/Core/SessionUtil.php index 5784137d..5637d6fd 100644 --- a/lib/SP/Core/SessionUtil.php +++ b/lib/SP/Core/SessionUtil.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/Core/UI/Theme.php b/lib/SP/Core/UI/Theme.php index cf93b34b..60e10bac 100644 --- a/lib/SP/Core/UI/Theme.php +++ b/lib/SP/Core/UI/Theme.php @@ -30,8 +30,8 @@ use SP\Config\ConfigData; use SP\Core\Context\ContextInterface; use SP\Core\Context\SessionContext; use SP\Core\Exceptions\InvalidClassException; -use SP\Storage\FileCache; -use SP\Storage\FileException; +use SP\Storage\File\FileCache; +use SP\Storage\File\FileException; defined('APP_ROOT') || die(); @@ -40,7 +40,7 @@ defined('APP_ROOT') || die(); * * @package SP */ -class Theme implements ThemeInterface +final class Theme implements ThemeInterface { const ICONS_CACHE_FILE = CACHE_PATH . DIRECTORY_SEPARATOR . 'icons.cache'; /** @@ -105,6 +105,7 @@ class Theme implements ThemeInterface /** * @param bool $force + * * @throws InvalidClassException */ public function initialize($force = false) @@ -119,6 +120,7 @@ class Theme implements ThemeInterface * Inicializar el tema visual a utilizar * * @param bool $force Forzar la detección del tema para los inicios de sesión + * * @return void */ public function initTheme($force = false) diff --git a/lib/SP/Core/UI/ThemeIconsInterface.php b/lib/SP/Core/UI/ThemeIconsInterface.php index aa20af7d..da961c0a 100644 --- a/lib/SP/Core/UI/ThemeIconsInterface.php +++ b/lib/SP/Core/UI/ThemeIconsInterface.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/Core/UI/ThemeInterface.php b/lib/SP/Core/UI/ThemeInterface.php index b4d7236d..5eec553c 100644 --- a/lib/SP/Core/UI/ThemeInterface.php +++ b/lib/SP/Core/UI/ThemeInterface.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -33,6 +33,7 @@ interface ThemeInterface { /** * @param bool $force Forzar la detección del tema para los inicios de sesión + * * @return mixed */ public function initTheme($force = false); diff --git a/lib/SP/DataModel/AccountData.php b/lib/SP/DataModel/AccountData.php index 2939f807..ff68b034 100644 --- a/lib/SP/DataModel/AccountData.php +++ b/lib/SP/DataModel/AccountData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/AccountExtData.php b/lib/SP/DataModel/AccountExtData.php index 0b1cb480..d91ef95a 100644 --- a/lib/SP/DataModel/AccountExtData.php +++ b/lib/SP/DataModel/AccountExtData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/AccountHistoryData.php b/lib/SP/DataModel/AccountHistoryData.php index a722071f..2dcc6c3b 100644 --- a/lib/SP/DataModel/AccountHistoryData.php +++ b/lib/SP/DataModel/AccountHistoryData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/AccountToUserGroupData.php b/lib/SP/DataModel/AccountToUserGroupData.php index ad56cb74..c13c234f 100644 --- a/lib/SP/DataModel/AccountToUserGroupData.php +++ b/lib/SP/DataModel/AccountToUserGroupData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/AccountVData.php b/lib/SP/DataModel/AccountVData.php index e88da3bf..8738742c 100644 --- a/lib/SP/DataModel/AccountVData.php +++ b/lib/SP/DataModel/AccountVData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/ActionData.php b/lib/SP/DataModel/ActionData.php index a761e9ac..6e6fb479 100644 --- a/lib/SP/DataModel/ActionData.php +++ b/lib/SP/DataModel/ActionData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/AuthTokenData.php b/lib/SP/DataModel/AuthTokenData.php index 944689dd..77a5416c 100644 --- a/lib/SP/DataModel/AuthTokenData.php +++ b/lib/SP/DataModel/AuthTokenData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -161,7 +161,7 @@ class AuthTokenData extends DataModelBase implements DataModelInterface { $this->startDate = (int)$startDate; } - + /** * @return string */ diff --git a/lib/SP/DataModel/CategoryData.php b/lib/SP/DataModel/CategoryData.php index b5440461..a0825dbb 100644 --- a/lib/SP/DataModel/CategoryData.php +++ b/lib/SP/DataModel/CategoryData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -74,6 +74,7 @@ class CategoryData extends DataModelBase implements DataModelInterface /** * @param int $id + * * @return $this */ public function setId($id) diff --git a/lib/SP/DataModel/ClientData.php b/lib/SP/DataModel/ClientData.php index 656cf63c..6cb849ec 100644 --- a/lib/SP/DataModel/ClientData.php +++ b/lib/SP/DataModel/ClientData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/ConfigData.php b/lib/SP/DataModel/ConfigData.php index 75bb9869..297a55d1 100644 --- a/lib/SP/DataModel/ConfigData.php +++ b/lib/SP/DataModel/ConfigData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/CustomFieldBaseData.php b/lib/SP/DataModel/CustomFieldBaseData.php index ad63c596..59304c12 100644 --- a/lib/SP/DataModel/CustomFieldBaseData.php +++ b/lib/SP/DataModel/CustomFieldBaseData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/CustomFieldDefinitionData.php b/lib/SP/DataModel/CustomFieldDefinitionData.php index 2df5fbef..d9e2f63a 100644 --- a/lib/SP/DataModel/CustomFieldDefinitionData.php +++ b/lib/SP/DataModel/CustomFieldDefinitionData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/CustomFieldTypeData.php b/lib/SP/DataModel/CustomFieldTypeData.php index d84453dd..a0187447 100644 --- a/lib/SP/DataModel/CustomFieldTypeData.php +++ b/lib/SP/DataModel/CustomFieldTypeData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/DataModelBase.php b/lib/SP/DataModel/DataModelBase.php index a53f1ffb..da1a8a54 100644 --- a/lib/SP/DataModel/DataModelBase.php +++ b/lib/SP/DataModel/DataModelBase.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/DataModelInterface.php b/lib/SP/DataModel/DataModelInterface.php index 95e540e9..1941a7b7 100644 --- a/lib/SP/DataModel/DataModelInterface.php +++ b/lib/SP/DataModel/DataModelInterface.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/Dto/AccountSearchResponse.php b/lib/SP/DataModel/Dto/AccountSearchResponse.php index e881efee..3014c52d 100644 --- a/lib/SP/DataModel/Dto/AccountSearchResponse.php +++ b/lib/SP/DataModel/Dto/AccountSearchResponse.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/Dto/ConfigRequest.php b/lib/SP/DataModel/Dto/ConfigRequest.php index 56d642d0..cbd10c9f 100644 --- a/lib/SP/DataModel/Dto/ConfigRequest.php +++ b/lib/SP/DataModel/Dto/ConfigRequest.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -48,6 +48,7 @@ class ConfigRequest /** * @param $param + * * @return mixed|null */ public function get($param) diff --git a/lib/SP/DataModel/FileData.php b/lib/SP/DataModel/FileData.php index c2bf8d85..78e7572a 100644 --- a/lib/SP/DataModel/FileData.php +++ b/lib/SP/DataModel/FileData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/FileExtData.php b/lib/SP/DataModel/FileExtData.php index b4a7d2b1..3ea8f866 100644 --- a/lib/SP/DataModel/FileExtData.php +++ b/lib/SP/DataModel/FileExtData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/ItemData.php b/lib/SP/DataModel/ItemData.php index bcd6d97d..56fffce7 100644 --- a/lib/SP/DataModel/ItemData.php +++ b/lib/SP/DataModel/ItemData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/ItemSearchData.php b/lib/SP/DataModel/ItemSearchData.php index bf37df6e..a2c180d0 100644 --- a/lib/SP/DataModel/ItemSearchData.php +++ b/lib/SP/DataModel/ItemSearchData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -23,6 +23,7 @@ */ namespace SP\DataModel; + use SP\Util\Filter; diff --git a/lib/SP/DataModel/NotificationData.php b/lib/SP/DataModel/NotificationData.php index 43434c43..8b929b45 100644 --- a/lib/SP/DataModel/NotificationData.php +++ b/lib/SP/DataModel/NotificationData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/PluginData.php b/lib/SP/DataModel/PluginData.php index 5189a13a..410610fe 100644 --- a/lib/SP/DataModel/PluginData.php +++ b/lib/SP/DataModel/PluginData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/TagData.php b/lib/SP/DataModel/TagData.php index aad3f451..fe3995b8 100644 --- a/lib/SP/DataModel/TagData.php +++ b/lib/SP/DataModel/TagData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/TrackData.php b/lib/SP/DataModel/TrackData.php index b20c2c00..3d22c0a0 100644 --- a/lib/SP/DataModel/TrackData.php +++ b/lib/SP/DataModel/TrackData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -140,6 +140,7 @@ class TrackData extends DataModelBase /** * @param string $track_ip + * * @throws \SP\Core\Exceptions\InvalidArgumentException */ public function setTrackIp($track_ip) diff --git a/lib/SP/DataModel/UserData.php b/lib/SP/DataModel/UserData.php index 59321b93..c1f19433 100644 --- a/lib/SP/DataModel/UserData.php +++ b/lib/SP/DataModel/UserData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -381,7 +381,7 @@ class UserData extends UserPassData implements DataModelInterface { $this->userGroupName = $userGroupName; } - + /** * @return bool */ diff --git a/lib/SP/DataModel/UserGroupData.php b/lib/SP/DataModel/UserGroupData.php index dd641955..a2b3fa24 100644 --- a/lib/SP/DataModel/UserGroupData.php +++ b/lib/SP/DataModel/UserGroupData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/UserLoginData.php b/lib/SP/DataModel/UserLoginData.php index d6fa71b7..d73274f6 100644 --- a/lib/SP/DataModel/UserLoginData.php +++ b/lib/SP/DataModel/UserLoginData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/UserPassData.php b/lib/SP/DataModel/UserPassData.php index aeb1436b..c2469599 100644 --- a/lib/SP/DataModel/UserPassData.php +++ b/lib/SP/DataModel/UserPassData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/UserPassRecoverData.php b/lib/SP/DataModel/UserPassRecoverData.php index 5ed0d577..08769eb7 100644 --- a/lib/SP/DataModel/UserPassRecoverData.php +++ b/lib/SP/DataModel/UserPassRecoverData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -111,5 +111,5 @@ class UserPassRecoverData extends DataModelBase { $this->used = (int)$used; } - + } \ No newline at end of file diff --git a/lib/SP/DataModel/UserPreferencesData.php b/lib/SP/DataModel/UserPreferencesData.php index efa0977a..d2ff3690 100644 --- a/lib/SP/DataModel/UserPreferencesData.php +++ b/lib/SP/DataModel/UserPreferencesData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/UserProfileData.php b/lib/SP/DataModel/UserProfileData.php index c35fa1c5..0bff5275 100644 --- a/lib/SP/DataModel/UserProfileData.php +++ b/lib/SP/DataModel/UserProfileData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/DataModel/UserToUserGroupData.php b/lib/SP/DataModel/UserToUserGroupData.php index f653ec63..7f7f7436 100644 --- a/lib/SP/DataModel/UserToUserGroupData.php +++ b/lib/SP/DataModel/UserToUserGroupData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/Html/Assets/FontIcon.php b/lib/SP/Html/Assets/FontIcon.php index 4a78a0c4..bfc0be1a 100644 --- a/lib/SP/Html/Assets/FontIcon.php +++ b/lib/SP/Html/Assets/FontIcon.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -31,7 +31,7 @@ defined('APP_ROOT') || die(); * * @package SP\Html\Assets */ -class FontIcon extends IconBase +final class FontIcon extends IconBase { /** * @param string $icon diff --git a/lib/SP/Html/Assets/IconBase.php b/lib/SP/Html/Assets/IconBase.php index 0173d075..cd0de1cb 100644 --- a/lib/SP/Html/Assets/IconBase.php +++ b/lib/SP/Html/Assets/IconBase.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -63,6 +63,7 @@ abstract class IconBase implements IconInterface /** * @param $title + * * @return $this */ public function setTitle($title) @@ -82,6 +83,7 @@ abstract class IconBase implements IconInterface /** * @param $class + * * @return $this */ public function setClass($class) @@ -101,6 +103,7 @@ abstract class IconBase implements IconInterface /** * @param $icon + * * @return $this */ public function setIcon($icon) diff --git a/lib/SP/Html/Assets/IconInterface.php b/lib/SP/Html/Assets/IconInterface.php index bb1dc625..b2f17fa3 100644 --- a/lib/SP/Html/Assets/IconInterface.php +++ b/lib/SP/Html/Assets/IconInterface.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/Html/Assets/ImageIcon.php b/lib/SP/Html/Assets/ImageIcon.php index ee3301ce..296f5c55 100644 --- a/lib/SP/Html/Assets/ImageIcon.php +++ b/lib/SP/Html/Assets/ImageIcon.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -31,7 +31,7 @@ defined('APP_ROOT') || die(); * * @package SP\Html\Assets */ -class ImageIcon extends IconBase +final class ImageIcon extends IconBase { /** * @param string $icon diff --git a/lib/SP/Html/DataGrid/DataGrid.php b/lib/SP/Html/DataGrid/DataGrid.php index 4533ccee..cd1943a9 100644 --- a/lib/SP/Html/DataGrid/DataGrid.php +++ b/lib/SP/Html/DataGrid/DataGrid.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -31,7 +31,7 @@ defined('APP_ROOT') || die(); * * @package SP\Html\DataGrid */ -class DataGrid extends DataGridBase +final class DataGrid extends DataGridBase { /** * Título de la pestaña @@ -40,8 +40,17 @@ class DataGrid extends DataGridBase */ private $_title = ''; + /** + * @return string + */ + public function getTitle() + { + return $this->_title; + } + /** * @param $title string + * * @return DataGrid */ public function setTitle($title) @@ -50,12 +59,4 @@ class DataGrid extends DataGridBase return $this; } - - /** - * @return string - */ - public function getTitle() - { - return $this->_title; - } } \ No newline at end of file diff --git a/lib/SP/Html/DataGrid/DataGridAction.php b/lib/SP/Html/DataGrid/DataGridAction.php index efdadc49..0a17c18e 100644 --- a/lib/SP/Html/DataGrid/DataGridAction.php +++ b/lib/SP/Html/DataGrid/DataGridAction.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -31,7 +31,7 @@ defined('APP_ROOT') || die(); * * @package SP\Html\DataGrid */ -class DataGridAction extends DataGridActionBase +final class DataGridAction extends DataGridActionBase { } \ No newline at end of file diff --git a/lib/SP/Html/DataGrid/DataGridActionBase.php b/lib/SP/Html/DataGrid/DataGridActionBase.php index 2801a91b..b4f3ed75 100644 --- a/lib/SP/Html/DataGrid/DataGridActionBase.php +++ b/lib/SP/Html/DataGrid/DataGridActionBase.php @@ -143,6 +143,7 @@ abstract class DataGridActionBase implements DataGridActionInterface * * @param string $class * @param string $method + * * @throws \RuntimeException * @return $this */ @@ -170,6 +171,7 @@ abstract class DataGridActionBase implements DataGridActionInterface /** * @param $name string + * * @return $this */ public function setName($name) @@ -189,6 +191,7 @@ abstract class DataGridActionBase implements DataGridActionInterface /** * @param int $id + * * @return $this */ public function setId($id) @@ -208,6 +211,7 @@ abstract class DataGridActionBase implements DataGridActionInterface /** * @param $title string + * * @return $this */ public function setTitle($title) @@ -219,6 +223,7 @@ abstract class DataGridActionBase implements DataGridActionInterface /** * @param $function string + * * @return $this */ public function setOnClickFunction($function) @@ -230,6 +235,7 @@ abstract class DataGridActionBase implements DataGridActionInterface /** * @param $args string + * * @return $this */ public function setOnClickArgs($args) @@ -263,6 +269,7 @@ abstract class DataGridActionBase implements DataGridActionInterface /** * @param $icon IconInterface + * * @return $this */ public function setIcon($icon) @@ -274,6 +281,7 @@ abstract class DataGridActionBase implements DataGridActionInterface /** * @param $skip bool + * * @return $this */ public function setSkip($skip) @@ -301,6 +309,7 @@ abstract class DataGridActionBase implements DataGridActionInterface /** * @param bool $helper + * * @return $this */ public function setIsHelper($helper) @@ -323,6 +332,7 @@ abstract class DataGridActionBase implements DataGridActionInterface * * @param $rowSource string * @param mixed $value Valor a filtrar + * * @return $this */ public function setFilterRowSource($rowSource, $value = 1) @@ -342,6 +352,7 @@ abstract class DataGridActionBase implements DataGridActionInterface /** * @param int $type El tipo de acción definido en DataGridActionType + * * @return $this */ public function setType($type) @@ -361,6 +372,7 @@ abstract class DataGridActionBase implements DataGridActionInterface /** * @param array $data Los datos de los atributos + * * @return $this */ public function setData(array $data) @@ -375,6 +387,7 @@ abstract class DataGridActionBase implements DataGridActionInterface * * @param string $name El nombe del atributo * @param mixed $data Los datos del atributo + * * @return $this */ public function addData($name, $data) @@ -396,6 +409,7 @@ abstract class DataGridActionBase implements DataGridActionInterface * Establecer atributos * * @param array $attributes Los datos de los atributos + * * @return $this */ public function setAttributes(array $attributes) @@ -410,6 +424,7 @@ abstract class DataGridActionBase implements DataGridActionInterface * * @param string $name El nombe del atributo * @param mixed $value + * * @return $this */ public function addAttribute($name, $value) @@ -453,6 +468,7 @@ abstract class DataGridActionBase implements DataGridActionInterface * Adds a new class * * @param mixed $value + * * @return $this */ public function addClass($value) diff --git a/lib/SP/Html/DataGrid/DataGridActionInterface.php b/lib/SP/Html/DataGrid/DataGridActionInterface.php index a17d3db1..f47d64cd 100644 --- a/lib/SP/Html/DataGrid/DataGridActionInterface.php +++ b/lib/SP/Html/DataGrid/DataGridActionInterface.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -113,6 +113,7 @@ interface DataGridActionInterface /** * @param $rowSource string * @param mixed $value Valor a filtrar + * * @return */ public function setFilterRowSource($rowSource, $value = 1); @@ -141,6 +142,7 @@ interface DataGridActionInterface * Establecer atributos de datos * * @param array $data Los datos de los atributos + * * @return $this */ public function setData(array $data); @@ -162,6 +164,7 @@ interface DataGridActionInterface * Establecer atributos * * @param array $attributes Los datos de los atributos + * * @return $this */ public function setAttributes(array $attributes); @@ -186,6 +189,7 @@ interface DataGridActionInterface * * @param string $class * @param string $method + * * @return $this */ public function setRuntimeFilter($class, $method); @@ -215,6 +219,7 @@ interface DataGridActionInterface * Adds a new class * * @param mixed $value + * * @return $this */ public function addClass($value); diff --git a/lib/SP/Html/DataGrid/DataGridActionSearch.php b/lib/SP/Html/DataGrid/DataGridActionSearch.php index 28049ca1..4d393c2b 100644 --- a/lib/SP/Html/DataGrid/DataGridActionSearch.php +++ b/lib/SP/Html/DataGrid/DataGridActionSearch.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -31,7 +31,7 @@ defined('APP_ROOT') || die(); * * @package SP\Html\DataGrid */ -class DataGridActionSearch extends DataGridActionBase +final class DataGridActionSearch extends DataGridActionBase { /** * @var string diff --git a/lib/SP/Html/DataGrid/DataGridActionType.php b/lib/SP/Html/DataGrid/DataGridActionType.php index f51c87be..c23b714d 100644 --- a/lib/SP/Html/DataGrid/DataGridActionType.php +++ b/lib/SP/Html/DataGrid/DataGridActionType.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -31,7 +31,7 @@ defined('APP_ROOT') || die(); * * @package SP\Html\DataGrid */ -class DataGridActionType +final class DataGridActionType { const MENUBAR_ITEM = 1; const VIEW_ITEM = 2; diff --git a/lib/SP/Html/DataGrid/DataGridBase.php b/lib/SP/Html/DataGrid/DataGridBase.php index 5d18a5af..d499ab30 100644 --- a/lib/SP/Html/DataGrid/DataGridBase.php +++ b/lib/SP/Html/DataGrid/DataGridBase.php @@ -150,6 +150,7 @@ abstract class DataGridBase implements DataGridInterface /** * @param \SP\Core\Acl\ActionsInterface $action + * * @return $this */ public function setOnCloseAction(ActionsInterface $action) @@ -169,6 +170,7 @@ abstract class DataGridBase implements DataGridInterface /** * @param $id string + * * @return $this */ public function setId($id) @@ -188,6 +190,7 @@ abstract class DataGridBase implements DataGridInterface /** * @param DataGridHeaderInterface $header + * * @return $this */ public function setHeader(DataGridHeaderInterface $header) @@ -207,6 +210,7 @@ abstract class DataGridBase implements DataGridInterface /** * @param DataGridDataInterface $data + * * @return $this */ public function setData(DataGridDataInterface $data) @@ -218,7 +222,8 @@ abstract class DataGridBase implements DataGridInterface /** * @param DataGridActionInterface $action - * @param bool $isMenu Añadir al menu de acciones + * @param bool $isMenu Añadir al menu de acciones + * * @return $this */ public function setDataActions(DataGridActionInterface $action, $isMenu = false) @@ -268,7 +273,8 @@ abstract class DataGridBase implements DataGridInterface * Establecer la plantilla utilizada para la cabecera * * @param string $template El nombre de la plantilla a utilizar - * @param string $base Directorio base para la plantilla + * @param string $base Directorio base para la plantilla + * * @return $this */ public function setDataHeaderTemplate($template, $base = null) @@ -287,6 +293,7 @@ abstract class DataGridBase implements DataGridInterface * * @param $template * @param null $base + * * @return string * @throws FileNotFoundException */ @@ -316,6 +323,7 @@ abstract class DataGridBase implements DataGridInterface * Establecer la plantilla utilizada para las acciones * * @param string $template El nombre de la plantilla a utilizar + * * @return $this */ public function setDataActionsTemplate($template) @@ -343,7 +351,8 @@ abstract class DataGridBase implements DataGridInterface * Establecer la plantilla utilizada para el paginador * * @param string $template El nombre de la plantilla a utilizar - * @param string $base Directorio base para la plantilla + * @param string $base Directorio base para la plantilla + * * @return $this */ public function setDataPagerTemplate($template, $base = null) @@ -369,7 +378,8 @@ abstract class DataGridBase implements DataGridInterface /** * @param string $template El nombre de la plantilla a utilizar - * @param string $base Directorio base para la plantilla + * @param string $base Directorio base para la plantilla + * * @return mixed */ public function setDataRowTemplate($template, $base = null) @@ -405,6 +415,7 @@ abstract class DataGridBase implements DataGridInterface * Establecer el paginador * * @param DataGridPagerInterface $pager + * * @return $this */ public function setPager(DataGridPagerInterface $pager) @@ -436,6 +447,7 @@ abstract class DataGridBase implements DataGridInterface /** * @param int $time + * * @return $this */ public function setTime($time) @@ -459,6 +471,7 @@ abstract class DataGridBase implements DataGridInterface * Devolver las acciones filtradas * * @param $filter + * * @return DataGridActionInterface[] */ public function getDataActionsFiltered($filter) @@ -478,6 +491,7 @@ abstract class DataGridBase implements DataGridInterface * Devolver las acciones de menu filtradas * * @param $filter + * * @return DataGridActionInterface[] */ public function getDataActionsMenuFiltered($filter) @@ -504,6 +518,7 @@ abstract class DataGridBase implements DataGridInterface /** * @param $template * @param null $base + * * @return DataGridBase */ public function setDataTableTemplate($template, $base = null) diff --git a/lib/SP/Html/DataGrid/DataGridData.php b/lib/SP/Html/DataGrid/DataGridData.php index ec106bc6..1df7f58f 100644 --- a/lib/SP/Html/DataGrid/DataGridData.php +++ b/lib/SP/Html/DataGrid/DataGridData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -31,7 +31,7 @@ defined('APP_ROOT') || die(); * * @package SP\Html\DataGrid */ -class DataGridData extends DataGridDataBase +final class DataGridData extends DataGridDataBase { } \ No newline at end of file diff --git a/lib/SP/Html/DataGrid/DataGridDataInterface.php b/lib/SP/Html/DataGrid/DataGridDataInterface.php index 1eeab63c..25808eb1 100644 --- a/lib/SP/Html/DataGrid/DataGridDataInterface.php +++ b/lib/SP/Html/DataGrid/DataGridDataInterface.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -39,8 +39,8 @@ interface DataGridDataInterface /** * Establecer los orígenes de datos de la consulta * - * @param string $source - * @param bool $isMethod + * @param string $source + * @param bool $isMethod * @param callable|null $filter */ public function addDataRowSource($source, $isMethod = false, callable $filter = null); @@ -86,6 +86,7 @@ interface DataGridDataInterface * @param $source string * @param $icon IconInterface * @param mixed $value Valor para mostrar el icono + * * @return */ public function addDataRowSourceWithIcon($source, IconInterface $icon, $value = 1); diff --git a/lib/SP/Html/DataGrid/DataGridHeader.php b/lib/SP/Html/DataGrid/DataGridHeader.php index a3a78646..8065eb9d 100644 --- a/lib/SP/Html/DataGrid/DataGridHeader.php +++ b/lib/SP/Html/DataGrid/DataGridHeader.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -31,7 +31,7 @@ defined('APP_ROOT') || die(); * * @package SP\Html\DataGrid */ -class DataGridHeader extends DataGridHeaderBase +final class DataGridHeader extends DataGridHeaderBase { } \ No newline at end of file diff --git a/lib/SP/Html/DataGrid/DataGridHeaderBase.php b/lib/SP/Html/DataGrid/DataGridHeaderBase.php index 56aca157..04724bcf 100644 --- a/lib/SP/Html/DataGrid/DataGridHeaderBase.php +++ b/lib/SP/Html/DataGrid/DataGridHeaderBase.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/Html/DataGrid/DataGridHeaderInterface.php b/lib/SP/Html/DataGrid/DataGridHeaderInterface.php index caa9c6e0..019e83dc 100644 --- a/lib/SP/Html/DataGrid/DataGridHeaderInterface.php +++ b/lib/SP/Html/DataGrid/DataGridHeaderInterface.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/Html/DataGrid/DataGridHeaderSort.php b/lib/SP/Html/DataGrid/DataGridHeaderSort.php index 95e27ac1..475567fd 100644 --- a/lib/SP/Html/DataGrid/DataGridHeaderSort.php +++ b/lib/SP/Html/DataGrid/DataGridHeaderSort.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -33,12 +33,16 @@ use SplObjectStorage; * * @package SP\Html\DataGrid */ -class DataGridHeaderSort extends DataGridHeaderBase +final class DataGridHeaderSort extends DataGridHeaderBase { - /** @var DataGridActionInterface[] */ + /** + * @var DataGridActionInterface[] + */ private $_actions; - /** @var DataGridSortInterface[] */ + /** + * @var DataGridSortInterface[] + */ private $_sortFields; /** @@ -71,6 +75,7 @@ class DataGridHeaderSort extends DataGridHeaderBase /** * @param DataGridSortInterface $field + * * @return $this */ public function addSortField($field) diff --git a/lib/SP/Html/DataGrid/DataGridInterface.php b/lib/SP/Html/DataGrid/DataGridInterface.php index 1a7aaba0..3a5b9f7e 100644 --- a/lib/SP/Html/DataGrid/DataGridInterface.php +++ b/lib/SP/Html/DataGrid/DataGridInterface.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -67,7 +67,8 @@ interface DataGridInterface /** * @param DataGridActionInterface $action - * @param bool $isMenu Añadir al menu de acciones + * @param bool $isMenu Añadir al menu de acciones + * * @return $this */ public function setDataActions(DataGridActionInterface $action, $isMenu = false); @@ -182,6 +183,7 @@ interface DataGridInterface * Devolver las acciones filtradas * * @param $filter + * * @return DataGridActionInterface[] */ public function getDataActionsFiltered($filter); @@ -190,12 +192,14 @@ interface DataGridInterface * Devolver las acciones de menu filtradas * * @param $filter + * * @return DataGridActionInterface[] */ public function getDataActionsMenuFiltered($filter); /** * Actualizar los datos del paginador + * * @return static */ public function updatePager(); diff --git a/lib/SP/Html/DataGrid/DataGridPager.php b/lib/SP/Html/DataGrid/DataGridPager.php index 9f71c0b2..0a2be423 100644 --- a/lib/SP/Html/DataGrid/DataGridPager.php +++ b/lib/SP/Html/DataGrid/DataGridPager.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -31,7 +31,7 @@ defined('APP_ROOT') || die(); * * @package SP\Html\DataGrid */ -class DataGridPager extends DataGridPagerBase +final class DataGridPager extends DataGridPagerBase { } \ No newline at end of file diff --git a/lib/SP/Html/DataGrid/DataGridPagerBase.php b/lib/SP/Html/DataGrid/DataGridPagerBase.php index 160288eb..774988a6 100644 --- a/lib/SP/Html/DataGrid/DataGridPagerBase.php +++ b/lib/SP/Html/DataGrid/DataGridPagerBase.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -102,6 +102,7 @@ abstract class DataGridPagerBase implements DataGridPagerInterface /** * @param int $sortOrder + * * @return $this */ public function setSortOrder($sortOrder) @@ -113,6 +114,7 @@ abstract class DataGridPagerBase implements DataGridPagerInterface /** * @param string $sk + * * @return $this */ public function setSk($sk) @@ -132,6 +134,7 @@ abstract class DataGridPagerBase implements DataGridPagerInterface /** * @param IconInterface $iconPrev + * * @return $this */ public function setIconPrev(IconInterface $iconPrev) @@ -151,6 +154,7 @@ abstract class DataGridPagerBase implements DataGridPagerInterface /** * @param IconInterface $iconNext + * * @return $this */ public function setIconNext(IconInterface $iconNext) @@ -170,6 +174,7 @@ abstract class DataGridPagerBase implements DataGridPagerInterface /** * @param IconInterface $iconFirst + * * @return $this */ public function setIconFirst(IconInterface $iconFirst) @@ -189,6 +194,7 @@ abstract class DataGridPagerBase implements DataGridPagerInterface /** * @param IconInterface $iconLast + * * @return $this */ public function setIconLast(IconInterface $iconLast) @@ -212,6 +218,7 @@ abstract class DataGridPagerBase implements DataGridPagerInterface * Establecer el campo de la búsqueda * * @param int $sortKey + * * @return $this */ public function setSortKey($sortKey) @@ -235,6 +242,7 @@ abstract class DataGridPagerBase implements DataGridPagerInterface * Establecer el registro de inicio de la página * * @param int $limitStart + * * @return $this */ public function setLimitStart($limitStart) @@ -258,6 +266,7 @@ abstract class DataGridPagerBase implements DataGridPagerInterface * Establecer el número de registros en una página * * @param int $limitCount + * * @return $this */ public function setLimitCount($limitCount) @@ -301,6 +310,7 @@ abstract class DataGridPagerBase implements DataGridPagerInterface * Establecer el número total de registros obtenidos * * @param int $totalRows + * * @return $this */ public function setTotalRows($totalRows) @@ -324,6 +334,7 @@ abstract class DataGridPagerBase implements DataGridPagerInterface * Establecer si está activado el filtro * * @param bool $filterOn + * * @return $this */ public function setFilterOn($filterOn) @@ -337,6 +348,7 @@ abstract class DataGridPagerBase implements DataGridPagerInterface * Establecer la función javascript para paginar * * @param string $function + * * @return $this */ public function setOnClickFunction($function) @@ -376,6 +388,7 @@ abstract class DataGridPagerBase implements DataGridPagerInterface * Establecer los argumentos de la función OnClick * * @param mixed $args + * * @return $this */ public function setOnClickArgs($args) @@ -479,6 +492,7 @@ abstract class DataGridPagerBase implements DataGridPagerInterface /** * @param DataGridActionSearch $sourceAction + * * @return $this */ public function setSourceAction($sourceAction) diff --git a/lib/SP/Html/DataGrid/DataGridPagerInterface.php b/lib/SP/Html/DataGrid/DataGridPagerInterface.php index 6ff97787..a8f6681b 100644 --- a/lib/SP/Html/DataGrid/DataGridPagerInterface.php +++ b/lib/SP/Html/DataGrid/DataGridPagerInterface.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -53,6 +53,7 @@ interface DataGridPagerInterface * Establecer el registro de inicio de la página * * @param int $limitStart + * * @return static */ public function setLimitStart($limitStart); @@ -68,6 +69,7 @@ interface DataGridPagerInterface * Establecer el número de registros en una página * * @param int $limitCount + * * @return static */ public function setLimitCount($limitCount); @@ -97,6 +99,7 @@ interface DataGridPagerInterface * Establecer si está activado el filtro * * @param bool $filterOn + * * @return static */ public function setFilterOn($filterOn); diff --git a/lib/SP/Html/DataGrid/DataGridSort.php b/lib/SP/Html/DataGrid/DataGridSort.php index 4719fdb9..dd29b6a9 100644 --- a/lib/SP/Html/DataGrid/DataGridSort.php +++ b/lib/SP/Html/DataGrid/DataGridSort.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -33,19 +33,31 @@ defined('APP_ROOT') || die(); * * @package SP\Html\DataGrid */ -class DataGridSort implements DataGridSortInterface +final class DataGridSort implements DataGridSortInterface { - /** @var int */ + /** + * @var int + */ private $_sortKey = 0; - /** @var string */ + /** + * @var string + */ private $_title = ''; - /** @var string */ + /** + * @var string + */ private $_name = ''; - /** @var array */ + /** + * @var array + */ private $_class = array(); - /** @var IconInterface */ + /** + * @var IconInterface + */ private $_iconUp; - /** @var IconInterface */ + /** + * @var IconInterface + */ private $_iconDown; /** @@ -58,6 +70,7 @@ class DataGridSort implements DataGridSortInterface /** * @param $key int + * * @return $this */ public function setSortKey($key) @@ -77,6 +90,7 @@ class DataGridSort implements DataGridSortInterface /** * @param $title string + * * @return $this */ public function setTitle($title) @@ -96,6 +110,7 @@ class DataGridSort implements DataGridSortInterface /** * @param $name string + * * @return $this */ public function setName($name) @@ -115,6 +130,7 @@ class DataGridSort implements DataGridSortInterface /** * @param $class string + * * @return $this */ public function setClass($class) @@ -134,6 +150,7 @@ class DataGridSort implements DataGridSortInterface /** * @param IconInterface $icon + * * @return $this */ public function setIconUp(IconInterface $icon) @@ -153,6 +170,7 @@ class DataGridSort implements DataGridSortInterface /** * @param IconInterface $icon + * * @return $this */ public function setIconDown(IconInterface $icon) diff --git a/lib/SP/Html/DataGrid/DataGridSortInterface.php b/lib/SP/Html/DataGrid/DataGridSortInterface.php index 892c0768..5f4c80a3 100644 --- a/lib/SP/Html/DataGrid/DataGridSortInterface.php +++ b/lib/SP/Html/DataGrid/DataGridSortInterface.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/Html/DataGrid/DataGridTab.php b/lib/SP/Html/DataGrid/DataGridTab.php index a007f8c3..9e0ac544 100644 --- a/lib/SP/Html/DataGrid/DataGridTab.php +++ b/lib/SP/Html/DataGrid/DataGridTab.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -31,7 +31,7 @@ defined('APP_ROOT') || die(); * * @package SP\Html\DataGrid */ -class DataGridTab extends DataGridBase +final class DataGridTab extends DataGridBase { /** * Título de la pestaña @@ -40,8 +40,17 @@ class DataGridTab extends DataGridBase */ private $_title = ''; + /** + * @return string + */ + public function getTitle() + { + return $this->_title; + } + /** * @param $title string + * * @return DataGridTab */ public function setTitle($title) @@ -50,13 +59,5 @@ class DataGridTab extends DataGridBase return $this; } - - /** - * @return string - */ - public function getTitle() - { - return $this->_title; - } } diff --git a/lib/SP/Html/Html.php b/lib/SP/Html/Html.php index 13d646b0..2f5cac0e 100644 --- a/lib/SP/Html/Html.php +++ b/lib/SP/Html/Html.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -29,12 +29,13 @@ defined('APP_ROOT') || die(); /** * Esta clase es la encargada de mostrar el HTML */ -class Html +final class Html { /** * Limpia los datos recibidos de un formulario. * * @param string $data con los datos a limpiar + * * @return false|string con los datos limpiados */ public static function sanitize(&$data) @@ -94,6 +95,7 @@ class Html * Limpia los datos recibidos de un formulario. Sölo admite cadenas * * @param $data + * * @return false|string con los datos limpiados */ public static function sanitizeFull(&$data) @@ -121,6 +123,7 @@ class Html * @param string $text la cadena a truncar * @param int $limit la longitud máxima de la cadena * @param string $ellipsis + * * @return string con el texto truncado * * @link http://www.pjgalbraith.com/truncating-text-html-with-php/ @@ -138,6 +141,7 @@ class Html * From: http://bavotasan.com/2011/convert-hex-color-to-rgb-using-php/ * * @param array $rgb con color en RGB + * * @return string */ public static function rgb2hex($rgb) @@ -154,6 +158,7 @@ class Html * Devolver una cadena con el tag HTML strong. * * @param string $text con la cadena de texto + * * @return string */ public static function strongText($text) @@ -168,6 +173,7 @@ class Html * @param string $link con el destino del enlace * @param string $title con el título del enlace * @param string $attribs con atributos del enlace + * * @return string */ public static function anchorText($text, $link = '', $title = '', $attribs = '') diff --git a/lib/SP/Html/Minify.php b/lib/SP/Html/Minify.php index 095d10ff..f4ca0a5b 100644 --- a/lib/SP/Html/Minify.php +++ b/lib/SP/Html/Minify.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -36,7 +36,7 @@ defined('APP_ROOT') || die(); * * @package SP */ -class Minify +final class Minify { /** * Constantes para tipos de archivos @@ -81,6 +81,7 @@ class Minify /** * @param string $path * @param bool $checkPath + * * @return $this */ public function setBase($path, $checkPath = false) @@ -96,6 +97,7 @@ class Minify * devuelve el código HTTP/304 * * @param bool $disableMinify Deshabilitar minimizar + * * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ @@ -192,6 +194,7 @@ class Minify * Comprimir código javascript. * * @param string $buffer código a comprimir + * * @return string */ private function jsCompress($buffer) @@ -210,6 +213,7 @@ class Minify /** * @param $files * @param bool $minify + * * @return Minify */ public function addFilesFromString($files, $minify = true) @@ -232,6 +236,7 @@ class Minify * * @param string $file * @param bool $minify Si es necesario reducir + * * @return $this */ public function addFile($file, $minify = true) @@ -265,6 +270,7 @@ class Minify * Comprobar si es necesario reducir * * @param string $file El nombre del archivo + * * @return bool */ private function needsMinify($file) @@ -275,6 +281,7 @@ class Minify /** * @param array $files * @param bool $minify + * * @return Minify */ public function addFiles(array $files, $minify = true) @@ -311,6 +318,7 @@ class Minify * Añadir un recurso desde URL * * @param $url + * * @return $this */ public function addUrl($url) @@ -330,6 +338,7 @@ class Minify * Establecer el tipo de recurso a procesar * * @param int $type + * * @return $this */ public function setType($type) diff --git a/lib/SP/Http/Cookies.php b/lib/SP/Http/Cookies.php index d080b187..2cfde2f7 100644 --- a/lib/SP/Http/Cookies.php +++ b/lib/SP/Http/Cookies.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -29,7 +29,7 @@ namespace SP\Http; * * @package SP\Http */ -class Cookies +final class Cookies { /** * Comprueba si las cookies están habilitadas diff --git a/lib/SP/Http/JsonResponse.php b/lib/SP/Http/JsonResponse.php index f8b4bce3..031ee598 100644 --- a/lib/SP/Http/JsonResponse.php +++ b/lib/SP/Http/JsonResponse.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -29,7 +29,7 @@ namespace SP\Http; * * @package SP\Http */ -class JsonResponse implements \JsonSerializable +final class JsonResponse implements \JsonSerializable { const JSON_SUCCESS = 0; const JSON_SUCCESS_STICKY = 100; @@ -78,6 +78,7 @@ class JsonResponse implements \JsonSerializable /** * @param int $status + * * @return JsonResponse */ public function setStatus($status) @@ -97,6 +98,7 @@ class JsonResponse implements \JsonSerializable /** * @param string $description + * * @return JsonResponse */ public function setDescription($description) @@ -116,6 +118,7 @@ class JsonResponse implements \JsonSerializable /** * @param string $action + * * @return JsonResponse */ public function setAction($action) @@ -135,6 +138,7 @@ class JsonResponse implements \JsonSerializable /** * @param array|\stdClass $data + * * @return JsonResponse */ public function setData($data) @@ -154,6 +158,7 @@ class JsonResponse implements \JsonSerializable /** * @param array $messages + * * @return JsonResponse */ public function setMessages(array $messages) @@ -173,6 +178,7 @@ class JsonResponse implements \JsonSerializable /** * @param string $container + * * @return JsonResponse */ public function setContainer($container) @@ -192,6 +198,7 @@ class JsonResponse implements \JsonSerializable /** * @param string $csrf + * * @return JsonResponse */ public function setCsrf($csrf) @@ -203,6 +210,7 @@ class JsonResponse implements \JsonSerializable /** * @param $message + * * @return JsonResponse */ public function addMessage($message) @@ -213,6 +221,7 @@ class JsonResponse implements \JsonSerializable /** * @param $param + * * @return $this */ public function addParam($param) @@ -228,7 +237,8 @@ class JsonResponse implements \JsonSerializable /** * Specify data which should be serialized to JSON - * @link http://php.net/manual/en/jsonserializable.jsonserialize.php + * + * @link http://php.net/manual/en/jsonserializable.jsonserialize.php * @return mixed data which can be serialized by json_encode, * which is a value of any type other than a resource. * @since 5.4.0 diff --git a/lib/SP/Http/Message.php b/lib/SP/Http/Message.php index 3954293b..af2f995e 100644 --- a/lib/SP/Http/Message.php +++ b/lib/SP/Http/Message.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -29,7 +29,7 @@ namespace SP\Http; * * @package SP\Http */ -class Message +final class Message { const TYPE_OK = 0; const TYPE_ERROR = 1; diff --git a/lib/SP/Http/Request.php b/lib/SP/Http/Request.php index 2f0a5424..b05309d9 100644 --- a/lib/SP/Http/Request.php +++ b/lib/SP/Http/Request.php @@ -37,7 +37,7 @@ use SP\Util\Util; * * @package SP */ -class Request +final class Request { /** * @var array Directorios seguros para include diff --git a/lib/SP/Http/Response.php b/lib/SP/Http/Response.php index bce9d23a..723d9ac9 100644 --- a/lib/SP/Http/Response.php +++ b/lib/SP/Http/Response.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -33,13 +33,14 @@ defined('APP_ROOT') || die(); /** * Esta clase es encargada de ejecutar acciones comunes para las funciones */ -class Response +final class Response { /** * Devuelve una respuesta en formato XML con el estado y el mensaje. * * @param string $description mensaje a devolver * @param int $status devuelve el estado + * * @return bool */ public static function printXml($description, $status = 1) diff --git a/lib/SP/Http/Uri.php b/lib/SP/Http/Uri.php index 9a55c86b..ba3c1391 100644 --- a/lib/SP/Http/Uri.php +++ b/lib/SP/Http/Uri.php @@ -31,7 +31,7 @@ use SP\Core\Crypt\Hash; * * @package SP\Http */ -class Uri +final class Uri { /** * @var string diff --git a/lib/SP/Http/XMLRPCResponseParse.php b/lib/SP/Http/XMLRPCResponseParse.php index fa22408a..5c29e0f0 100644 --- a/lib/SP/Http/XMLRPCResponseParse.php +++ b/lib/SP/Http/XMLRPCResponseParse.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -54,6 +54,7 @@ abstract class XMLRPCResponseParse * Constructor * * @param string $xml El documento XML + * * @throws \InvalidArgumentException */ public function __construct($xml) @@ -89,6 +90,7 @@ abstract class XMLRPCResponseParse * de la clase _data * * @param DOMNodeList $nodes + * * @return array */ private function parseNodes(DOMNodeList $nodes) @@ -121,6 +123,7 @@ abstract class XMLRPCResponseParse * Procesar nodos del tipo struct * * @param DOMElement $xmlStruct + * * @return array */ private function parseStruct(DOMElement $xmlStruct) @@ -152,6 +155,7 @@ abstract class XMLRPCResponseParse /** * @param DOMNode $node + * * @return bool|int|string|null */ private function parseNodeType(DOMNode $node) @@ -175,6 +179,7 @@ abstract class XMLRPCResponseParse * Procesar nodos del tipo array * * @param DOMElement $xmlArray + * * @return array */ private function parseArray(DOMElement $xmlArray) @@ -203,6 +208,7 @@ abstract class XMLRPCResponseParse * Procesar nodos del tipo value * * @param DOMElement $xmlValues + * * @return array */ private function parseValues(DOMElement $xmlValues) @@ -228,6 +234,7 @@ abstract class XMLRPCResponseParse * Procesar nodos del tipo fault * * @param DOMElement $xmlFault + * * @return array */ private function parseFault(DOMElement $xmlFault) diff --git a/lib/SP/Mvc/Controller/CrudControllerInterface.php b/lib/SP/Mvc/Controller/CrudControllerInterface.php index 232f0bcf..eb034996 100644 --- a/lib/SP/Mvc/Controller/CrudControllerInterface.php +++ b/lib/SP/Mvc/Controller/CrudControllerInterface.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/Mvc/Model/QueryAssignment.php b/lib/SP/Mvc/Model/QueryAssignment.php index 335225dd..4a260aea 100644 --- a/lib/SP/Mvc/Model/QueryAssignment.php +++ b/lib/SP/Mvc/Model/QueryAssignment.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -29,7 +29,7 @@ namespace SP\Mvc\Model; * * @package SP\Mvc\Model */ -class QueryAssignment +final class QueryAssignment { /** * @var array @@ -43,6 +43,7 @@ class QueryAssignment /** * @param $field * @param $value + * * @return QueryAssignment */ public function addField($field, $value) @@ -58,6 +59,7 @@ class QueryAssignment /** * @param array $fields * @param array $values + * * @return QueryAssignment */ public function setFields(array $fields, array $values) diff --git a/lib/SP/Mvc/Model/QueryCondition.php b/lib/SP/Mvc/Model/QueryCondition.php index 4254adc8..9e44e098 100644 --- a/lib/SP/Mvc/Model/QueryCondition.php +++ b/lib/SP/Mvc/Model/QueryCondition.php @@ -29,7 +29,7 @@ namespace SP\Mvc\Model; * * @package SP\Mvc\Model */ -class QueryCondition +final class QueryCondition { const CONDITION_AND = ' AND '; const CONDITION_OR = ' OR '; @@ -46,6 +46,7 @@ class QueryCondition /** * @param string $query * @param array $params + * * @return QueryCondition */ public function addFilter($query, array $params = null) @@ -61,6 +62,7 @@ class QueryCondition /** * @param string $type + * * @return string|null */ public function getFilters($type = self::CONDITION_AND) diff --git a/lib/SP/Mvc/Model/QueryJoin.php b/lib/SP/Mvc/Model/QueryJoin.php index efaba007..67834ada 100644 --- a/lib/SP/Mvc/Model/QueryJoin.php +++ b/lib/SP/Mvc/Model/QueryJoin.php @@ -29,7 +29,7 @@ namespace SP\Mvc\Model; * * @package SP\Mvc\Model */ -class QueryJoin +final class QueryJoin { /** * @var array @@ -43,6 +43,7 @@ class QueryJoin /** * @param string $join * @param array $params + * * @return QueryJoin */ public function addJoin($join, array $params = null) diff --git a/lib/SP/Mvc/View/Components/DataTab.php b/lib/SP/Mvc/View/Components/DataTab.php index 6afd80dc..655c488a 100644 --- a/lib/SP/Mvc/View/Components/DataTab.php +++ b/lib/SP/Mvc/View/Components/DataTab.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -65,6 +65,7 @@ class DataTab /** * @param string $title + * * @return DataTab */ public function setTitle($title) diff --git a/lib/SP/Mvc/View/Components/ItemAdapterInterface.php b/lib/SP/Mvc/View/Components/ItemAdapterInterface.php index 6876877c..4dc4607c 100644 --- a/lib/SP/Mvc/View/Components/ItemAdapterInterface.php +++ b/lib/SP/Mvc/View/Components/ItemAdapterInterface.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/Mvc/View/Components/SelectItem.php b/lib/SP/Mvc/View/Components/SelectItem.php index 1ed7fdbc..512d2dc7 100644 --- a/lib/SP/Mvc/View/Components/SelectItem.php +++ b/lib/SP/Mvc/View/Components/SelectItem.php @@ -100,6 +100,7 @@ class SelectItem /** * @param $property + * * @return mixed */ public function getItemProperty($property) diff --git a/lib/SP/Mvc/View/Components/SelectItemAdapter.php b/lib/SP/Mvc/View/Components/SelectItemAdapter.php index 5105b3da..0b63cc66 100644 --- a/lib/SP/Mvc/View/Components/SelectItemAdapter.php +++ b/lib/SP/Mvc/View/Components/SelectItemAdapter.php @@ -52,6 +52,7 @@ class SelectItemAdapter implements ItemAdapterInterface /** * @param array $items + * * @return static */ public static function factory(array $items) @@ -63,6 +64,7 @@ class SelectItemAdapter implements ItemAdapterInterface * Returns an array of ids from the given array of objects * * @param array $items + * * @return array */ public static function getIdFromArrayOfObjects(array $items) @@ -121,6 +123,7 @@ class SelectItemAdapter implements ItemAdapterInterface * * @param array $selected * @param null $skip + * * @return SelectItem[] */ public function getItemsFromModelSelected(array $selected, $skip = null) @@ -165,6 +168,7 @@ class SelectItemAdapter implements ItemAdapterInterface * * @param array $selected * @param bool $useValueAsKey + * * @return SelectItem[] */ public function getItemsFromArraySelected(array $selected, $useValueAsKey = false) diff --git a/lib/SP/Mvc/View/Template.php b/lib/SP/Mvc/View/Template.php index e80210bd..22ecbf94 100644 --- a/lib/SP/Mvc/View/Template.php +++ b/lib/SP/Mvc/View/Template.php @@ -40,7 +40,7 @@ use SP\Core\UI\ThemeInterface; * publicada en http://www.sitepoint.com/flexible-view-manipulation-1/ * */ -class Template +final class Template { const TEMPLATE_EXTENSION = '.inc'; const PARTIALS_DIR = '_partials'; @@ -84,6 +84,7 @@ class Template * * @param string $name Con el nombre del archivo de plantilla * @param string $base Directorio base para la plantilla + * * @return bool */ public function addContentTemplate($name, $base = null) @@ -102,8 +103,11 @@ class Template * Comprobar si un archivo de plantilla existe y se puede leer * * @param string $template Con el nombre del archivo + * * @return string La ruta al archivo de la plantilla + * * @param string $base Directorio base para la plantilla + * * @throws \SP\Core\Exceptions\FileNotFoundException */ private function checkTemplate($template, $base = null) @@ -140,6 +144,7 @@ class Template * Removes a template from the stack * * @param $name + * * @return Template */ public function removeTemplate($name) @@ -153,6 +158,7 @@ class Template * Removes a template from the stack * * @param $name + * * @return Template */ public function removeContentTemplate($name) @@ -168,6 +174,7 @@ class Template * @param string $src Source template * @param string $dst Destination template * @param string $base + * * @return mixed|string */ public function replaceTemplate($src, $dst, $base) @@ -198,6 +205,7 @@ class Template * * @param string $name Con el nombre del archivo de plantilla * @param string $base Directorio base para la plantilla + * * @return bool */ public function addTemplate($name, $base = null) @@ -227,6 +235,7 @@ class Template * Añadir una nueva plantilla dentro de una plantilla * * @param string $file Con el nombre del archivo de plantilla + * * @return bool */ public function includePartial($file) @@ -239,6 +248,7 @@ class Template * * @param string $file Con el nombre del archivo de plantilla * @param string $base Directorio base para la plantilla + * * @return bool */ public function includeTemplate($file, $base = null) @@ -254,6 +264,7 @@ class Template * Overloading para controlar la devolución de atributos dinámicos. * * @param string $name Nombre del atributo + * * @return null * @throws \SP\Core\Exceptions\InvalidArgumentException */ @@ -274,6 +285,7 @@ class Template * * @param string $name Nombre del atributo * @param string $value Valor del atributo + * * @return null */ public function __set($name, $value) @@ -287,6 +299,7 @@ class Template * en el array de variables de la plantilla. * * @param string $name Nombre del atributo + * * @return bool */ public function __isset($name) @@ -299,6 +312,7 @@ class Template * atributo dinámico de la clase * * @param string $name Nombre del atributo + * * @return $this * @throws \SP\Core\Exceptions\InvalidArgumentException */ diff --git a/lib/SP/Mvc/View/View.php b/lib/SP/Mvc/View/View.php index 52aec10c..4e61d704 100644 --- a/lib/SP/Mvc/View/View.php +++ b/lib/SP/Mvc/View/View.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -29,7 +29,7 @@ namespace SP\Mvc\View; * * @package SP\Lib\Mvc\View */ -class View implements ViewInterface +final class View implements ViewInterface { /** * @var array @@ -58,6 +58,7 @@ class View implements ViewInterface /** * View constructor. + * * @param \Twig_Environment $view */ public function __construct(\Twig_Environment $view) @@ -71,6 +72,7 @@ class View implements ViewInterface * * @param $name * @param $value + * * @return $this */ public function assign($name, $value) @@ -88,6 +90,7 @@ class View implements ViewInterface * Establecer variables * * @param array $vars + * * @return $this */ public function setVars(array $vars) @@ -100,8 +103,9 @@ class View implements ViewInterface /** * Renderizar plantilla * - * @param $template + * @param $template * @param string $path + * * @return string */ public function render($template, $path = null) @@ -119,6 +123,7 @@ class View implements ViewInterface * Establecer namespace para las plantillas * * @param $name + * * @return $this */ public function setNamespace($name) @@ -132,6 +137,7 @@ class View implements ViewInterface * Establecer el controlador * * @param $name + * * @return $this */ public function setController($name) @@ -205,6 +211,7 @@ class View implements ViewInterface * Devolver una variable * * @param $name + * * @return mixed */ public function get($name) diff --git a/lib/SP/Mvc/View/ViewInterface.php b/lib/SP/Mvc/View/ViewInterface.php index 90d738db..853108e0 100644 --- a/lib/SP/Mvc/View/ViewInterface.php +++ b/lib/SP/Mvc/View/ViewInterface.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -36,6 +36,7 @@ interface ViewInterface * * @param $name * @param $value + * * @return $this */ public function assign($name, $value); @@ -44,6 +45,7 @@ interface ViewInterface * Devolver una variable * * @param $name + * * @return mixed */ public function get($name); @@ -52,6 +54,7 @@ interface ViewInterface * Establecer variables * * @param array $vars + * * @return $this */ public function setVars(array $vars); @@ -59,8 +62,9 @@ interface ViewInterface /** * Renderizar plantilla * - * @param $template + * @param $template * @param null $path + * * @return string */ public function render($template, $path = null); @@ -69,6 +73,7 @@ interface ViewInterface * Establecer namespace para las plantillas * * @param $name + * * @return $this */ public function setNamespace($name); @@ -77,6 +82,7 @@ interface ViewInterface * Establecer el controlador * * @param $name + * * @return $this */ public function setController($name); diff --git a/lib/SP/Providers/Auth/AuthDataBase.php b/lib/SP/Providers/Auth/AuthDataBase.php index 054904a9..925ccd36 100644 --- a/lib/SP/Providers/Auth/AuthDataBase.php +++ b/lib/SP/Providers/Auth/AuthDataBase.php @@ -102,6 +102,7 @@ abstract class AuthDataBase /** * @param bool $authenticated + * * @return $this */ public function setAuthenticated($authenticated = null) diff --git a/lib/SP/Providers/Auth/AuthInterface.php b/lib/SP/Providers/Auth/AuthInterface.php index c1044778..7c66f04b 100644 --- a/lib/SP/Providers/Auth/AuthInterface.php +++ b/lib/SP/Providers/Auth/AuthInterface.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -28,6 +28,7 @@ use SP\DataModel\UserLoginData; /** * Interface AuthInterface + * * @package Auth */ interface AuthInterface @@ -36,6 +37,7 @@ interface AuthInterface * Autentificar al usuario * * @param UserLoginData $UserData Datos del usuario + * * @return mixed|AuthDataBase */ public function authenticate(UserLoginData $UserData); diff --git a/lib/SP/Providers/Auth/AuthProvider.php b/lib/SP/Providers/Auth/AuthProvider.php index e535552a..2917effd 100644 --- a/lib/SP/Providers/Auth/AuthProvider.php +++ b/lib/SP/Providers/Auth/AuthProvider.php @@ -47,7 +47,7 @@ defined('APP_ROOT') || die(); * * @package SP\Providers\Auth */ -class AuthProvider extends Provider +final class AuthProvider extends Provider { /** * @var array diff --git a/lib/SP/Providers/Auth/AuthResult.php b/lib/SP/Providers/Auth/AuthResult.php index b04ff03f..fe30f7d0 100644 --- a/lib/SP/Providers/Auth/AuthResult.php +++ b/lib/SP/Providers/Auth/AuthResult.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -29,7 +29,7 @@ namespace SP\Providers\Auth; * * @package SP\Providers\Auth */ -class AuthResult +final class AuthResult { /** * @var string diff --git a/lib/SP/Providers/Auth/AuthUtil.php b/lib/SP/Providers/Auth/AuthUtil.php deleted file mode 100644 index ef8da124..00000000 --- a/lib/SP/Providers/Auth/AuthUtil.php +++ /dev/null @@ -1,43 +0,0 @@ -. - */ - -namespace SP\Providers\Auth; - -/** - * Class AuthUtil - * - * @package SP\Providers\Auth - */ -class AuthUtil -{ - /** - * Devuelve el typo de autentificación del servidor web - * - * @return string - */ - public static function getServerAuthType() - { - return isset($_SERVER['AUTH_TYPE']) ? strtoupper($_SERVER['AUTH_TYPE']) : __('N/D'); - } -} \ No newline at end of file diff --git a/lib/SP/Providers/Auth/Browser/Browser.php b/lib/SP/Providers/Auth/Browser/Browser.php index d35b59e3..4f562c68 100644 --- a/lib/SP/Providers/Auth/Browser/Browser.php +++ b/lib/SP/Providers/Auth/Browser/Browser.php @@ -35,7 +35,7 @@ use SP\Providers\Auth\AuthInterface; * * @package SP\Providers\Auth\Browser */ -class Browser implements AuthInterface +final class Browser implements AuthInterface { /** * @var ConfigData @@ -56,6 +56,7 @@ class Browser implements AuthInterface * Autentificar al usuario * * @param UserLoginData $userLoginData Datos del usuario + * * @return BrowserAuthData */ public function authenticate(UserLoginData $userLoginData) @@ -99,6 +100,7 @@ class Browser implements AuthInterface * Comprobar si el usuario es autentificado por el servidor web * * @param $login string El login del usuario a comprobar + * * @return bool|null */ public function checkServerAuthUser($login) diff --git a/lib/SP/Providers/Auth/Browser/BrowserAuthData.php b/lib/SP/Providers/Auth/Browser/BrowserAuthData.php index d8bae0ac..9f66c423 100644 --- a/lib/SP/Providers/Auth/Browser/BrowserAuthData.php +++ b/lib/SP/Providers/Auth/Browser/BrowserAuthData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -31,7 +31,7 @@ use SP\Providers\Auth\AuthDataBase; * * @package SP\Providers\Auth\Browser */ -class BrowserAuthData extends AuthDataBase +final class BrowserAuthData extends AuthDataBase { } \ No newline at end of file diff --git a/lib/SP/Providers/Auth/Database/Database.php b/lib/SP/Providers/Auth/Database/Database.php index 49159e10..8009b090 100644 --- a/lib/SP/Providers/Auth/Database/Database.php +++ b/lib/SP/Providers/Auth/Database/Database.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -38,7 +38,7 @@ use SP\Services\User\UserService; * * @package SP\Providers\Auth\Database */ -class Database implements AuthInterface +final class Database implements AuthInterface { /** * @var UserLoginData $userLoginData @@ -56,7 +56,7 @@ class Database implements AuthInterface /** * Database constructor. * - * @param UserService $userService + * @param UserService $userService * @param UserPassService $userPassService */ public function __construct(UserService $userService, UserPassService $userPassService) @@ -70,6 +70,7 @@ class Database implements AuthInterface * Autentificar al usuario * * @param UserLoginData $userLoginData Datos del usuario + * * @return DatabaseAuthData */ public function authenticate(UserLoginData $userLoginData) @@ -123,6 +124,7 @@ class Database implements AuthInterface /** * @param UserLoginResponse $userLoginResponse + * * @return bool */ protected function checkMigrateUser(UserLoginResponse $userLoginResponse) diff --git a/lib/SP/Providers/Auth/Database/DatabaseAuthData.php b/lib/SP/Providers/Auth/Database/DatabaseAuthData.php index 602b952d..a282f74b 100644 --- a/lib/SP/Providers/Auth/Database/DatabaseAuthData.php +++ b/lib/SP/Providers/Auth/Database/DatabaseAuthData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -31,7 +31,7 @@ use SP\Providers\Auth\AuthDataBase; * * @package SP\Auth\Database */ -class DatabaseAuthData extends AuthDataBase +final class DatabaseAuthData extends AuthDataBase { } \ No newline at end of file diff --git a/lib/SP/Providers/Auth/Ldap/LdapAuthData.php b/lib/SP/Providers/Auth/Ldap/LdapAuthData.php index 2a54224d..10920cd2 100644 --- a/lib/SP/Providers/Auth/Ldap/LdapAuthData.php +++ b/lib/SP/Providers/Auth/Ldap/LdapAuthData.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -31,7 +31,7 @@ use SP\Providers\Auth\AuthDataBase; * * @package SP\Providers\Auth\Ldap */ -class LdapAuthData extends AuthDataBase +final class LdapAuthData extends AuthDataBase { /** * @var string diff --git a/lib/SP/Providers/Auth/Ldap/LdapBase.php b/lib/SP/Providers/Auth/Ldap/LdapBase.php index fcb7ddf2..604ce605 100644 --- a/lib/SP/Providers/Auth/Ldap/LdapBase.php +++ b/lib/SP/Providers/Auth/Ldap/LdapBase.php @@ -95,9 +95,9 @@ abstract class LdapBase implements LdapInterface, AuthInterface /** * LdapBase constructor. * - * @param LdapParams $ldapParams + * @param LdapParams $ldapParams * @param EventDispatcher $eventDispatcher - * @param bool $debug + * @param bool $debug */ public function __construct(LdapParams $ldapParams, EventDispatcher $eventDispatcher, $debug = false) { @@ -220,8 +220,9 @@ abstract class LdapBase implements LdapInterface, AuthInterface /** * Realizar la autentificación con el servidor de LDAP. * - * @param string $bindDn con el DN del usuario + * @param string $bindDn con el DN del usuario * @param string $bindPass con la clave del usuario + * * @throws LdapException * @return bool */ @@ -286,6 +287,7 @@ abstract class LdapBase implements LdapInterface, AuthInterface * Autentificar al usuario * * @param UserLoginData $userLoginData Datos del usuario + * * @return bool */ public function authenticate(UserLoginData $userLoginData) @@ -415,8 +417,9 @@ abstract class LdapBase implements LdapInterface, AuthInterface /** * Devolver los resultados de una paginación * - * @param string $filter Filtro a utilizar - * @param array $attributes Atributos a devolver + * @param string $filter Filtro a utilizar + * @param array $attributes Atributos a devolver + * * @return bool|array */ protected function getResults($filter, array $attributes = null) @@ -514,7 +517,8 @@ abstract class LdapBase implements LdapInterface, AuthInterface * Devolver los objetos disponibles * * @param string $filter - * @param array $attributes + * @param array $attributes + * * @return array|bool * @throws LdapException */ @@ -529,7 +533,8 @@ abstract class LdapBase implements LdapInterface, AuthInterface * Obtener los objetos según el filtro indicado * * @param string $filter - * @param array $attributes + * @param array $attributes + * * @return array * @throws LdapException */ @@ -553,6 +558,7 @@ abstract class LdapBase implements LdapInterface, AuthInterface * Devolver los objetos disponibles * * @param array $attributes + * * @return array|bool * @throws LdapException */ @@ -567,6 +573,7 @@ abstract class LdapBase implements LdapInterface, AuthInterface * Devolver los objetos disponibles * * @param array $attributes + * * @return array|bool * @throws LdapException */ diff --git a/lib/SP/Providers/Auth/Ldap/LdapException.php b/lib/SP/Providers/Auth/Ldap/LdapException.php index 509b96fd..7d22b43d 100644 --- a/lib/SP/Providers/Auth/Ldap/LdapException.php +++ b/lib/SP/Providers/Auth/Ldap/LdapException.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -31,7 +31,7 @@ use SP\Core\Exceptions\SPException; * * @package SP\Providers\Auth\Ldap */ -class LdapException extends SPException +final class LdapException extends SPException { } \ No newline at end of file diff --git a/lib/SP/Providers/Auth/Ldap/LdapInterface.php b/lib/SP/Providers/Auth/Ldap/LdapInterface.php index 6d3dd75d..77a388cf 100644 --- a/lib/SP/Providers/Auth/Ldap/LdapInterface.php +++ b/lib/SP/Providers/Auth/Ldap/LdapInterface.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. diff --git a/lib/SP/Providers/Auth/Ldap/LdapMsAds.php b/lib/SP/Providers/Auth/Ldap/LdapMsAds.php index 8a3f1933..11c59927 100644 --- a/lib/SP/Providers/Auth/Ldap/LdapMsAds.php +++ b/lib/SP/Providers/Auth/Ldap/LdapMsAds.php @@ -34,7 +34,7 @@ use SP\Core\Events\EventMessage; * * @package SP\Auth\Ldap */ -class LdapMsAds extends LdapBase +final class LdapMsAds extends LdapBase { const userObjectFilter = '(|(objectCategory=person)(objectClass=user))'; const groupObjectFilter = '(objectCategory=group)'; diff --git a/lib/SP/Providers/Auth/Ldap/LdapParams.php b/lib/SP/Providers/Auth/Ldap/LdapParams.php index 73b2c951..ef76f0de 100644 --- a/lib/SP/Providers/Auth/Ldap/LdapParams.php +++ b/lib/SP/Providers/Auth/Ldap/LdapParams.php @@ -29,7 +29,7 @@ namespace SP\Providers\Auth\Ldap; * * @package SP\Providers\Auth\Ldap */ -class LdapParams +final class LdapParams { const REGEX_SERVER = '(?