Passed
Pull Request — master (#41)
by Dmitrii
15:49
created

HelloSprykerBusinessFactory::createStringWriter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Pyz\Zed\HelloSpryker\Business;
4
5
use Pyz\Zed\HelloSpryker\Business\Reader\StringReader;
6
use Pyz\Zed\HelloSpryker\Business\Reader\StringReaderInterface;
7
use Pyz\Zed\HelloSpryker\Business\Reverser\StringReverser;
8
use Pyz\Zed\HelloSpryker\Business\Reverser\StringReverserInterface;
9
use Pyz\Zed\HelloSpryker\Business\Writer\StringWriter;
10
use Pyz\Zed\HelloSpryker\Business\Writer\StringWriterInterface;
11
use Spryker\Zed\Kernel\Business\AbstractBusinessFactory;
12
13
class HelloSprykerBusinessFactory extends AbstractBusinessFactory
14
{
15
    /**
16
     * @return \Pyz\Zed\HelloSpryker\Business\Reverser\StringReverserInterface
17
     */
18
    public function createStringReverser(): StringReverserInterface
19
    {
20
        return new StringReverser();
21
    }
22
23
    /**
24
     * @return \Pyz\Zed\HelloSpryker\Business\Reader\StringReaderInterface
25
     */
26
    public function createStringReader(): StringReaderInterface
27
    {
28
        return new StringReader($this->getRepository());
0 ignored issues
show
Bug introduced by
$this->getRepository() of type Spryker\Zed\Kernel\Persistence\AbstractRepository is incompatible with the type Pyz\Zed\HelloSpryker\Per...ykerRepositoryInterface expected by parameter $helloSprykerRepository of Pyz\Zed\HelloSpryker\Bus...ngReader::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

28
        return new StringReader(/** @scrutinizer ignore-type */ $this->getRepository());
Loading history...
29
    }
30
31
    /**
32
     * @return \Pyz\Zed\HelloSpryker\Business\Writer\StringWriterInterface
33
     */
34
    public function createStringWriter(): StringWriterInterface
35
    {
36
        return new StringWriter($this->getEntityManager());
0 ignored issues
show
Bug introduced by
$this->getEntityManager() of type Spryker\Zed\Kernel\Persi...e\AbstractEntityManager is incompatible with the type Pyz\Zed\HelloSpryker\Per...rEntityManagerInterface expected by parameter $helloSprykerEntityManager of Pyz\Zed\HelloSpryker\Bus...ngWriter::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

36
        return new StringWriter(/** @scrutinizer ignore-type */ $this->getEntityManager());
Loading history...
37
    }
38
}
39