php cs fixer

This commit is contained in:
Dennis Eichhorn 2019-04-27 12:05:33 +02:00
parent bb3fbb1146
commit cbb118f0c1
16 changed files with 530 additions and 530 deletions

View File

@ -1,31 +1,31 @@
<?php
use Modules\Exchange\Controller\ApiController;
use Modules\Exchange\Models\PermissionState;
use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb;
return [
'^.*/admin/exchange/import/profile.*$' => [
[
'dest' => '\Modules\Exchange\Controller\ApiController:apiExchangeImport',
'verb' => RouteVerb::SET,
'permission' => [
'module' => ApiController::MODULE_NAME,
'type' => PermissionType::CREATE,
'state' => PermissionState::IMPORT,
],
],
],
'^.*/admin/exchange/export/profile.*$' => [
[
'dest' => '\Modules\Exchange\Controller\ApiController:apiExchangeExport',
'verb' => RouteVerb::SET,
'permission' => [
'module' => ApiController::MODULE_NAME,
'type' => PermissionType::CREATE,
'state' => PermissionState::EXPORT,
],
],
],
];
<?php declare(strict_types=1);
use Modules\Exchange\Controller\ApiController;
use Modules\Exchange\Models\PermissionState;
use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb;
return [
'^.*/admin/exchange/import/profile.*$' => [
[
'dest' => '\Modules\Exchange\Controller\ApiController:apiExchangeImport',
'verb' => RouteVerb::SET,
'permission' => [
'module' => ApiController::MODULE_NAME,
'type' => PermissionType::CREATE,
'state' => PermissionState::IMPORT,
],
],
],
'^.*/admin/exchange/export/profile.*$' => [
[
'dest' => '\Modules\Exchange\Controller\ApiController:apiExchangeExport',
'verb' => RouteVerb::SET,
'permission' => [
'module' => ApiController::MODULE_NAME,
'type' => PermissionType::CREATE,
'state' => PermissionState::EXPORT,
],
],
],
];

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
use Modules\Exchange\Controller\BackendController;
use Modules\Exchange\Models\PermissionState;

View File

@ -58,7 +58,7 @@ final class ApiController extends Controller
$response->set($request->getUri()->__toString(), [
'status' => $status,
'title' => 'Exchange',
'message' => $message
'message' => $message,
]);
}

View File

@ -1,67 +1,67 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\Exchange\Interfaces\GSD\Model
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Exchange\Interfaces\GSD\Model;
use phpOMS\DataStorage\Database\DataMapperAbstract;
/**
* Mapper class.
*
* @package Modules\Exchange\Interfaces\GSD\Model
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
final class GSDCostCenterMapper extends DataMapperAbstract
{
/**
* Columns.
*
* @var array<string, array<string, bool|string>>
* @since 1.0.0
*/
protected static $columns = [
'ROW_ID' => ['name' => 'ROW_ID', 'type' => 'int', 'internal' => 'id'],
'row_create_time' => ['name' => 'row_create_time', 'type' => 'DateTime', 'internal' => 'createdAt'],
'row_create_user' => ['name' => 'row_create_user', 'type' => 'int', 'internal' => 'createdBy'],
'KST' => ['name' => 'KST', 'type' => 'string', 'internal' => 'costcenter'],
'Bezeichnung' => ['name' => 'Bezeichnung', 'type' => 'string', 'internal' => 'description'],
];
/**
* Primary table.
*
* @var string
* @since 1.0.0
*/
protected static $table = 'FiKostenstellen';
/**
* Created at.
*
* @var string
* @since 1.0.0
*/
protected static $createdAt = 'row_create_time';
/**
* Primary field name.
*
* @var string
* @since 1.0.0
*/
protected static $primaryField = 'ROW_ID';
}
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\Exchange\Interfaces\GSD\Model
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Exchange\Interfaces\GSD\Model;
use phpOMS\DataStorage\Database\DataMapperAbstract;
/**
* Mapper class.
*
* @package Modules\Exchange\Interfaces\GSD\Model
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
final class GSDCostCenterMapper extends DataMapperAbstract
{
/**
* Columns.
*
* @var array<string, array<string, bool|string>>
* @since 1.0.0
*/
protected static $columns = [
'ROW_ID' => ['name' => 'ROW_ID', 'type' => 'int', 'internal' => 'id'],
'row_create_time' => ['name' => 'row_create_time', 'type' => 'DateTime', 'internal' => 'createdAt'],
'row_create_user' => ['name' => 'row_create_user', 'type' => 'int', 'internal' => 'createdBy'],
'KST' => ['name' => 'KST', 'type' => 'string', 'internal' => 'costcenter'],
'Bezeichnung' => ['name' => 'Bezeichnung', 'type' => 'string', 'internal' => 'description'],
];
/**
* Primary table.
*
* @var string
* @since 1.0.0
*/
protected static $table = 'FiKostenstellen';
/**
* Created at.
*
* @var string
* @since 1.0.0
*/
protected static $createdAt = 'row_create_time';
/**
* Primary field name.
*
* @var string
* @since 1.0.0
*/
protected static $primaryField = 'ROW_ID';
}

