private function handlePublishUid(ConnectionInterface $from, $data) {
    $this->logger->notice(
        "Received a UID publish! (".
          (
            isset($data['name'])
                ? $data['name']
                : "{$data['oldName']} => {$data['newName']}"
          ).
          ", {$data['event']}, {$from->resourceId})"
    );

    foreach ($data as $key => $name) {
      if (!in_array($key, ['name', 'newName', 'oldName'])
          || !key_exists($name, $this->uidSubs)) {
        continue;
      }
      foreach ($this->uidSubs[$name] as $curClient) {
        $this->logger->notice(
            "Notifying client of {$data['event']}! ".
              "($name, {$curClient->resourceId})"
        );
        $payload = [
          'uid' => $name,
          'event' => $data['event']
        ];
        if (isset($data['value'])) {
          $payload['value'] = $data['value'];
        }
        $curClient->send(json_encode($payload));
      }
    }
  }
private function handlePublishUid(ConnectionInterface $from, $data) {
    $this->logger->notice(
        "Received a UID publish! (".
          (
            isset($data['name'])
                ? $data['name']
                : "{$data['oldName']} => {$data['newName']}"
          ).
          ", {$data['event']}, {$from->resourceId})"
    );

    foreach ($data as $key => $name) {
      if (!in_array($key, ['name', 'newName', 'oldName'])
          || !key_exists($name, $this->uidSubs)) {
        continue;
      }
      foreach ($this->uidSubs[$name] as $curClient) {
        $this->logger->notice(
            "Notifying client of {$data['event']}! ".
              "($name, {$curClient->resourceId})"
        );
        $payload = [
          'uid' => $name,
          'event' => $data['event']
        ];
        if (isset($data['value'])) {
          $payload['value'] = $data['value'];
        }
        $curClient->send(json_encode($payload));
      }
    }
  }
private function handlePublishUid ( ConnectionInterface $ from , $ data ) { $ this -> logger -> notice ( "Received a UID publish! (" . ( isset ( $ data [ 'name' ] ) ? $ data [ 'name' ] : "{$data['oldName']} => {$data['newName']}" ) . ", {$data['event']}, {$from->resourceId})" ) ; foreach ( $ data as $ key => $ name ) { if ( ! in_array ( $ key , [ 'name' , 'newName' , 'oldName' ] ) || ! key_exists ( $ name , $ this -> uidSubs ) ) { continue ; } foreach ( $ this -> uidSubs [ $ name ] as $ curClient ) { $ this -> logger -> notice ( "Notifying client of {$data['event']}! " . "($name, {$curClient->resourceId})" ) ; $ payload = [ 'uid' => $ name , 'event' => $ data [ 'event' ] ] ; if ( isset ( $ data [ 'value' ] ) ) { $ payload [ 'value' ] = $ data [ 'value' ] ; } $ curClient -> send ( json_encode ( $ payload ) ) ; } } }
Handle a UID publish from a client.

@param ConnectionInterface $from
@param array $data
Handle a UID publish from a client .