| @@ -52,10 +52,10 @@ | ||
| 52 | 52 | */ | 
| 53 | 53 | public function parse() | 
| 54 | 54 |      { | 
| 55 | -        foreach($this->parser->parse($this->inputFile) as $item) { | |
| 55 | +        foreach ($this->parser->parse($this->inputFile) as $item) { | |
| 56 | 56 | $writer = WriterFactory::create($item['type'], $this->config); | 
| 57 | 57 | |
| 58 | -            if($writer) { | |
| 58 | +            if ($writer) { | |
| 59 | 59 | $writer->write($item); | 
| 60 | 60 | } | 
| 61 | 61 | } | 
| @@ -20,7 +20,7 @@ | ||
| 20 | 20 | public static function create($class) | 
| 21 | 21 |      { | 
| 22 | 22 | $className = 'Fillet\\Parser\\' . ucfirst($class); | 
| 23 | -        if(class_exists($className)) { | |
| 23 | +        if (class_exists($className)) { | |
| 24 | 24 | /** @var ParserInterface $parser */ | 
| 25 | 25 | $parser = new $className(); | 
| 26 | 26 | return $parser; | 
| @@ -25,7 +25,7 @@ discard block | ||
| 25 | 25 | |
| 26 | 26 | while ($reader->read() && $reader->name !== 'item'); | 
| 27 | 27 | |
| 28 | -        while($reader->name == 'item') { | |
| 28 | +        while ($reader->name == 'item') { | |
| 29 | 29 | $xml = simplexml_import_dom($dom->importNode($reader->expand(), true)); | 
| 30 | 30 | $wpItems = $xml->children($WPNamespace); | 
| 31 | 31 | $content = $xml->children($DCNamespace)->encoded; | 
| @@ -33,17 +33,17 @@ discard block | ||
| 33 | 33 | $categories = []; | 
| 34 | 34 | $tags = []; | 
| 35 | 35 | |
| 36 | -            foreach($xml->category as $category) { | |
| 37 | -                if('category' == $category->attributes()->domain) { | |
| 36 | +            foreach ($xml->category as $category) { | |
| 37 | +                if ('category' == $category->attributes()->domain) { | |
| 38 | 38 | $categories[] = (string)$category; | 
| 39 | 39 | } | 
| 40 | 40 | |
| 41 | -                if('post_tag' == $category->attributes()->domain) { | |
| 41 | +                if ('post_tag' == $category->attributes()->domain) { | |
| 42 | 42 | $tags[] = (string)$category; | 
| 43 | 43 | } | 
| 44 | 44 | } | 
| 45 | 45 | |
| 46 | -            if($wpItems) { | |
| 46 | +            if ($wpItems) { | |
| 47 | 47 | $post_type = (string)$wpItems->post_type; | 
| 48 | 48 | $data = [ | 
| 49 | 49 | 'type' => $post_type, | 
| @@ -22,13 +22,13 @@ | ||
| 22 | 22 | public static function create($postType, $config, $throwExceptionOnInvalidWriter = false) | 
| 23 | 23 |      { | 
| 24 | 24 | $className = 'Fillet\\Writer\\' . ucfirst($postType) . 'Writer'; | 
| 25 | -        if(class_exists($className)) { | |
| 25 | +        if (class_exists($className)) { | |
| 26 | 26 | /** @var WriterInterface $writer */ | 
| 27 | 27 | $writer = new $className($config['destinationFolders'][$postType], $config); | 
| 28 | 28 | return $writer; | 
| 29 | 29 | } | 
| 30 | 30 | |
| 31 | -        if($throwExceptionOnInvalidWriter) { | |
| 31 | +        if ($throwExceptionOnInvalidWriter) { | |
| 32 | 32 |              throw new \Exception('There is no writer for ' . $postType); | 
| 33 | 33 | } | 
| 34 | 34 | } |