Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
6 / 6 |
PropertyExtractorFactory | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
6 / 6 |
build(LoggerInterface $logger) | |
100.00% |
1 / 1 |
1 | |
100.00% |
3 / 3 |
|||
getReader(LoggerInterface $logger) | |
100.00% |
1 / 1 |
1 | |
100.00% |
3 / 3 |
<?php | |
/** | |
* @author Krzysztof Gzocha <krzysztof.gzocha@xsolve.pl> | |
*/ | |
namespace Team3\PayU\PropertyExtractor; | |
use Psr\Log\LoggerInterface; | |
use Team3\PayU\PropertyExtractor\Reader\AnnotationReader; | |
use Team3\PayU\PropertyExtractor\Reader\ReaderInterface; | |
use Doctrine\Common\Annotations\AnnotationReader as DoctrineAnnotationReader; | |
/** | |
* Will return {@link ExtractorInterface} | |
* | |
* Class PropertyExtractorFactory | |
* @package Team3\PayU\PropertyExtractor | |
*/ | |
class PropertyExtractorFactory implements PropertyExtractorFactoryInterface | |
{ | |
/** | |
* @param LoggerInterface $logger | |
* | |
* @return Extractor | |
*/ | |
public function build(LoggerInterface $logger) | |
{ | |
return new Extractor( | |
$this->getReader($logger), | |
$logger | |
); | |
} | |
/** | |
* @param LoggerInterface $logger | |
* @return ReaderInterface | |
*/ | |
private function getReader(LoggerInterface $logger) | |
{ | |
return new AnnotationReader( | |
new DoctrineAnnotationReader(), | |
$logger | |
); | |
} | |
} |