| @@ -5,8 +5,11 @@ | ||
| 5 | 5 | |
| 6 | 6 | |
| 7 | 7 | final class Api |
| 8 | 8 | { |
| 9 | + | |
| 10 | + private $app; | |
| 11 | + | |
| 9 | 12 | public function __construct($app) |
| 10 | 13 | { |
| 11 | 14 | $this->app = $app; |
| 12 | 15 | $this->register(); |
| @@ -22,9 +25,8 @@ | ||
| 22 | 25 | } |
| 23 | 26 | |
| 24 | 27 | private function getClasses() |
| 25 | 28 | { |
| 26 | - | |
| 27 | 29 | return require_once( |
| 28 | 30 | $this->app['path.app'].'Api/config.php' |
| 29 | 31 | ); |
| 30 | 32 | } |
| @@ -38,8 +40,8 @@ | ||
| 38 | 40 | { |
| 39 | 41 | try { |
| 40 | 42 | return $this->app[$this->key($key)]; |
| 41 | 43 | } catch(\Exception $e) { |
| 42 | - throw new \Exception("The '$key' doesn't exist in FluentSupportApi."); | |
| 44 | + throw new \Exception(sprintf('The %s doesn\'t exist in FluentSupportApi.', esc_html($key))); | |
| 43 | 45 | } |
| 44 | 46 | } |
| 45 | 47 | } |