Browse files

A few formatting improvements.

  • Loading branch information...
1 parent ec3bce7 commit f221a7cd286d0c385ea527d42b9ad8e5a1894ca4 @shiflett committed Apr 24, 2011
Showing with 4 additions and 11 deletions.
  1. +4 −11 eventbrite.php
View
15 eventbrite.php
@@ -17,8 +17,7 @@ class Eventbrite
protected $cacheDir = '/tmp';
protected $cacheTimeout = 86400;
- public function __construct($args)
- {
+ public function __construct($args) {
if (isset($args['app_key'])) {
$this->appKey = $args['app_key'];
}
@@ -36,8 +35,7 @@ public function __construct($args)
}
}
- public function cache($args)
- {
+ public function cache($args) {
if (isset($args['dir'])) {
$this->cacheDir = $args['dir'];
}
@@ -52,8 +50,7 @@ public function cache($args)
}
}
- protected function request($url, $file)
- {
+ protected function request($url, $file) {
$json = '';
if (!empty($file)) {
@@ -90,20 +87,16 @@ public function __call($method, $args) {
// Only cache read-only stuff.
list ($entity, $action) = explode('_', $method);
+ $file = '';
switch ($action) {
case 'get':
case 'list':
case 'search':
// Check whether caching is disabled.
if ($this->cacheTimeout) {
$file = "{$this->cacheDir}/eventbrite-{$hash}";
- } else {
- $file = '';
}
break;
- default:
- $file = '';
- break;
}
return json_decode($this->request($url, $file), TRUE);

0 comments on commit f221a7c

Please sign in to comment.