Skip to content

Commit

Permalink
php CS
Browse files Browse the repository at this point in the history
  • Loading branch information
Bukashk0zzz committed Sep 5, 2024
1 parent 63d5b56 commit 81c4439
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,10 @@
"psr-4": {
"Bukashk0zzz\\YmlGenerator\\Tests\\": "tests/"
}
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
26 changes: 13 additions & 13 deletions src/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ protected function addHeader()
$this->writer->startDTD('yml_catalog', null, 'shops.dtd');
$this->writer->endDTD();
$this->writer->startElement('yml_catalog');
$this->writer->writeAttribute('date', \date(DATE_RFC3339));
$this->writer->writeAttribute('date', \date(\DATE_RFC3339));
$this->writer->startElement('shop');
}

Expand Down Expand Up @@ -339,21 +339,21 @@ private function addOfferParams(OfferInterface $offer)
*/
private function addOfferOutlets(OfferInterface $offer)
{
if ($offer->getOutlets() && sizeof($offer->getOutlets())) {
$this->writer->startElement('outlets');
/** @var OfferOutlet $outlet */
foreach ($offer->getOutlets() as $outlet) {
if ($outlet instanceof OfferOutlet) {
$this->writer->startElement('outlet');
if ($offer->getOutlets() && \count($offer->getOutlets())) {
$this->writer->startElement('outlets');
/** @var OfferOutlet $outlet */
foreach ($offer->getOutlets() as $outlet) {
if ($outlet instanceof OfferOutlet) {
$this->writer->startElement('outlet');

$this->writer->writeAttribute('id', $outlet->getId());
$this->writer->writeAttribute('instock', $outlet->getInStock());
$this->writer->writeAttribute('id', $outlet->getId());
$this->writer->writeAttribute('instock', $outlet->getInStock());

$this->writer->endElement();
}
$this->writer->endElement();
}
}
$this->writer->fullEndElement();
}
$this->writer->fullEndElement();
}
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Model/Offer/AbstractOffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ public function addParam(OfferParam $param)
*/
public function getOutlets()
{
return $this->outlets;
return $this->outlets;
}

/**
Expand All @@ -732,9 +732,9 @@ public function getOutlets()
*/
public function addOutlet(OfferOutlet $outlet)
{
$this->outlets[] = $outlet;
$this->outlets[] = $outlet;

return $this;
return $this;
}

/**
Expand Down
1 change: 0 additions & 1 deletion src/Model/Offer/OfferOutlet.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,4 @@ public function setInStock($inStock)

return $this;
}

}

0 comments on commit 81c4439

Please sign in to comment.