View File

@ -1,67 +1,67 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\Exchange\Interfaces\GSD\Model
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Exchange\Interfaces\GSD\Model;
use phpOMS\DataStorage\Database\DataMapperAbstract;
/**
* Mapper class.
*
* @package Modules\Exchange\Interfaces\GSD\Model
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
final class GSDCostObjectMapper extends DataMapperAbstract
{
/**
* Columns.
*
* @var array<string, array<string, bool|string>>
* @since 1.0.0
*/
protected static $columns = [
'ROW_ID' => ['name' => 'ROW_ID', 'type' => 'int', 'internal' => 'id'],
'row_create_time' => ['name' => 'row_create_time', 'type' => 'DateTime', 'internal' => 'createdAt'],
'row_create_user' => ['name' => 'row_create_user', 'type' => 'int', 'internal' => 'createdBy'],
'KTR' => ['name' => 'KTR', 'type' => 'string', 'internal' => 'costobject'],
'Bezeichnung' => ['name' => 'Bezeichnung', 'type' => 'string', 'internal' => 'description'],
];
/**
* Primary table.
*
* @var string
* @since 1.0.0
*/
protected static $table = 'FiKostentraeger';
/**
* Created at.
*
* @var string
* @since 1.0.0
*/
protected static $createdAt = 'row_create_time';
/**
* Primary field name.
*
* @var string
* @since 1.0.0
*/
protected static $primaryField = 'ROW_ID';
}
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\Exchange\Interfaces\GSD\Model
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Exchange\Interfaces\GSD\Model;
use phpOMS\DataStorage\Database\DataMapperAbstract;
/**
* Mapper class.
*
* @package Modules\Exchange\Interfaces\GSD\Model
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
final class GSDCostObjectMapper extends DataMapperAbstract
{
/**
* Columns.
*
* @var array<string, array<string, bool|string>>
* @since 1.0.0
*/
protected static $columns = [
'ROW_ID' => ['name' => 'ROW_ID', 'type' => 'int', 'internal' => 'id'],
'row_create_time' => ['name' => 'row_create_time', 'type' => 'DateTime', 'internal' => 'createdAt'],
'row_create_user' => ['name' => 'row_create_user', 'type' => 'int', 'internal' => 'createdBy'],
'KTR' => ['name' => 'KTR', 'type' => 'string', 'internal' => 'costobject'],
'Bezeichnung' => ['name' => 'Bezeichnung', 'type' => 'string', 'internal' => 'description'],
];
/**
* Primary table.
*
* @var string
* @since 1.0.0
*/
protected static $table = 'FiKostentraeger';
/**
* Created at.
*
* @var string
* @since 1.0.0
*/
protected static $createdAt = 'row_create_time';
/**
* Primary field name.
*
* @var string
* @since 1.0.0
*/
protected static $primaryField = 'ROW_ID';
}

