Files
sysPass/app/modules/web/Forms/FormBase.php
nuxsmin cd2c0379db * [MOD] Improved plugins manager
* [MOD] Code refactoring and cleanup
* [MOD] Make classes final for performance improvements and avoid some side behaviours
2018-07-28 21:45:49 +02:00

87 lines
2.1 KiB
PHP

<?php
/**
* sysPass
*
* @author nuxsmin
* @link https://syspass.org
* @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
* sysPass is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* sysPass is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with sysPass. If not, see <http://www.gnu.org/licenses/>.
*/
namespace SP\Modules\Web\Forms;
use DI\Container;
use SP\Config\Config;
use SP\Config\ConfigData;
use SP\Core\Context\ContextInterface;
use SP\Core\Context\SessionContext;
use SP\Http\Request;
/**
* Class FormBase
*
* @package SP\Modules\Web\Forms
*/
abstract class FormBase
{
/**
* @var int
*/
protected $itemId;
/**
* @var Config
*/
protected $config;
/**
* @var ConfigData
*/
protected $configData;
/**
* @var SessionContext
*/
protected $context;
/**
* @var Request
*/
protected $request;
/**
* FormBase constructor.
*
* @param int $itemId
* @param Container $container
*
* @throws \DI\DependencyException
* @throws \DI\NotFoundException
*/
public function __construct(Container $container, $itemId = null)
{
$this->config = $container->get(Config::class);
$this->configData = $this->config->getConfigData();
$this->context = $container->get(ContextInterface::class);
$this->request = $container->get(Request::class);
$this->itemId = $itemId;
}
/**
* Analizar los datos de la petición HTTP
*
* @return void
*/
abstract protected function analyzeRequestData();
}