/** * @param Subscription $subscription * @param Table $table * * @return int */ protected function listProperties(Subscription $subscription, Table $table) { $headings = []; $values = []; foreach ($subscription->getProperties() as $key => $value) { $headings[] = new AdaptiveTableCell($key, ['wrap' => false]); $values[] = $this->formatter->format($value, $key); } $table->renderSimple($values, $headings); return 0; }
/** * @param Subscription $subscription * @param Table $table * * @return int */ protected function listProperties(Subscription $subscription, Table $table) { $headings = []; $values = []; foreach ($subscription->getProperties() as $key => $value) { $value = $this->formatter->format($value, $key); $value = wordwrap($value, 50, "\n", true); $headings[] = $key; $values[] = $value; } $table->renderSimple($values, $headings); return 0; }
/** * @param Subscription $subscription * * @return int */ protected function listProperties(Subscription $subscription) { $this->stdErr->writeln("Metadata for the subscription <info>" . $subscription->id . "</info>:"); $table = new Table($this->output); $table->setHeaders(array("Property", "Value")); foreach ($subscription->getProperties() as $key => $value) { $value = $this->formatter->format($value, $key); $value = wordwrap($value, 50, "\n", true); $table->addRow(array($key, $value)); } $table->render(); return 0; }
/** * Get a subscription by its ID. * * @param string|int $id * * @return Subscription|false */ public function getSubscription($id) { $url = $this->accountsEndpoint . 'subscriptions'; return Subscription::get($id, $url, $this->connector->getClient()); }