Passed
Push — karoly/akeneo-skeleton ( dfb631 )
by Karoly
05:38
created

AkeneoPimFacade   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 20
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A syncProductConcretes() 0 3 1
A syncCategories() 0 3 1
1
<?php
2
3
/**
4
 * Copyright © 2016-present Spryker Systems GmbH. All rights reserved.
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace Spryker\Zed\AkeneoPim\Business;
9
10
use Generated\Shared\Transfer\AkeneoCategorySyncConfigTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...egorySyncConfigTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Generated\Shared\Transfer\AkeneoProductConcreteConfigTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...tConcreteConfigTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use Generated\Shared\Transfer\AkeneoProductConcreteSyncConfigTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...creteSyncConfigTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
use Generated\Shared\Transfer\AkeneoSyncResultTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\AkeneoSyncResultTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
use Spryker\Zed\Kernel\Business\AbstractFacade;
15
16
/**
17
 * @method \Spryker\Zed\AkeneoPim\Business\AkeneoPimBusinessFactory getFactory()
18
 * @method \Spryker\Zed\AkeneoPim\Persistence\AkeneoPimEntityManagerInterface getEntityManager()
19
 * @method \Spryker\Zed\AkeneoPim\Persistence\AkeneoPimRepositoryInterface getRepository()
20
 */
21
class AkeneoPimFacade extends AbstractFacade implements AkeneoPimFacadeInterface
22
{
23
    /**
24
     * @param AkeneoProductConcreteSyncConfigTransfer $productConcreteSyncConfigTransfer
25
     *
26
     * @return AkeneoSyncResultTransfer
27
     */
28
    public function syncProductConcretes(AkeneoProductConcreteSyncConfigTransfer $productConcreteSyncConfigTransfer): AkeneoSyncResultTransfer
29
    {
30
        $this->getFactory()->createProductConcreteSyncer()->sync($productConcreteSyncConfigTransfer);
0 ignored issues
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return Generated\Shared\Transfer\AkeneoSyncResultTransfer. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
31
    }
32
33
    /**
34
     * @param AkeneoCategorySyncConfigTransfer $categorySyncConfigTransfer
35
     *
36
     * @return AkeneoSyncResultTransfer
37
     */
38
    public function syncCategories(AkeneoCategorySyncConfigTransfer $categorySyncConfigTransfer): AkeneoSyncResultTransfer
39
    {
40
        $this->getFactory()->createProductConcreteSyncer()->sync($categorySyncConfigTransfer);
0 ignored issues
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return Generated\Shared\Transfer\AkeneoSyncResultTransfer. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
41
    }
42
}
43