Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(dependencies): composer lock update + CS Fix #19

Merged
merged 2 commits into from
Nov 9, 2023
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
2 changes: 1 addition & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
'@PSR1' => true,
'@PhpCsFixer' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
'@Symfony:risky' => false,
'native_function_invocation' => [
'include' => [\PhpCsFixer\Fixer\FunctionNotation\NativeFunctionInvocationFixer::SET_INTERNAL],
'scope' => 'namespaced',
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@
"ext-dom": "*",
"ext-libxml": "*",
"beberlei/assert": "@stable",
"jms/serializer": "^3.19.0",
"jms/serializer": "^3.28.0",
"psr/log": "^1.0 || ^2.0 || ^3.0"
},
"suggest": {
"symfony/routing": "If you want to use SelfAwareProfileRequestHandler"
},
"require-dev": {
"phpunit/phpunit": "^9.6.3",
"phpstan/phpstan": "^1.10.1",
"friendsofphp/php-cs-fixer": "^v3.14.4",
"phpunit/phpunit": "^9.6.13",
"phpstan/phpstan": "^1.10.41",
"friendsofphp/php-cs-fixer": "^v3.38.0",
"php-parallel-lint/php-parallel-lint": "^1.3.2",
"enlightn/security-checker": "^1.10",
"enlightn/security-checker": "^1.10.0",
"symfony/routing": "^4.4.44"
},
"autoload": {
Expand Down
4 changes: 2 additions & 2 deletions src/CXml/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Builder
private ?Status $status = null;
private ?string $locale;

private function __construct(string $senderUserAgent, ?string $locale = null, PayloadIdentityFactoryInterface $payloadIdentityFactory = null)
private function __construct(string $senderUserAgent, string $locale = null, PayloadIdentityFactoryInterface $payloadIdentityFactory = null)
{
$this->locale = $locale;
$this->payloadIdentityFactory = $payloadIdentityFactory ?? new DefaultPayloadIdentityFactory();
Expand All @@ -42,7 +42,7 @@ public static function create(string $senderUserAgent = 'cxml-php UserAgent', st
return new self($senderUserAgent, $locale, $payloadIdentityFactory);
}

public function payload(?PayloadInterface $payload = null): self
public function payload(PayloadInterface $payload = null): self
{
$this->payload = $payload;

Expand Down
20 changes: 10 additions & 10 deletions src/CXml/Builder/OrderRequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ public static function create(string $orderId, \DateTimeInterface $orderDate, st

public static function fromPunchOutOrderMessage(
PunchOutOrderMessage $punchOutOrderMessage,
?string $currency = null,
?string $orderId = null,
?\DateTimeInterface $orderDate = null,
string $currency = null,
string $orderId = null,
\DateTimeInterface $orderDate = null,
string $language = 'en'
): self {
if ($supplierOrderInfo = $punchOutOrderMessage->getPunchOutOrderMessageHeader()->getSupplierOrderInfo()) {
Expand Down Expand Up @@ -100,12 +100,12 @@ public static function fromPunchOutOrderMessage(
public function billTo(
string $name,
PostalAddress $postalAddress = null,
?string $addressId = null,
?string $addressIdDomain = null,
?string $email = null,
?string $phone = null,
?string $fax = null,
?string $url = null
string $addressId = null,
string $addressIdDomain = null,
string $email = null,
string $phone = null,
string $fax = null,
string $url = null
): self {
$this->billTo = new BillTo(
new Address(
Expand Down Expand Up @@ -212,7 +212,7 @@ public function addItem(
return $this;
}

public function addComment(?string $value = null, ?string $type = null, ?string $lang = null, ?string $attachmentUrl = null): self
public function addComment(string $value = null, string $type = null, string $lang = null, string $attachmentUrl = null): self
{
$this->comments[] = new Comment(
$value,
Expand Down
2 changes: 1 addition & 1 deletion src/CXml/Builder/ProductActivityMessageBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static function create(string $messageId, string $warehouseCodeDomain): s
return new self($messageId, $warehouseCodeDomain);
}

public function addProductActivityDetail(string $sku, string $warehouseCode, int $stockLevel, ?array $extrinsics = null): self
public function addProductActivityDetail(string $sku, string $warehouseCode, int $stockLevel, array $extrinsics = null): self
{
$inventory = Inventory::create()
->setStockOnHandQuantity(new InventoryQuantity($stockLevel, 'EA'))
Expand Down
10 changes: 5 additions & 5 deletions src/CXml/Builder/PunchOutOrderMessageBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ class PunchOutOrderMessageBuilder
private ?\DateTimeInterface $orderDate;
private ?ShipTo $shipTo = null;

private function __construct(string $language, string $buyerCookie, string $currency, ?string $operationAllowed = null)
private function __construct(string $language, string $buyerCookie, string $currency, string $operationAllowed = null)
{
$this->buyerCookie = $buyerCookie;
$this->currency = $currency;
$this->operationAllowed = $operationAllowed;
$this->language = $language;
}

public static function create(string $language, string $buyerCookie, string $currency, ?string $operationAllowed = null): self
public static function create(string $language, string $buyerCookie, string $currency, string $operationAllowed = null): self
{
return new self($language, $buyerCookie, $currency, $operationAllowed);
}
Expand Down Expand Up @@ -114,9 +114,9 @@ public function addPunchoutOrderMessageItem(
string $unitOfMeasure,
int $unitPrice,
array $classifications,
?string $manufacturerPartId = null,
?string $manufacturerName = null,
?int $leadTime = null,
string $manufacturerPartId = null,
string $manufacturerName = null,
int $leadTime = null,
array $extrinsics = null
): self {
$itemDetail = ItemDetail::create(
Expand Down
4 changes: 1 addition & 3 deletions src/CXml/Exception/CXmlConflictException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace CXml\Exception;

class CXmlConflictException extends CXmlException
{
}
class CXmlConflictException extends CXmlException {}
4 changes: 1 addition & 3 deletions src/CXml/Exception/CXmlExpectationFailedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace CXml\Exception;

class CXmlExpectationFailedException extends CXmlException
{
}
class CXmlExpectationFailedException extends CXmlException {}
4 changes: 1 addition & 3 deletions src/CXml/Exception/CXmlNotAcceptableException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace CXml\Exception;

class CXmlNotAcceptableException extends CXmlException
{
}
class CXmlNotAcceptableException extends CXmlException {}
4 changes: 1 addition & 3 deletions src/CXml/Exception/CXmlNotImplementedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace CXml\Exception;

class CXmlNotImplementedException extends CXmlException
{
}
class CXmlNotImplementedException extends CXmlException {}
4 changes: 1 addition & 3 deletions src/CXml/Exception/CXmlPreconditionFailedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace CXml\Exception;

class CXmlPreconditionFailedException extends CXmlException
{
}
class CXmlPreconditionFailedException extends CXmlException {}
2 changes: 1 addition & 1 deletion src/CXml/Model/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Address
*/
private ?string $url = null;

public function __construct(MultilanguageString $name, ?PostalAddress $postalAddress = null, ?string $addressId = null, ?string $addressIdDomain = null, ?string $email = null, ?string $phone = null, ?string $fax = null, ?string $url = null)
public function __construct(MultilanguageString $name, PostalAddress $postalAddress = null, string $addressId = null, string $addressIdDomain = null, string $email = null, string $phone = null, string $fax = null, string $url = null)
{
$this->addressId = $addressId;
$this->addressIdDomain = $addressIdDomain;
Expand Down
14 changes: 7 additions & 7 deletions src/CXml/Model/CXml.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ protected function __construct(
string $payloadId,
\DateTimeInterface $timestamp,
?Request $request,
?Response $response = null,
?Message $message = null,
?Header $header = null,
?string $lang = null
Response $response = null,
Message $message = null,
Header $header = null,
string $lang = null
) {
$this->request = $request;
$this->response = $response;
Expand All @@ -66,17 +66,17 @@ protected function __construct(
$this->lang = $lang;
}

public static function forMessage(PayloadIdentity $payloadIdentity, Message $message, Header $header, ?string $lang = null): self
public static function forMessage(PayloadIdentity $payloadIdentity, Message $message, Header $header, string $lang = null): self
{
return new self($payloadIdentity->getPayloadId(), $payloadIdentity->getTimestamp(), null, null, $message, $header, $lang);
}

public static function forRequest(PayloadIdentity $payloadIdentity, Request $request, Header $header, ?string $lang = null): self
public static function forRequest(PayloadIdentity $payloadIdentity, Request $request, Header $header, string $lang = null): self
{
return new self($payloadIdentity->getPayloadId(), $payloadIdentity->getTimestamp(), $request, null, null, $header, $lang);
}

public static function forResponse(PayloadIdentity $payloadIdentity, Response $response, ?string $lang = null): self
public static function forResponse(PayloadIdentity $payloadIdentity, Response $response, string $lang = null): self
{
return new self($payloadIdentity->getPayloadId(), $payloadIdentity->getTimestamp(), null, $response, null, null, $lang);
}
Expand Down
2 changes: 1 addition & 1 deletion src/CXml/Model/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Comment
*/
private ?string $type = null;

public function __construct(?string $value = null, ?string $type = null, ?string $lang = null, ?string $attachment = null)
public function __construct(string $value = null, string $type = null, string $lang = null, string $attachment = null)
{
$this->value = $value;
$this->type = $type;
Expand Down
4 changes: 2 additions & 2 deletions src/CXml/Model/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ class Contact
*/
private ?string $email = null;

public function __construct(MultilanguageString $name, ?string $role = null)
public function __construct(MultilanguageString $name, string $role = null)
{
$this->role = $role;
$this->name = $name;
}

public static function create(MultilanguageString $name, ?string $role = null): self
public static function create(MultilanguageString $name, string $role = null): self
{
return new self($name, $role);
}
Expand Down
2 changes: 1 addition & 1 deletion src/CXml/Model/Credential.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Credential
*/
private ?string $sharedSecret = null;

public function __construct(string $domain, string $identity, ?string $sharedSecret = null)
public function __construct(string $domain, string $identity, string $sharedSecret = null)
{
$this->domain = $domain;
$this->identity = $identity;
Expand Down
4 changes: 2 additions & 2 deletions src/CXml/Model/Description.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ class Description extends MultilanguageString
*/
private ?string $shortName = null;

public function __construct(?string $value, ?string $type = null, string $lang = 'en')
public function __construct(?string $value, string $type = null, string $lang = 'en')
{
parent::__construct($value, $type, $lang);
}

public static function createWithShortName(string $shortName, ?string $type = null, string $lang = 'en'): self
public static function createWithShortName(string $shortName, string $type = null, string $lang = 'en'): self
{
$new = new self(null, $type, $lang);
$new->setShortname($shortName);
Expand Down
4 changes: 1 addition & 3 deletions src/CXml/Model/Exception/CXmlModelNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use CXml\Exception\CXmlNotImplementedException;

class CXmlModelNotFoundException extends CXmlNotImplementedException
{
}
class CXmlModelNotFoundException extends CXmlNotImplementedException {}
2 changes: 1 addition & 1 deletion src/CXml/Model/ItemId.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ItemId
*/
private ?string $buyerPartId = null;

public function __construct(string $supplierPartId, ?string $supplierPartAuxiliaryId = null, ?string $buyerPartId = null)
public function __construct(string $supplierPartId, string $supplierPartAuxiliaryId = null, string $buyerPartId = null)
{
$this->supplierPartId = $supplierPartId;
$this->supplierPartAuxiliaryId = $supplierPartAuxiliaryId;
Expand Down
8 changes: 4 additions & 4 deletions src/CXml/Model/ItemOut.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ private function __construct(
int $quantity,
ItemId $itemId,
ItemDetail $itemDetail,
?\DateTimeInterface $requestedDeliveryDate = null,
?int $parentLineNumber = null
\DateTimeInterface $requestedDeliveryDate = null,
int $parentLineNumber = null
) {
$this->lineNumber = $lineNumber;
$this->quantity = $quantity;
Expand All @@ -61,8 +61,8 @@ public static function create(
int $quantity,
ItemId $itemId,
ItemDetail $itemDetail,
?\DateTimeInterface $requestedDeliveryDate = null,
?int $parentLineNumber = null
\DateTimeInterface $requestedDeliveryDate = null,
int $parentLineNumber = null
): self {
return new self(
$lineNumber,
Expand Down
4 changes: 1 addition & 3 deletions src/CXml/Model/Message/MessagePayloadInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use CXml\Model\PayloadInterface;

interface MessagePayloadInterface extends PayloadInterface
{
}
interface MessagePayloadInterface extends PayloadInterface {}
4 changes: 2 additions & 2 deletions src/CXml/Model/Message/ProductActivityDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ class ProductActivityDetail
*/
private ?Inventory $inventory = null;

private function __construct(ItemId $itemId, ?Inventory $inventory = null, ?Contact $contact = null, ?MultilanguageString $description = null)
private function __construct(ItemId $itemId, Inventory $inventory = null, Contact $contact = null, MultilanguageString $description = null)
{
$this->contact = $contact;
$this->description = $description;
$this->itemId = $itemId;
$this->inventory = $inventory;
}

public static function create(ItemId $itemId, ?Inventory $inventory = null, ?Contact $contact = null, ?MultilanguageString $description = null): self
public static function create(ItemId $itemId, Inventory $inventory = null, Contact $contact = null, MultilanguageString $description = null): self
{
return new self($itemId, $inventory, $contact, $description);
}
Expand Down
2 changes: 1 addition & 1 deletion src/CXml/Model/Message/ProductActivityHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ProductActivityHeader
*/
private ?\DateTimeInterface $creationDate = null;

public function __construct(string $messageId, ?string $processType = null, \DateTimeInterface $creationDate = null)
public function __construct(string $messageId, string $processType = null, \DateTimeInterface $creationDate = null)
{
$this->messageId = $messageId;
$this->processType = $processType;
Expand Down
4 changes: 2 additions & 2 deletions src/CXml/Model/Message/ProductActivityMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ class ProductActivityMessage implements MessagePayloadInterface
*/
private array $productActivityDetails = [];

private function __construct(string $messageId, ?string $processType = null, \DateTimeInterface $creationDate = null)
private function __construct(string $messageId, string $processType = null, \DateTimeInterface $creationDate = null)
{
$this->productActivityHeader = new ProductActivityHeader($messageId, $processType, $creationDate);
}

public static function create(string $messageId, ?string $processType = null, \DateTimeInterface $creationDate = null): self
public static function create(string $messageId, string $processType = null, \DateTimeInterface $creationDate = null): self
{
return new self($messageId, $processType, $creationDate);
}
Expand Down
2 changes: 1 addition & 1 deletion src/CXml/Model/Message/PunchOutOrderMessageHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class PunchOutOrderMessageHeader
*/
private ?SupplierOrderInfo $supplierOrderInfo = null;

public function __construct(MoneyWrapper $total, ?Shipping $shipping = null, ?Tax $tax = null, ?string $operationAllowed = null)
public function __construct(MoneyWrapper $total, Shipping $shipping = null, Tax $tax = null, string $operationAllowed = null)
{
Assertion::inArray($operationAllowed, [self::OPERATION_CREATE, self::OPERATION_EDIT, self::OPERATION_INSPECT, null]);

Expand Down
2 changes: 1 addition & 1 deletion src/CXml/Model/MultilanguageString.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MultilanguageString
*/
private ?string $lang = null;

public function __construct(?string $value, ?string $type = null, string $lang = 'en')
public function __construct(?string $value, string $type = null, string $lang = 'en')
{
$this->value = $value;
$this->lang = $lang;
Expand Down
2 changes: 1 addition & 1 deletion src/CXml/Model/OrderReference.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class OrderReference
*/
private ?\DateTimeInterface $orderDate = null;

public function __construct(DocumentReference $documentReference, ?string $orderId = null, ?\DateTimeInterface $orderDate = null)
public function __construct(DocumentReference $documentReference, string $orderId = null, \DateTimeInterface $orderDate = null)
{
$this->documentReference = $documentReference;
$this->orderId = $orderId;
Expand Down
2 changes: 1 addition & 1 deletion src/CXml/Model/Party.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Party
*/
private ?string $userAgent = null;

public function __construct(Credential $credential, ?string $userAgent = null)
public function __construct(Credential $credential, string $userAgent = null)
{
$this->credential = $credential;
$this->userAgent = $userAgent;
Expand Down
4 changes: 1 addition & 3 deletions src/CXml/Model/PayloadInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace CXml\Model;

interface PayloadInterface
{
}
interface PayloadInterface {}
Loading