Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pint.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"elements": {
"method": "one"
}
}
},
"single_line_empty_body" : false
},
"exclude": [],
"notPath": [
Expand Down
4 changes: 3 additions & 1 deletion src/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ class Parser
{
protected array $parsed = [];

public function __construct(protected string $file) {}
public function __construct(protected string $file)
{
}

public function validate(bool $useSchema = true): bool
{
Expand Down
4 changes: 3 additions & 1 deletion src/Parser/AssignmentNodeParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

class AssignmentNodeParser implements NodeParserInterface
{
public function __construct(protected XMLReader $reader) {}
public function __construct(protected XMLReader $reader)
{
}

public function isMatch(): bool
{
Expand Down
4 changes: 3 additions & 1 deletion src/Parser/BundleNodeParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ class BundleNodeParser implements NodeParserInterface

protected ?SimpleXMLElement $element = null;

public function __construct(protected XMLReader $reader) {}
public function __construct(protected XMLReader $reader)
{
}

public function isMatch(): bool
{
Expand Down
4 changes: 3 additions & 1 deletion src/Parser/CategoryNodeParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ class CategoryNodeParser implements NodeParserInterface
{
use CommonDetailsNodeParserTrait;

public function __construct(protected XMLReader $reader) {}
public function __construct(protected XMLReader $reader)
{
}

public function isMatch(): bool
{
Expand Down
4 changes: 3 additions & 1 deletion src/Parser/ProductNodeParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ class ProductNodeParser implements NodeParserInterface
use CommonDetailsNodeParserTrait;
protected ?SimpleXMLElement $element = null;

public function __construct(protected XMLReader $reader) {}
public function __construct(protected XMLReader $reader)
{
}

public function isMatch(): bool
{
Expand Down
4 changes: 3 additions & 1 deletion src/Parser/SetNodeParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ class SetNodeParser implements NodeParserInterface
use CommonDetailsNodeParserTrait;
protected SimpleXMLElement $element = null;

public function __construct(protected XMLReader $reader) {}
public function __construct(protected XMLReader $reader)
{
}

public function isMatch(): bool
{
Expand Down
4 changes: 3 additions & 1 deletion src/Parser/VariationNodeParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ class VariationNodeParser implements NodeParserInterface
use CommonDetailsNodeParserTrait;
protected ?SimpleXMLElement $element = null;

public function __construct(protected XMLReader $reader) {}
public function __construct(protected XMLReader $reader)
{
}

public function isMatch(): bool
{
Expand Down
4 changes: 3 additions & 1 deletion src/Writer/Entity/Assignment.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ class Assignment implements WriteableEntityInteface
{
public ?bool $primary = null;

public function __construct(public string $productId, public string $categoryId) {}
public function __construct(public string $productId, public string $categoryId)
{
}

public function setPrimary(bool $primary): void
{
Expand Down
4 changes: 3 additions & 1 deletion src/Writer/Entity/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ class Category implements WriteableEntityInteface
public array $pageAttributes = [];
public array $customAttributes = [];

public function __construct(public string $id) {}
public function __construct(public string $id)
{
}

public function setDisplayName(string $displayName): void
{
Expand Down
4 changes: 3 additions & 1 deletion src/Writer/Entity/CustomAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

class CustomAttribute implements WriteableEntityInteface
{
public function __construct(public string $id, public $value = null) {}
public function __construct(public string $id, public $value = null)
{
}

public function write(XmlWriter $writer): void
{
Expand Down
4 changes: 3 additions & 1 deletion src/Writer/Entity/DeletedAssignment.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

class DeletedAssignment implements WriteableEntityInteface
{
public function __construct(public string $productId, public string $categoryId) {}
public function __construct(public string $productId, public string $categoryId)
{
}

public function write(XmlWriter $writer): void
{
Expand Down
4 changes: 3 additions & 1 deletion src/Writer/Entity/DeletedCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

class DeletedCategory implements WriteableEntityInteface
{
public function __construct(public string $id) {}
public function __construct(public string $id)
{
}

public function write(XmlWriter $writer): void
{
Expand Down
4 changes: 3 additions & 1 deletion src/Writer/Entity/DeletedProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

class DeletedProduct implements WriteableEntityInteface
{
public function __construct(public string $id) {}
public function __construct(public string $id)
{
}

public function write(XmlWriter $writer): void
{
Expand Down
4 changes: 3 additions & 1 deletion src/Writer/Entity/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ class Product implements WriteableEntityInteface
public ?string $classificationCatalogId = null;
public array $variationGroups = [];

public function __construct(public string $id) {}
public function __construct(public string $id)
{
}

public function setUpc(string $upc): void
{
Expand Down
4 changes: 3 additions & 1 deletion src/Writer/Entity/Variant.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ class Variant implements WriteableEntityInteface
{
public array $displayValues = [];

public function __construct(public string $id) {}
public function __construct(public string $id)
{
}

public function addDisplayValue(string $value, string $displayValue): void
{
Expand Down
4 changes: 3 additions & 1 deletion src/Writer/EntityWriter/AssignmentXmlWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

class AssignmentXmlWriter
{
public function __construct(private XmlWriter $writer, private Assignment $assignment) {}
public function __construct(private XmlWriter $writer, private Assignment $assignment)
{
}

public function write(): void
{
Expand Down
4 changes: 3 additions & 1 deletion src/Writer/EntityWriter/CategoryXmlWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

class CategoryXmlWriter
{
public function __construct(private XmlWriter $writer, private Category $category) {}
public function __construct(private XmlWriter $writer, private Category $category)
{
}

public function write(): void
{
Expand Down
4 changes: 3 additions & 1 deletion src/Writer/EntityWriter/CustomAttributeWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ class CustomAttributeWriter
{
public const MAX_VALUES = 200;

public function __construct(private XmlWriter $writer, private CustomAttribute $customAttribute) {}
public function __construct(private XmlWriter $writer, private CustomAttribute $customAttribute)
{
}

public function write(): void
{
Expand Down
4 changes: 3 additions & 1 deletion src/Writer/EntityWriter/DeletedAssignmentXmlWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

class DeletedAssignmentXmlWriter
{
public function __construct(private XmlWriter $writer, private DeletedAssignment $assignment) {}
public function __construct(private XmlWriter $writer, private DeletedAssignment $assignment)
{
}

public function write(): void
{
Expand Down
4 changes: 3 additions & 1 deletion src/Writer/EntityWriter/DeletedCategoryXmlWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

class DeletedCategoryXmlWriter
{
public function __construct(private XmlWriter $writer, private DeletedCategory $category) {}
public function __construct(private XmlWriter $writer, private DeletedCategory $category)
{
}

public function write(): void
{
Expand Down
4 changes: 3 additions & 1 deletion src/Writer/EntityWriter/DeletedProductXmlWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

class DeletedProductXmlWriter
{
public function __construct(private XmlWriter $writer, private DeletedProduct $product) {}
public function __construct(private XmlWriter $writer, private DeletedProduct $product)
{
}

public function write(): void
{
Expand Down
4 changes: 3 additions & 1 deletion src/Writer/EntityWriter/ProductXmlWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

class ProductXmlWriter
{
public function __construct(private XmlWriter $writer, private Product $product) {}
public function __construct(private XmlWriter $writer, private Product $product)
{
}

public function write(): void
{
Expand Down
4 changes: 3 additions & 1 deletion src/Writer/EntityWriter/VariantXmlWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

class VariantXmlWriter
{
public function __construct(private XmlWriter $writer, private Variant $variant) {}
public function __construct(private XmlWriter $writer, private Variant $variant)
{
}

public function write(): void
{
Expand Down
4 changes: 3 additions & 1 deletion src/Writer/Xml/NilEmptyWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

class NilEmptyWriter
{
public function __construct(private XmlWriter $writer) {}
public function __construct(private XmlWriter $writer)
{
}

public function writeElement($name, $content = null): bool
{
Expand Down
4 changes: 3 additions & 1 deletion src/Writer/Xml/NotEmptyWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

class NotEmptyWriter
{
public function __construct(private XmlWriter $writer) {}
public function __construct(private XmlWriter $writer)
{
}

public function writeElement($name, $content = null): bool
{
Expand Down
4 changes: 3 additions & 1 deletion src/Writer/Xml/XmlFormatterException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@

use Exception;

class XmlFormatterException extends Exception {}
class XmlFormatterException extends Exception
{
}
4 changes: 3 additions & 1 deletion src/XmlException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@
/**
* Extends the default Exception class for ease of catching errors thrown by this library
*/
class XmlException extends Exception {}
class XmlException extends Exception
{
}