mirror of
https://github.com/Karaka-Management/oms-Exchange.git
synced 2026-02-18 18:48:41 +00:00
phpcs, static and unit test fixes
This commit is contained in:
parent
408d2fcf1a
commit
298a63dfdf
|
|
@ -32,6 +32,14 @@ use phpOMS\System\File\Local\Directory;
|
|||
*/
|
||||
final class Installer extends InstallerAbstract
|
||||
{
|
||||
/**
|
||||
* Path of the file
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const PATH = __DIR__;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -26,4 +26,11 @@ use phpOMS\Module\StatusAbstract;
|
|||
*/
|
||||
final class Status extends StatusAbstract
|
||||
{
|
||||
/**
|
||||
* Path of the file
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const PATH = __DIR__;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,13 @@ use phpOMS\Module\UninstallerAbstract;
|
|||
* @link https://orange-management.org
|
||||
* @since 1.0.0
|
||||
*/
|
||||
final class Uninstaller extends UninstallerAbstract
|
||||
final class Installer extends InstallerAbstract
|
||||
{
|
||||
/**
|
||||
* Path of the file
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const PATH = __DIR__;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ final class Importer extends ImporterAbstract
|
|||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
* @return bool
|
||||
* @return array
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -142,7 +142,7 @@ final class Importer extends ImporterAbstract
|
|||
$this->account = $request->header->account;
|
||||
|
||||
if ($this->remote->getStatus() !== DatabaseStatus::OK) {
|
||||
return false;
|
||||
return [];
|
||||
}
|
||||
|
||||
if (((bool) ($request->getData('customers') ?? false))) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 8.0
|
||||
*
|
||||
* @package Modules\Exchange\Interfaces\OMS\Exporter
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link https://orange-management.org
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
|
@ -121,6 +121,11 @@ final class Exporter extends ExporterAbstract
|
|||
|
||||
$basePath = __DIR__ . '/../../../';
|
||||
$modules = \scandir($basePath);
|
||||
|
||||
if ($modules === false) {
|
||||
return [];
|
||||
}
|
||||
|
||||
foreach ($modules as $module) {
|
||||
$themePath = $basePath . $module . '/Theme/';
|
||||
|
||||
|
|
@ -131,8 +136,12 @@ final class Exporter extends ExporterAbstract
|
|||
}
|
||||
|
||||
$module = \trim($module, '/');
|
||||
|
||||
$themes = \scandir($themePath);
|
||||
|
||||
if ($themes === false) {
|
||||
continue; // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
foreach ($themes as $theme) {
|
||||
$theme = \trim($theme, '/');
|
||||
$langPath = $themePath . $theme . '/Lang/';
|
||||
|
|
@ -144,6 +153,10 @@ final class Exporter extends ExporterAbstract
|
|||
}
|
||||
|
||||
$languages = \scandir($themePath . $theme . '/Lang/');
|
||||
if ($languages === false) {
|
||||
continue; // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
foreach ($languages as $language) {
|
||||
if (\stripos($language, '.lang.') === false || $language === '.' || $language === '..') {
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 8.0
|
||||
*
|
||||
* @package Modules\Exchange\Interfaces\OMS\Import
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link https://orange-management.org
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
|
@ -141,6 +141,10 @@ final class Importer extends ImporterAbstract
|
|||
$upload = ApiController::uploadFilesToDestination($request->getFiles());
|
||||
|
||||
$fp = \fopen($upload['file0']['path'] . '/' . $upload['file0']['filename'], 'r');
|
||||
if ($fp === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
$header = \fgetcsv($fp, 0, ';', '"');
|
||||
|
||||
$languageArray = [];
|
||||
|
|
|
|||
|
|
@ -67,9 +67,7 @@ class ExchangeLog implements \JsonSerializable, ArrayableInterface
|
|||
* @var int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public int |
|
||||
|
||||
InterfaceManager $exchange = 0;
|
||||
public int|InterfaceManager $exchange = 0;
|
||||
|
||||
/**
|
||||
* Date type.
|
||||
|
|
@ -85,9 +83,7 @@ InterfaceManager $exchange = 0;
|
|||
* @var int|Account
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public int |
|
||||
|
||||
Account $createdBy = 0;
|
||||
public int|Account $createdBy = 0;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user