Skip to content

Commit c9a586b

Browse files
committed
issue #2 - use constant whenever possible
1 parent 3b8723f commit c9a586b

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/Tag/AbstractTagOperationElement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function getMessage(): ?TagMessage
3636
$messageName = $this->getAttributeMessage();
3737

3838
if (!empty($messageName)) {
39-
$message = $this->getDomDocumentHandler()->getElementByNameAndAttributes('message', [
39+
$message = $this->getDomDocumentHandler()->getElementByNameAndAttributes(AbstractDocument::TAG_MESSAGE, [
4040
'name' => $messageName,
4141
], true);
4242
}

src/Tag/TagAttributeGroup.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,22 @@
44

55
namespace WsdlToPhp\WsdlHandler\Tag;
66

7+
use WsdlToPhp\WsdlHandler\AbstractDocument;
8+
79
class TagAttributeGroup extends Tag
810
{
911
public function getReferencingElements(): array
1012
{
1113
$elements = [];
12-
$attributeGroups = $this->getDomDocumentHandler()->getElementsByNameAndAttributes('attributeGroup', [
14+
$attributeGroups = $this->getDomDocumentHandler()->getElementsByNameAndAttributes(AbstractDocument::TAG_ATTRIBUTE_GROUP, [
1315
'ref' => sprintf('*:%s', $this->getAttributeName()),
1416
]);
1517
/*
1618
* In case of a referencing element that use this attributeGroup that is not namespaced,
1719
* use the non namespaced value
1820
*/
1921
if (empty($attributeGroups)) {
20-
$attributeGroups = $this->getDomDocumentHandler()->getElementsByNameAndAttributes('attributeGroup', [
22+
$attributeGroups = $this->getDomDocumentHandler()->getElementsByNameAndAttributes(AbstractDocument::TAG_ATTRIBUTE_GROUP, [
2123
'ref' => sprintf('*%s', $this->getAttributeName()),
2224
]);
2325
}

src/Tag/TagMessage.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44

55
namespace WsdlToPhp\WsdlHandler\Tag;
66

7+
use WsdlToPhp\WsdlHandler\AbstractDocument;
8+
79
class TagMessage extends Tag
810
{
911
public function getPart(string $name): ?TagPart
1012
{
11-
return $this->getChildByNameAndAttributes('part', [
13+
return $this->getChildByNameAndAttributes(AbstractDocument::TAG_PART, [
1214
'name' => $name,
1315
]);
1416
}

0 commit comments

Comments
 (0)