Browse Source

Whitespace

widget
Lee Willis 6 years ago
parent
commit
30bc2000e3
  1. 2
      github-api.php
  2. 11
      github-embed.php

2
github-api.php

@ -1,7 +1,5 @@
<?php
// 0 - none.
define( 'GEDEBUG_NONE', 0 );

11
github-embed.php

@ -36,13 +36,13 @@ Author URI: http://www.leewillis.co.uk/
* class to retrieve the information from the GitHub API.
* @uses class github_api
*/
class github_embed {
private $api;
/**
* Constructor. Registers hooks and filters
*
* @param class $api An instance of the github_api classs
*/
public function __construct( $api ) {
@ -92,7 +92,9 @@ class github_embed {
* Register the oEmbed provider, and point it at a local endpoint since github
* doesn't directly support oEmbed yet. Our local endpoint will use the github
* API to fulfil the request.
*
* @param array $providers The current list of providers
*
* @return array The list, with our new provider added
*/
public function register_oembed_handler() {
@ -113,6 +115,7 @@ class github_embed {
$key = md5( time() . rand( 0, 65535 ) );
add_option( 'github_oembed_key', $key, '', 'yes' );
}
return $key;
}
@ -188,11 +191,13 @@ class github_embed {
if ( ! locate_template( 'wp-github-oembed/' . $template, true ) ) {
require_once 'templates/' . $template;
}
return ob_get_clean();
}
/**
* Retrieve a list of contributors for a project
*
* @param string $owner The owner of the repository
* @param string $repository The repository name
*/
@ -248,8 +253,8 @@ class github_embed {
*/
private function oembed_github_repo( $owner, $repository ) {
$data = [
$owner,
$repository,
'owner_slug' => $owner,
'repo_slug' => $repository,
];
$data['repo'] = $this->api->get_repo( $owner, $repository );
$data['commits'] = $this->api->get_repo_commits( $owner, $repository );

Loading…
Cancel
Save