chore: major code cleanup and type safety using phpstan
This commit is contained in:
1 parent
060cbea9da
commit
3da73d626b
103 files changed
+976
-1192
No files matched your search
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\BusProNet\XmlParser;
|
||||
|
||||
@@ -15,10 +16,11 @@ class ProductsParser extends AbstractParser
|
||||
$result
|
||||
->filterXPath('//produkte/produkt')
|
||||
->each(function (Crawler $node) use (&$products) {
|
||||
if (false === empty($node->attr('code'))) {
|
||||
$code = $node->attr('code');
|
||||
if (null !== $code && '' !== $code) {
|
||||
$product = new Product();
|
||||
$product->id = (int) $node->attr('id');
|
||||
$product->code = (string) $node->attr('code');
|
||||
$product->code = $code;
|
||||
$product->name = (string) $node->attr('bezeichnung');
|
||||
|
||||
$products[$product->id] = $product;
|
||||
|
||||
Reference in new issue
Block a user