@@ -17,58 +17,58 @@ |
||
| 17 | 17 | class Salesforce |
| 18 | 18 | { |
| 19 | 19 | |
| 20 | - /** |
|
| 21 | - * @var Client $sfh The Salesforce Handler |
|
| 22 | - */ |
|
| 23 | - private $sfh; |
|
| 20 | + /** |
|
| 21 | + * @var Client $sfh The Salesforce Handler |
|
| 22 | + */ |
|
| 23 | + private $sfh; |
|
| 24 | 24 | |
| 25 | - /** |
|
| 26 | - * The constructor. |
|
| 27 | - * |
|
| 28 | - * Authenticates into Salesforce according to |
|
| 29 | - * the provided credentials and WSDL file |
|
| 30 | - * |
|
| 31 | - * @param Repository $configExternal |
|
| 32 | - * @throws SalesforceException |
|
| 33 | - */ |
|
| 34 | - public function __construct(Repository $configExternal) |
|
| 35 | - { |
|
| 36 | - try { |
|
| 37 | - $this->sfh = new Client(); |
|
| 25 | + /** |
|
| 26 | + * The constructor. |
|
| 27 | + * |
|
| 28 | + * Authenticates into Salesforce according to |
|
| 29 | + * the provided credentials and WSDL file |
|
| 30 | + * |
|
| 31 | + * @param Repository $configExternal |
|
| 32 | + * @throws SalesforceException |
|
| 33 | + */ |
|
| 34 | + public function __construct(Repository $configExternal) |
|
| 35 | + { |
|
| 36 | + try { |
|
| 37 | + $this->sfh = new Client(); |
|
| 38 | 38 | |
| 39 | - $wsdl = $configExternal->get('laravel-salesforce::wsdl'); |
|
| 39 | + $wsdl = $configExternal->get('laravel-salesforce::wsdl'); |
|
| 40 | 40 | |
| 41 | - if (empty($wsdl)) { |
|
| 42 | - $wsdl = __DIR__ . '/Wsdl/enterprise.wsdl.xml'; |
|
| 43 | - } |
|
| 41 | + if (empty($wsdl)) { |
|
| 42 | + $wsdl = __DIR__ . '/Wsdl/enterprise.wsdl.xml'; |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - $this->sfh->createConnection($wsdl); |
|
| 45 | + $this->sfh->createConnection($wsdl); |
|
| 46 | 46 | |
| 47 | - $username = $configExternal->get('laravel-salesforce::username'); |
|
| 48 | - $password = $configExternal->get('laravel-salesforce::password'); |
|
| 49 | - $token = $configExternal->get('laravel-salesforce::token'); |
|
| 47 | + $username = $configExternal->get('laravel-salesforce::username'); |
|
| 48 | + $password = $configExternal->get('laravel-salesforce::password'); |
|
| 49 | + $token = $configExternal->get('laravel-salesforce::token'); |
|
| 50 | 50 | |
| 51 | - $this->sfh->login($username, $password . $token); |
|
| 51 | + $this->sfh->login($username, $password . $token); |
|
| 52 | 52 | |
| 53 | - } catch (Exception $e) { |
|
| 54 | - throw new SalesforceException('Exception at Constructor' . $e->getMessage() . "\n\n" . $e->getTraceAsString()); |
|
| 55 | - } |
|
| 56 | - } |
|
| 53 | + } catch (Exception $e) { |
|
| 54 | + throw new SalesforceException('Exception at Constructor' . $e->getMessage() . "\n\n" . $e->getTraceAsString()); |
|
| 55 | + } |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - public function __call($method, $args) |
|
| 59 | - { |
|
| 60 | - return call_user_func_array(array($this->sfh, $method), $args); |
|
| 61 | - } |
|
| 58 | + public function __call($method, $args) |
|
| 59 | + { |
|
| 60 | + return call_user_func_array(array($this->sfh, $method), $args); |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - /* |
|
| 63 | + /* |
|
| 64 | 64 | * Debugging functions |
| 65 | 65 | */ |
| 66 | 66 | |
| 67 | - /** |
|
| 68 | - * @return mixed |
|
| 69 | - */ |
|
| 70 | - public function dump() |
|
| 71 | - { |
|
| 72 | - return print_r($this, true); |
|
| 73 | - } |
|
| 67 | + /** |
|
| 68 | + * @return mixed |
|
| 69 | + */ |
|
| 70 | + public function dump() |
|
| 71 | + { |
|
| 72 | + return print_r($this, true); |
|
| 73 | + } |
|
| 74 | 74 | } |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | $wsdl = $configExternal->get('laravel-salesforce::wsdl'); |
| 40 | 40 | |
| 41 | 41 | if (empty($wsdl)) { |
| 42 | - $wsdl = __DIR__ . '/Wsdl/enterprise.wsdl.xml'; |
|
| 42 | + $wsdl = __DIR__.'/Wsdl/enterprise.wsdl.xml'; |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | $this->sfh->createConnection($wsdl); |
@@ -48,10 +48,10 @@ discard block |
||
| 48 | 48 | $password = $configExternal->get('laravel-salesforce::password'); |
| 49 | 49 | $token = $configExternal->get('laravel-salesforce::token'); |
| 50 | 50 | |
| 51 | - $this->sfh->login($username, $password . $token); |
|
| 51 | + $this->sfh->login($username, $password.$token); |
|
| 52 | 52 | |
| 53 | 53 | } catch (Exception $e) { |
| 54 | - throw new SalesforceException('Exception at Constructor' . $e->getMessage() . "\n\n" . $e->getTraceAsString()); |
|
| 54 | + throw new SalesforceException('Exception at Constructor'.$e->getMessage()."\n\n".$e->getTraceAsString()); |
|
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | |
@@ -4,13 +4,13 @@ |
||
| 4 | 4 | |
| 5 | 5 | class Salesforce extends Facade |
| 6 | 6 | { |
| 7 | - /** |
|
| 8 | - * Get the registered name of the component. |
|
| 9 | - * |
|
| 10 | - * @return string |
|
| 11 | - */ |
|
| 12 | - protected static function getFacadeAccessor() |
|
| 13 | - { |
|
| 14 | - return 'salesforce'; |
|
| 15 | - } |
|
| 7 | + /** |
|
| 8 | + * Get the registered name of the component. |
|
| 9 | + * |
|
| 10 | + * @return string |
|
| 11 | + */ |
|
| 12 | + protected static function getFacadeAccessor() |
|
| 13 | + { |
|
| 14 | + return 'salesforce'; |
|
| 15 | + } |
|
| 16 | 16 | } |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | return array( |
| 3 | 3 | |
| 4 | - /* |
|
| 4 | + /* |
|
| 5 | 5 | |-------------------------------------------------------------------------- |
| 6 | 6 | | Your Salesforce credentials |
| 7 | 7 | |-------------------------------------------------------------------------- |
@@ -9,9 +9,9 @@ discard block |
||
| 9 | 9 | | |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | - // production |
|
| 13 | - 'username' => '', |
|
| 14 | - 'password' => '', |
|
| 15 | - 'token' => '', |
|
| 16 | - 'wsdl' => app_path() . '/wsdl/enterprise.wsdl.xml', |
|
| 12 | + // production |
|
| 13 | + 'username' => '', |
|
| 14 | + 'password' => '', |
|
| 15 | + 'token' => '', |
|
| 16 | + 'wsdl' => app_path() . '/wsdl/enterprise.wsdl.xml', |
|
| 17 | 17 | ); |
@@ -13,5 +13,5 @@ |
||
| 13 | 13 | 'username' => '', |
| 14 | 14 | 'password' => '', |
| 15 | 15 | 'token' => '', |
| 16 | - 'wsdl' => app_path() . '/wsdl/enterprise.wsdl.xml', |
|
| 16 | + 'wsdl' => app_path().'/wsdl/enterprise.wsdl.xml', |
|
| 17 | 17 | ); |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | return array( |
| 3 | 3 | |
| 4 | - /* |
|
| 4 | + /* |
|
| 5 | 5 | |-------------------------------------------------------------------------- |
| 6 | 6 | | Your Salesforce credentials |
| 7 | 7 | |-------------------------------------------------------------------------- |
@@ -10,8 +10,8 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | // sandbox |
| 13 | - 'username' => '', |
|
| 14 | - 'password' => '', |
|
| 15 | - 'token' => '', |
|
| 16 | - 'wsdl' => app_path() . '/wsdl/enterprise.sandbox.wsdl.xml', |
|
| 13 | + 'username' => '', |
|
| 14 | + 'password' => '', |
|
| 15 | + 'token' => '', |
|
| 16 | + 'wsdl' => app_path() . '/wsdl/enterprise.sandbox.wsdl.xml', |
|
| 17 | 17 | ); |
@@ -13,5 +13,5 @@ |
||
| 13 | 13 | 'username' => '', |
| 14 | 14 | 'password' => '', |
| 15 | 15 | 'token' => '', |
| 16 | - 'wsdl' => app_path() . '/wsdl/enterprise.sandbox.wsdl.xml', |
|
| 16 | + 'wsdl' => app_path().'/wsdl/enterprise.sandbox.wsdl.xml', |
|
| 17 | 17 | ); |
@@ -6,43 +6,43 @@ |
||
| 6 | 6 | |
| 7 | 7 | class LaravelSalesforceServiceProvider extends ServiceProvider |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Indicates if loading of the provider is deferred. |
|
| 11 | - * |
|
| 12 | - * @var bool |
|
| 13 | - */ |
|
| 14 | - protected $defer = true; |
|
| 9 | + /** |
|
| 10 | + * Indicates if loading of the provider is deferred. |
|
| 11 | + * |
|
| 12 | + * @var bool |
|
| 13 | + */ |
|
| 14 | + protected $defer = true; |
|
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * Bootstrap the application events. |
|
| 18 | - * |
|
| 19 | - * @return void |
|
| 20 | - */ |
|
| 21 | - public function boot() |
|
| 22 | - { |
|
| 23 | - $this->package('davispeixoto/laravel-salesforce'); |
|
| 24 | - } |
|
| 16 | + /** |
|
| 17 | + * Bootstrap the application events. |
|
| 18 | + * |
|
| 19 | + * @return void |
|
| 20 | + */ |
|
| 21 | + public function boot() |
|
| 22 | + { |
|
| 23 | + $this->package('davispeixoto/laravel-salesforce'); |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * Register the service provider. |
|
| 28 | - * |
|
| 29 | - * @return void |
|
| 30 | - */ |
|
| 31 | - public function register() |
|
| 32 | - { |
|
| 33 | - $this->app['salesforce'] = $this->app->share(function ($app) { |
|
| 34 | - return new Salesforce($app['config']); |
|
| 35 | - }); |
|
| 36 | - } |
|
| 26 | + /** |
|
| 27 | + * Register the service provider. |
|
| 28 | + * |
|
| 29 | + * @return void |
|
| 30 | + */ |
|
| 31 | + public function register() |
|
| 32 | + { |
|
| 33 | + $this->app['salesforce'] = $this->app->share(function ($app) { |
|
| 34 | + return new Salesforce($app['config']); |
|
| 35 | + }); |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | - /** |
|
| 39 | - * Get the services provided by the provider. |
|
| 40 | - * |
|
| 41 | - * @return array |
|
| 42 | - */ |
|
| 43 | - public function provides() |
|
| 44 | - { |
|
| 45 | - return array('salesforce'); |
|
| 46 | - } |
|
| 38 | + /** |
|
| 39 | + * Get the services provided by the provider. |
|
| 40 | + * |
|
| 41 | + * @return array |
|
| 42 | + */ |
|
| 43 | + public function provides() |
|
| 44 | + { |
|
| 45 | + return array('salesforce'); |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | 48 | } |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public function register() |
| 32 | 32 | { |
| 33 | - $this->app['salesforce'] = $this->app->share(function ($app) { |
|
| 33 | + $this->app['salesforce'] = $this->app->share(function($app) { |
|
| 34 | 34 | return new Salesforce($app['config']); |
| 35 | 35 | }); |
| 36 | 36 | } |