Rev 1124 | Rev 1271 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1124 | Rev 1130 | ||
---|---|---|---|
Line 22... | Line 22... | ||
22 | // phpcs:disable PSR1.Files.SideEffects |
22 | // phpcs:disable PSR1.Files.SideEffects |
23 | \defined('INSIDE_OIDPLUS') or die; |
23 | \defined('INSIDE_OIDPLUS') or die; |
24 | // phpcs:enable PSR1.Files.SideEffects |
24 | // phpcs:enable PSR1.Files.SideEffects |
25 | 25 | ||
26 | class OIDplusGuid extends OIDplusObject { |
26 | class OIDplusGuid extends OIDplusObject { |
- | 27 | /** |
|
- | 28 | * @var string |
|
- | 29 | */ |
|
27 | private $guid; |
30 | private $guid; |
28 | 31 | ||
29 | /** |
32 | /** |
30 | * @param $guid |
33 | * @param string $guid |
31 | */ |
34 | */ |
32 | public function __construct($guid) { |
35 | public function __construct(string $guid) { |
33 | if (uuid_valid($guid)) { |
36 | if (uuid_valid($guid)) { |
34 | $this->guid = strtolower(uuid_canonize($guid)); // It is a real GUID (leaf node) |
37 | $this->guid = strtolower(uuid_canonize($guid)); // It is a real GUID (leaf node) |
35 | } else { |
38 | } else { |
36 | $this->guid = $guid; // It is a category name |
39 | $this->guid = $guid; // It is a category name |
37 | } |
40 | } |
Line 240... | Line 243... | ||
240 | // A GUID is a GUID, there is no hierarchy |
243 | // A GUID is a GUID, there is no hierarchy |
241 | return null; |
244 | return null; |
242 | } |
245 | } |
243 | 246 | ||
244 | /** |
247 | /** |
245 | * @param $to |
248 | * @param OIDplusObject|string $to |
246 | * @return null |
249 | * @return int|null |
247 | */ |
250 | */ |
248 | public function distance($to) { |
251 | public function distance($to) { |
249 | // Distance between GUIDs is not possible |
252 | // Distance between GUIDs is not possible |
250 | return null; |
253 | return null; |
251 | } |
254 | } |