View File

@ -1,22 +1,22 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
return [
'Accounts' => 'Accounts',
'Articles' => 'Articles',
'CostCenters' => 'Cost Centers',
'CostObjects' => 'Cost Objects',
'Customers' => 'Customers',
'Invoices' => 'Invoices',
'Options' => 'Options',
'Suppliers' => 'Suppliers',
];
<?php declare(strict_types=1);
/**
* Orange Management
*
* PHP Version 7.2
*
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
return [
'Accounts' => 'Accounts',
'Articles' => 'Articles',
'CostCenters' => 'Cost Centers',
'CostObjects' => 'Cost Objects',
'Customers' => 'Customers',
'Invoices' => 'Invoices',
'Options' => 'Options',
'Suppliers' => 'Suppliers',
];

View File

@ -1,206 +1,206 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package phpOMS\Module
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Exchange\Models;
use phpOMS\System\File\PathException;
use phpOMS\Utils\ArrayUtils;
/**
* InfoManager class.
*
* Handling the info files for modules
*
* @package phpOMS\Module
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class InterfaceManager
{
/**
* Interface ID.
*
* @var int
* @since 1.0.0
*/
private $id = 0;
/**
* File path.
*
* @var string
* @since 1.0.0
*/
private $path = '';
/**
* Info data.
*
* @var array<string, mixed>
* @since 1.0.0
*/
private $info = [];
/**
* Object constructor.
*
* @param string $path Info file path
*
* @since 1.0.0
*/
public function __construct(string $path = '')
{
$this->path = $path;
}
/**
* Get id
*
* @return int
*
* @since 1.0.0
*/
public function getId() : int
{
return $this->id;
}
/**
* Get info path
*
* @return string
*
* @since 1.0.0
*/
public function getPath() : string
{
return $this->path;
}
/**
* Get info path
*
* @return string
*
* @since 1.0.0
*/
public function getInterfacePath() : string
{
return $this->info['path'];
}
/**
* Get info name
*
* @return string
*
* @since 1.0.0
*/
public function getName() : string
{
return $this->info['name'];
}
/**
* Provides import interface
*
* @return bool
*
* @since 1.0.0
*/
public function hasImport() : bool
{
return $this->info['import'];
}
/**
* Provides export interface
*
* @return bool
*
* @since 1.0.0
*/
public function hasExport() : bool
{
return $this->info['export'];
}
/**
* Load info data from path.
*
* @return void
*
* @throws PathException This exception is thrown in case the info file path doesn't exist.
*
* @since 1.0.0
*/
public function load() : void
{
if (!\file_exists($this->path)) {
throw new PathException($this->path);
}
$content = \file_get_contents($this->path);
$this->info = \json_decode($content !== false ? $content : '[]', true);
}
/**
* Update info file
*
* @return void
*
* @since 1.0.0
*/
public function update() : void
{
if (!\file_exists($this->path)) {
throw new PathException($this->path);
}
\file_put_contents($this->path, \json_encode($this->info, JSON_PRETTY_PRINT));
}
/**
* Set data
*
* @param string $path Value path
* @param mixed $data Scalar or array of data to set
* @param string $delim Delimiter of path
*
* @return void
*
* @since 1.0.0
*/
public function set(string $path, $data, string $delim = '/') : void
{
if (!\is_scalar($data) && !\is_array($data) && !($data instanceof \JsonSerializable)) {
throw new \InvalidArgumentException('Type of $data "' . \gettype($data) . '" is not supported.');
}
ArrayUtils::setArray($path, $this->info, $data, $delim, true);
}
/**
* Get info data.
*
* @return array<string, mixed>
*
* @since 1.0.0
*/
public function get() : array
{
return $this->info;
}
}
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package phpOMS\Module
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Exchange\Models;
use phpOMS\System\File\PathException;
use phpOMS\Utils\ArrayUtils;
/**
* InfoManager class.
*
* Handling the info files for modules
*
* @package phpOMS\Module
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class InterfaceManager
{
/**
* Interface ID.
*
* @var int
* @since 1.0.0
*/
private $id = 0;
/**
* File path.
*
* @var string
* @since 1.0.0
*/
private $path = '';
/**
* Info data.
*
* @var array<string, mixed>
* @since 1.0.0
*/
private $info = [];
/**
* Object constructor.
*
* @param string $path Info file path
*
* @since 1.0.0
*/
public function __construct(string $path = '')
{
$this->path = $path;
}
/**
* Get id
*
* @return int
*
* @since 1.0.0
*/
public function getId() : int
{
return $this->id;
}
/**
* Get info path
*
* @return string
*
* @since 1.0.0
*/
public function getPath() : string
{
return $this->path;
}
/**
* Get info path
*
* @return string
*
* @since 1.0.0
*/
public function getInterfacePath() : string
{
return $this->info['path'];
}
/**
* Get info name
*
* @return string
*
* @since 1.0.0
*/
public function getName() : string
{
return $this->info['name'];
}
/**
* Provides import interface
*
* @return bool
*
* @since 1.0.0
*/
public function hasImport() : bool
{
return $this->info['import'];
}
/**
* Provides export interface
*
* @return bool
*
* @since 1.0.0
*/
public function hasExport() : bool
{
return $this->info['export'];
}
/**
* Load info data from path.
*
* @return void
*
* @throws PathException this exception is thrown in case the info file path doesn't exist
*
* @since 1.0.0
*/
public function load() : void
{
if (!\file_exists($this->path)) {
throw new PathException($this->path);
}
$content = \file_get_contents($this->path);
$this->info = \json_decode($content !== false ? $content : '[]', true);
}
/**
* Update info file
*
* @return void
*
* @since 1.0.0
*/
public function update() : void
{
if (!\file_exists($this->path)) {
throw new PathException($this->path);
}
\file_put_contents($this->path, \json_encode($this->info, \JSON_PRETTY_PRINT));
}
/**
* Set data
*
* @param string $path Value path
* @param mixed $data Scalar or array of data to set
* @param string $delim Delimiter of path
*
* @return void
*
* @since 1.0.0
*/
public function set(string $path, $data, string $delim = '/') : void
{
if (!\is_scalar($data) && !\is_array($data) && !($data instanceof \JsonSerializable)) {
throw new \InvalidArgumentException('Type of $data "' . \gettype($data) . '" is not supported.');
}
ArrayUtils::setArray($path, $this->info, $data, $delim, true);
}
/**
* Get info data.
*
* @return array<string, mixed>
*
* @since 1.0.0
*/
public function get() : array
{
return $this->info;
}
}

