app/Integrations/Magento/Controller.php
Missing class import via use statement (line '45', column '15'). Open
Open
throw new \App\Exceptions\AppException('ERR_CLASS_NOT_FOUND');
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid using static access to class 'App\Integrations\Magento\Config' in method 'updateStock'. Open
Open
foreach (Config::getAllServers() as $serverId => $config) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Integrations\Magento\Config' in method '__construct'. Open
Open
$this->config = \App\Integrations\Magento\Config::getInstance($serverId);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Expected an object instance or the name of a class but saw expression with type 'Token'|string
Open
Open
$this->connector = new $className($this->config);
- Exclude checks
Reference to undeclared class \Token
Open
Open
$this->connector = new $className($this->config);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Connector with magento.
- Exclude checks
Line exceeds 120 characters; contains 182 characters Open
Open
* The file is part of the paid functionality. Using the file is allowed only after purchasing a subscription. File modification allowed only with the consent of the system producer.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @var \App\Integrations\Magento\Config
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Config.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $config;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Synchronize products.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$orderSynchronizer = new Synchronizer\Order($this);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
foreach (Config::getAllServers() as $serverId => $config) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if (empty($this->connector)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Synchronize categories for products.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$productSynchronizer = new Synchronizer\Product($this);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @throws AppException
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function synchronizeCurrencies(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$invoiceSynchronizer->process();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$className = '\\App\\Integrations\\Magento\\Connector\\' . $this->config->get('connector') ?? 'Token';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$orderSynchronizer->process();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$customerSynchronizer = new Synchronizer\Customer($this);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
throw new \App\Exceptions\AppException('ERR_CLASS_NOT_FOUND');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function __construct(int $serverId)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function synchronizeCustomers(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$customerSynchronizer->process();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->connector = new $className($this->config);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @param int $serverId
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->getConnector()->authorize();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$productSynchronizer->process();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$customerSynchronizer = new Synchronizer\InventoryStock(new self($serverId));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @return void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Synchronize products.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function synchronizeInvoices(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function synchronizeOrders(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Synchronize currencies for products.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$currencySynchronizer->process();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Synchronize orders.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @param int $product
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
throw new AppException('ERR_CLASS_MUST_BE||\App\Integrations\Magento\Connector\Base');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function synchronizeCategories(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @return void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if (!class_exists($className)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return $this->connector;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function synchronizeProducts(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Constructor. Connect with magento and authorize.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @return void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if (0 === (int) $config['status'] || 'None' === $config['storage_quantity_location']) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @return void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Update inventory stock in all magento.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @param int $storageId
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$customerSynchronizer->product = $product;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$customerSynchronizer->process();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public static function updateStock(int $storageId, int $product): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $connector;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function getConnector()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$categorySynchronizer = new Synchronizer\Category($this);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Returns connector.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @return object
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$categorySynchronizer->process();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Synchronize orders.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @throws AppException
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
continue;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->config = \App\Integrations\Magento\Config::getInstance($serverId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$currencySynchronizer = new Synchronizer\Currency($this);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @throws AppException
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if (!$this->connector instanceof \App\Integrations\Magento\Connector\Base) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$invoiceSynchronizer = new Synchronizer\Invoice($this);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$customerSynchronizer->storageId = $storageId;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks