Skip to content

Commit

Permalink
OrderDocument -> Codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
HorstOeko committed Oct 13, 2024
1 parent 917a1a8 commit 4b0941f
Showing 1 changed file with 10 additions and 23 deletions.
33 changes: 10 additions & 23 deletions src/OrderDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use GoetasWebservices\Xsd\XsdToPhpRuntime\Jms\Handler\BaseTypesHandler;
use GoetasWebservices\Xsd\XsdToPhpRuntime\Jms\Handler\XmlSchemaDateHandler;
use horstoeko\orderx\exception\OrderUnknownProfileParameterException;
use horstoeko\orderx\jms\OrderTypesHandler;
use horstoeko\orderx\OrderObjectHelper;
use horstoeko\orderx\OrderProfileResolver;
Expand All @@ -32,43 +33,37 @@ class OrderDocument
{
/**
* @internal
* Internal profile id (see OrderProfiles.php)
* @var integer
* @var integer Internal profile id
*/
private $profileId = -1;

/**
* @internal
* Internal profile definition (see OrderProfiles.php)
* @var array
* @var array Internal profile definition
*/
private $profileDefinition = [];

/**
* @internal
* Serializer builder
* @var SerializerBuilder
* @var SerializerBuilder Serializer builder
*/
private $serializerBuilder;

/**
* @internal
* Serializer
* @var SerializerInterface
* @var SerializerInterface Serializer
*/
private $serializer;

/**
* @internal
* The internal invoice object
* @var \horstoeko\orderx\entities\basic\rsm\SCRDMCCBDACIOMessageStructure|\horstoeko\orderx\entities\comfort\rsm\SCRDMCCBDACIOMessageStructure|\horstoeko\orderx\entities\extended\rsm\SCRDMCCBDACIOMessageStructure
* @return \horstoeko\orderx\entities\basic\rsm\SCRDMCCBDACIOMessageStructure|\horstoeko\orderx\entities\comfort\rsm\SCRDMCCBDACIOMessageStructure|\horstoeko\orderx\entities\extended\rsm\SCRDMCCBDACIOMessageStructure
*/
private $orderObject = null;

/**
* @internal
* Object Helper
* @var OrderObjectHelper
* @var OrderObjectHelper Object Helper
*/
private $objectHelper = null;

Expand All @@ -77,8 +72,6 @@ class OrderDocument
*
* @param integer $profile
* The ID of the profile of the document
*
* @codeCoverageIgnore
*/
final protected function __construct(int $profile)
{
Expand All @@ -88,12 +81,10 @@ final protected function __construct(int $profile)
}

/**
* @internal
*
* Returns the internal order object (created by the
* serializer). This is used e.g. in the validator
*
* @return object
* @return \horstoeko\orderx\entities\basic\rsm\SCRDMCCBDACIOMessageStructure|\horstoeko\orderx\entities\comfort\rsm\SCRDMCCBDACIOMessageStructure|\horstoeko\orderx\entities\extended\rsm\SCRDMCCBDACIOMessageStructure
*/
public function getOrderObject()
{
Expand Down Expand Up @@ -166,7 +157,7 @@ public function getProfileDefinitionParameter(string $parameterName)
return $profileDefinition[$parameterName];
}

throw new \Exception(sprintf("Unknown profile definition parameter %s", $parameterName));
throw new OrderUnknownProfileParameterException($parameterName);
}

/**
Expand All @@ -191,7 +182,6 @@ private function initProfile(int $profile): OrderDocument
* @internal
*
* Build the internal object helper
* @codeCoverageIgnore
*
* @return OrderDocument
*/
Expand All @@ -206,7 +196,6 @@ private function initObjectHelper(): OrderDocument
* @internal
*
* Build the internal serialzer
* @codeCoverageIgnore
*
* @return OrderDocument
*/
Expand All @@ -225,7 +214,6 @@ private function initSerialzer(): OrderDocument
$this->getProfileDefinitionParameter("name")
)
);

$this->serializerBuilder->addMetadataDir(
PathUtils::combineAllPaths(
OrderSettings::getYamlDirectory(),
Expand All @@ -237,7 +225,6 @@ private function initSerialzer(): OrderDocument
$this->getProfileDefinitionParameter("name")
)
);

$this->serializerBuilder->addMetadataDir(
PathUtils::combineAllPaths(
OrderSettings::getYamlDirectory(),
Expand All @@ -249,7 +236,6 @@ private function initSerialzer(): OrderDocument
$this->getProfileDefinitionParameter("name")
)
);

$this->serializerBuilder->addMetadataDir(
PathUtils::combineAllPaths(
OrderSettings::getYamlDirectory(),
Expand Down Expand Up @@ -277,6 +263,7 @@ function (HandlerRegistryInterface $handler) {

return $this;
}

/**
* Deserialize XML content to internal invoice object
*
Expand Down

0 comments on commit 4b0941f

Please sign in to comment.