YetiForceCompany/YetiForceCRM

View on GitHub
app/Integrations/Magento/Synchronizer/Maps/Product.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Missing class import via use statement (line '73', column '26').
Open

            $this->category = new \App\Integrations\Magento\Synchronizer\Category($this->synchronizer->controller);

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

Cannot assign void return value
Open

                $crmId = $this->category->createCategory($category);

Assigning false to property but \App\Integrations\Magento\Synchronizer\Maps\Product->category is \App\Integrations\Magento\Synchronizer\Category
Open

    public $category = false;

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used to indent lines; tabs are not allowed
Open

     * Discontinued value map.

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

        if (false === $this->category) {

Spaces must be used to indent lines; tabs are not allowed
Open

        $parsedCategories = [];

Spaces must be used to indent lines; tabs are not allowed
Open

            $parsedCategories[] = $crmId;

Spaces must be used to indent lines; tabs are not allowed
Open

        return $parsedCategories;

Line exceeds 120 characters; contains 182 characters
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.

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used to indent lines; tabs are not allowed
Open

     * @var array

Spaces must be used to indent lines; tabs are not allowed
Open

    public static $additionalFieldsCrm = [

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

        'discontinued' => 'status',

Spaces must be used to indent lines; tabs are not allowed
Open

        'ean' => 'sku',

Spaces must be used to indent lines; tabs are not allowed
Open

        'categories' => 'custom_attributes|category_ids',

Spaces must be used to indent lines; tabs are not allowed
Open

        'unit_price' => '0',

Spaces must be used to indent lines; tabs are not allowed
Open

    public static $fieldsType = [

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

    public $category = false;

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

        $categories = $this->getCustomAttributeValue('category_ids') ?: [];

Spaces must be used to indent lines; tabs are not allowed
Open

    public static $fieldsDefaultValue = [

Spaces must be used to indent lines; tabs are not allowed
Open

     * Category model.

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

    public function getCrmCategories(): array

Spaces must be used to indent lines; tabs are not allowed
Open

            }

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

            if (empty($crmId)) {

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    ];

Spaces must be used to indent lines; tabs are not allowed
Open

        '2' => '0',

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

        'purchase' => '0',

Spaces must be used to indent lines; tabs are not allowed
Open

        'discontinued' => 'map',

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used to indent lines; tabs are not allowed
Open

    public static $discontinued = [

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

    public static $mappedFields = [

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

        foreach ($categories as $category) {

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

    ];

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

            $this->category = new \App\Integrations\Magento\Synchronizer\Category($this->synchronizer->controller);

Spaces must be used to indent lines; tabs are not allowed
Open

     * @var \App\Integrations\Magento\Synchronizer\Category

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

                $crmId = $this->category->createCategory($category);

Spaces must be used to indent lines; tabs are not allowed
Open

        'productname' => 'name',

Spaces must be used to indent lines; tabs are not allowed
Open

        'description' => '',

Spaces must be used to indent lines; tabs are not allowed
Open

        '1' => '1',

Spaces must be used to indent lines; tabs are not allowed
Open

     * Method to get parsed categories ids.

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return array

Spaces must be used to indent lines; tabs are not allowed
Open

            $crmId = $this->category->getCrmId($category);

Spaces must be used to indent lines; tabs are not allowed
Open

        'description' => 'custom_attributes|description',

Spaces must be used to indent lines; tabs are not allowed
Open

    ];

Spaces must be used to indent lines; tabs are not allowed
Open

    ];

Spaces must be used to indent lines; tabs are not allowed
Open

    ];

There are no issues that match your filters.

Category
Status