Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Embed.php #1

Merged
merged 1 commit into from
Dec 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions src/Embed.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
namespace Metabase;
use Lcobucci\JWT\Token;

/**
* Convenience class to embed Metabase dashboards and questions
Expand All @@ -19,8 +20,8 @@ class Embed
/**
* Default constructor
*
* @param $url The base url for the Metabase installation
* @param $key The secret Metabase key
* @param $url string base url for the Metabase installation
* @param $key int secret Metabase key
*/
public function __construct($url, $key)
{
Expand All @@ -31,8 +32,8 @@ public function __construct($url, $key)
/**
* Get the embed URL for a Metabase question
*
* @param $questionId The id of the question to embed
* @param $params An associate array with variables to be passed to the question
* @param $questionId int id of the question to embed
* @param $params array an associate array with variables to be passed to the question
*
* @return Embed URL
*/
Expand All @@ -44,8 +45,8 @@ public function questionUrl($questionId, $params = [])
/**
* Get the embed URL for a Metabase dashboard
*
* @param $dashboardId The id of the dashboard to embed
* @param $params An associate array with variables to be passed to the dashboard
* @param $dashboardId int the id of the dashboard to embed
* @param $params array an associate array with variables to be passed to the dashboard
*
* @return Embed URL
*/
Expand All @@ -57,8 +58,8 @@ public function dashboardUrl($dashboardId, $params = [])
/**
* Use JWT to encode tokens
*
* @param $resouce Resource to encode (question or dashboard)
* @param $params An associate array with variables to be passed to the dashboard
* @param $resource array resource to encode (question or dashboard)
* @param $params array an associate array with variables to be passed to the dashboard
*
* @return Token
*/
Expand Down Expand Up @@ -110,10 +111,10 @@ protected function url($resource, $id, $params)
* It assumes no iframe border. Size can be manipulated via
* class $width/$height
*
* @param $questionId The id of the question to embed
* @param $params An associate array with variables to be passed to the question
* @param $questionId int the id of the question to embed
* @param $params array an associate array with variables to be passed to the question
*
* @return HTML Code to embed
* @return string Code to embed
*/
public function questionIFrame($questionId, $params = [])
{
Expand All @@ -126,10 +127,10 @@ public function questionIFrame($questionId, $params = [])
* It assumes no iframe border. Size can be manipulated via
* class $width/$height
*
* @param $dashboardId The id of the dashboard to embed
* @param $params An associate array with variables to be passed to the dashboard
* @param $dashboardId int the id of the dashboard to embed
* @param $params array an associate array with variables to be passed to the dashboard
*
* @return HTML Code to embed
* @return string Code to embed
*/
public function dashboardIFrame($dashboardId, $params = [])
{
Expand All @@ -142,9 +143,9 @@ public function dashboardIFrame($dashboardId, $params = [])
* It assumes no iframe border. Size can be manipulated via
* class $width/$height
*
* @param $iframeUrl The URL to create an iframe for
* @param $iframeUrl string the URL to create an iframe for
*
* @return HTML Code to embed
* @return string Code to embed
*/
protected function iframe($iframeUrl)
{
Expand Down