Skip to content

Commit 07ec972

Browse files
committed
Add getter-method to get the schema type
1 parent 19fcf08 commit 07ec972

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

src/XMLSchema/Type/Interface/AbstractAnySimpleType.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,13 @@ public function equals(ValueTypeInterface|string $other): bool
145145

146146
return strcmp($this->getValue(), $other->getValue()) === 0;
147147
}
148+
149+
150+
/**
151+
* Get the type of the value
152+
*/
153+
public function getType(): string
154+
{
155+
return static::SCHEMA_NAMESPACE_PREFIX . ':' . static::SCHEMA_TYPE;
156+
}
148157
}

src/XMLSchema/Type/Interface/ValueTypeInterface.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,28 @@
1414
interface ValueTypeInterface extends Stringable
1515
{
1616
/**
17-
* @return string
1817
*/
1918
public function getValue(): string;
2019

2120

2221
/**
23-
* @return string
2422
*/
2523
public function getRawValue(): string;
2624

2725

2826
/**
29-
* @param string $value
30-
* @return static
3127
*/
3228
public static function fromString(string $value): static;
3329

3430

3531
/**
3632
* Output the value as a string
37-
*
38-
* @return string
3933
*/
4034
public function __toString(): string;
35+
36+
37+
/**
38+
* Get the type of the value
39+
*/
40+
public function getType(): string;
4141
}

0 commit comments

Comments
 (0)