View File

@ -1,61 +1,61 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\Exchange
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Exchange\Models;
use phpOMS\DataStorage\Database\DataMapperAbstract;
/**
* Mapper class.
*
* @package Modules\Exchange
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
final class InterfaceManagerMapper extends DataMapperAbstract
{
/**
* Columns.
*
* @var array<string, array<string, bool|string>>
* @since 1.0.0
*/
protected static $columns = [
'exchange_id' => ['name' => 'exchange_id', 'type' => 'int', 'internal' => 'id'],
'exchange_title' => ['name' => 'exchange_title', 'type' => 'string', 'internal' => 'info/name'],
'exchange_path' => ['name' => 'exchange_path', 'type' => 'string', 'internal' => 'info/path'],
'exchange_version' => ['name' => 'exchange_version', 'type' => 'string', 'internal' => 'info/version'],
'exchange_export' => ['name' => 'exchange_export', 'type' => 'bool', 'internal' => 'info/export'],
'exchange_import' => ['name' => 'exchange_import', 'type' => 'bool', 'internal' => 'info/import'],
'exchange_website' => ['name' => 'exchange_website', 'type' => 'string', 'internal' => 'info/website'],
];
/**
* Primary table.
*
* @var string
* @since 1.0.0
*/
protected static $table = 'exchange';
/**
* Primary field name.
*
* @var string
* @since 1.0.0
*/
protected static $primaryField = 'exchange_id';
}
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\Exchange
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Exchange\Models;
use phpOMS\DataStorage\Database\DataMapperAbstract;
/**
* Mapper class.
*
* @package Modules\Exchange
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
final class InterfaceManagerMapper extends DataMapperAbstract
{
/**
* Columns.
*
* @var array<string, array<string, bool|string>>
* @since 1.0.0
*/
protected static $columns = [
'exchange_id' => ['name' => 'exchange_id', 'type' => 'int', 'internal' => 'id'],
'exchange_title' => ['name' => 'exchange_title', 'type' => 'string', 'internal' => 'info/name'],
'exchange_path' => ['name' => 'exchange_path', 'type' => 'string', 'internal' => 'info/path'],
'exchange_version' => ['name' => 'exchange_version', 'type' => 'string', 'internal' => 'info/version'],
'exchange_export' => ['name' => 'exchange_export', 'type' => 'bool', 'internal' => 'info/export'],
'exchange_import' => ['name' => 'exchange_import', 'type' => 'bool', 'internal' => 'info/import'],
'exchange_website' => ['name' => 'exchange_website', 'type' => 'string', 'internal' => 'info/website'],
];
/**
* Primary table.
*
* @var string
* @since 1.0.0
*/
protected static $table = 'exchange';
/**
* Primary field name.
*
* @var string
* @since 1.0.0
*/
protected static $primaryField = 'exchange_id';
}

