/** * @param Guid $guid */ public function setGuid(Guid $guid) { $this->guid = $guid->toString(); }
public function should_return_string() { $guid1 = new Guid('d41d8cd98f00b204e9800998ecf8427e'); $this->assertEquals('d41d8cd98f00b204e9800998ecf8427e', $guid1->toString()); $this->assertEquals('d41d8cd98f00b204e9800998ecf8427e', (string) $guid1); }
private function getPathOnly(Guid $guid) { $first = str_split($guid->toString(), 4)[0]; $splitted = str_split($first); $dir_path = implode('/', $splitted); $path = '/' . ltrim($dir_path, '/'); return $path . '/'; }