@@ -45,7 +45,7 @@ |
||
| 45 | 45 | |
| 46 | 46 | $this->optionalExtractionPaths = array_merge( |
| 47 | 47 | $this->optionalExtractionPaths, |
| 48 | - ['unitPrice' => 'x:UnitPrice'] |
|
| 48 | + [ 'unitPrice' => 'x:UnitPrice' ] |
|
| 49 | 49 | ); |
| 50 | 50 | } |
| 51 | 51 | |
@@ -45,10 +45,10 @@ |
||
| 45 | 45 | */ |
| 46 | 46 | public function validate(Payload\IPayload $payload) |
| 47 | 47 | { |
| 48 | - $invalidDataAccessors = []; |
|
| 48 | + $invalidDataAccessors = [ ]; |
|
| 49 | 49 | foreach ($this->requiredDataAccessors as $method) { |
| 50 | 50 | if (is_null($payload->$method())) { |
| 51 | - $invalidDataAccessors[] = $method; |
|
| 51 | + $invalidDataAccessors[ ] = $method; |
|
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | if ($invalidDataAccessors) { |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | /** |
| 28 | 28 | * @param string[] Accessor methods to get subpayloads of the payload being validated |
| 29 | 29 | */ |
| 30 | - public function __construct(array $subpayloadAccessors = []) |
|
| 30 | + public function __construct(array $subpayloadAccessors = [ ]) |
|
| 31 | 31 | { |
| 32 | 32 | $this->subpayloadAccessors = $subpayloadAccessors; |
| 33 | 33 | } |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | libxml_use_internal_errors(false); |
| 39 | 39 | if ($errors) { |
| 40 | 40 | $messages = implode(', ', array_filter(array_map( |
| 41 | - function ($libxmlError) { |
|
| 41 | + function($libxmlError) { |
|
| 42 | 42 | return trim($libxmlError->message); |
| 43 | 43 | }, |
| 44 | 44 | $errors |
@@ -91,10 +91,10 @@ |
||
| 91 | 91 | * @param \libXMLError[] $libxmlErrors |
| 92 | 92 | * @return string |
| 93 | 93 | */ |
| 94 | - protected function formatErrors(array $libxmlErrors = []) |
|
| 94 | + protected function formatErrors(array $libxmlErrors = [ ]) |
|
| 95 | 95 | { |
| 96 | 96 | return 'XSD validation failed with following messages:' . PHP_EOL . implode('', array_map( |
| 97 | - function (\libXMLError $xmlError) { |
|
| 97 | + function(\libXMLError $xmlError) { |
|
| 98 | 98 | return sprintf( |
| 99 | 99 | '[%s:%d] %s', |
| 100 | 100 | $xmlError->file, |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | class ValidatorIterator implements IValidatorIterator |
| 23 | 23 | { |
| 24 | 24 | /** @var IValidator[] */ |
| 25 | - protected $validators = []; |
|
| 25 | + protected $validators = [ ]; |
|
| 26 | 26 | /** @var int */ |
| 27 | 27 | protected $offset = 0; |
| 28 | 28 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | protected function add(IValidator $validator) |
| 50 | 50 | { |
| 51 | - $this->validators[] = $validator; |
|
| 51 | + $this->validators[ ] = $validator; |
|
| 52 | 52 | return $this; |
| 53 | 53 | } |
| 54 | 54 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | public function current() |
| 60 | 60 | { |
| 61 | - return $this->validators[$this->offset]; |
|
| 61 | + return $this->validators[ $this->offset ]; |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $this->schemaValidator = $schemaValidator; |
| 52 | 52 | $this->parentPayload = $parentPayload; |
| 53 | 53 | $this->payloadMap = $payloadMap; |
| 54 | - $this->payloadFactory = new PayloadFactory(); |
|
| 54 | + $this->payloadFactory = new PayloadFactory(); |
|
| 55 | 55 | $this->setOrderSummaries($this->buildPayloadForInterface( |
| 56 | 56 | static::ORDER_SUMMARY_ITERABLE_INTERFACE |
| 57 | 57 | )); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | protected function getRootAttributes() |
| 121 | 121 | { |
| 122 | - return ['xmlns' => $this->getXmlNamespace()]; |
|
| 122 | + return [ 'xmlns' => $this->getXmlNamespace() ]; |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | /** |
@@ -137,8 +137,8 @@ |
||
| 137 | 137 | { |
| 138 | 138 | $isMockPayment = $this->getIsMockPayment(); |
| 139 | 139 | return !is_null($isMockPayment) |
| 140 | - ? ['isMockPayment' => $this->convertBooleanToString($isMockPayment)] |
|
| 141 | - : []; |
|
| 140 | + ? [ 'isMockPayment' => $this->convertBooleanToString($isMockPayment) ] |
|
| 141 | + : [ ]; |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | protected function getRootNodeName() |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | |
| 92 | 92 | protected function getRootAttributes() |
| 93 | 93 | { |
| 94 | - return ['id' => $this->getId()]; |
|
| 94 | + return [ 'id' => $this->getId() ]; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | protected function buildPhysicalAddressNodes(array $lines) |