View File

@ -1,32 +1,32 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\Exchange
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Exchange\Models;
use phpOMS\Stdlib\Base\Enum;
/**
* Permision state enum.
*
* @package Modules\Exchange
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
abstract class PermissionState extends Enum
{
public const IMPORT = 1;
public const EXPORT = 2;
public const DASHBOARD = 3;
}
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\Exchange
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Exchange\Models;
use phpOMS\Stdlib\Base\Enum;
/**
* Permision state enum.
*
* @package Modules\Exchange
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
abstract class PermissionState extends Enum
{
public const IMPORT = 1;
public const EXPORT = 2;
public const DASHBOARD = 3;
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
/**
* Orange Management
*

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
/**
* Orange Management
*

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
/**
* Orange Management
*
@ -14,4 +14,4 @@
/**
* @var \phpOMS\Views\View $this
*/
echo $this->getData('nav')->render(); ?>
echo $this->getData('nav')->render();

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
/**
* Orange Management
*

View File

@ -1,17 +1,17 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
/**
<?php declare(strict_types=1);
/**
* Orange Management
*
* PHP Version 7.2
*
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
/**
* @var \phpOMS\Views\View $this
*/
echo $this->getData('nav')->render(); ?>
*/
echo $this->getData('nav')->render();

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
/**
* Orange Management
*

View File

@ -1,21 +1,21 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
$lang = $this->getData('lang');
/**
<?php declare(strict_types=1);
/**
* Orange Management
*
* PHP Version 7.2
*
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
$lang = $this->getData('lang');
/**
* @var \phpOMS\Views\View $this
*/
echo $this->getData('nav')->render();
include __DIR__ . '/../../Interfaces/' . $this->getData('interface')->getInterfacePath() . '/import.tpl.php';
*/
echo $this->getData('nav')->render();
include __DIR__ . '/../../Interfaces/' . $this->getData('interface')->getInterfacePath() . '/import.tpl.php';