/** * {@inheritdoc} */ public function register(Identity $identity) { $name = $identity->getName(); if (!isset($this->identities[$name])) { $this->identities[$name] = $identity; } else { $this->identities[$name]->setUrls($identity->getUrls()); } return $this; }
public function testGetNameAndUrls() { self::assertEquals('foo', $this->identity->getName()); self::assertEquals(['foo://localhost', 'bar://localhost', 'baz://localhost', 'qux://localhost'], $this->identity->getUrls()); }
/** * @return Request */ public function toRequest() { return new Request('sys.announce', ['name' => $this->identity->getName(), 'urls' => $this->identity->getUrls()]); }