Skip to content

Commit

Permalink
attempt to clear out codacy complexity (php mess detector) issues
Browse files Browse the repository at this point in the history
  • Loading branch information
davispeixoto committed May 4, 2015
1 parent e8af6db commit a343361
Show file tree
Hide file tree
Showing 9 changed files with 5,888 additions and 6,152 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,25 @@ This Laravel 4 package provides an interface for using [Salesforce CRM](http://w

Begin by installing this package through Composer. Edit your project's `composer.json` file to require `davispeixoto/laravel-salesforce`.

```json
"require": {
"laravel/framework": "4.*",
"davispeixoto/laravel-salesforce": "2.0.*"
}
```

Next, update Composer from the Terminal:

```sh
composer update
```

Once this operation completes, still in Terminal run:

```sh
php artisan config:publish davispeixoto/laravel-salesforce

```

### Configuration

Update the settings in the generated `app/config/packages/davispeixoto/laravel-salesforce` configuration file with your salesforce credentials.
Expand All @@ -36,10 +42,13 @@ Ensure you put [your WSDL file](https://www.salesforce.com/us/developer/docs/api

Finally add the service provider. Open `app/config/app.php`, and add a new item to the providers array.

```php
'Davispeixoto\LaravelSalesforce\LaravelSalesforceServiceProvider'
```

That's it! You're all set to go. Just use:

```php
Route::get('/test', function() {
try {
echo print_r(Salesforce::describeLayout('Account'));
Expand All @@ -48,6 +57,7 @@ That's it! You're all set to go. Just use:
die($e->getMessage() . $e->getTraceAsString());
}
});
```

### More Information

Expand All @@ -74,4 +84,3 @@ who kindly empower this project with a free open-source license for [PhpStorm](h
[2]: https://www.jetbrains.com/company/docs/logo_jetbrains.png
[3]: https://www.jetbrains.com/phpstorm/
[4]: https://www.jetbrains.com/phpstorm/documentation/docs/logo_phpstorm.png

20 changes: 11 additions & 9 deletions src/Davispeixoto/LaravelSalesforce/Facades/Salesforce.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

use Illuminate\Support\Facades\Facade;

class Salesforce extends Facade {
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor() {
return 'salesforce';
}
class Salesforce extends Facade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor()
{
return 'salesforce';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,52 @@

use Illuminate\Support\ServiceProvider;

class LaravelSalesforceServiceProvider extends ServiceProvider {

/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;

/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
$this->package('davispeixoto/laravel-salesforce');
}

/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app->booting(function() {
$loader = \Illuminate\Foundation\AliasLoader::getInstance();
$loader->alias('Salesforce', 'Davispeixoto\LaravelSalesforce\Facades\Salesforce');
$loader->alias('SF', 'Davispeixoto\LaravelSalesforce\Facades\Salesforce');
});

$this->app['salesforce'] = $this->app->share(function($app) {
return new Salesforce($app['config']);
});
}

/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return array('salesforce');
}
class LaravelSalesforceServiceProvider extends ServiceProvider
{

/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;

/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
$this->package('davispeixoto/laravel-salesforce');
}

/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app->booting(function () {
$loader = \Illuminate\Foundation\AliasLoader::getInstance();
$loader->alias('Salesforce', 'Davispeixoto\LaravelSalesforce\Facades\Salesforce');
$loader->alias('SF', 'Davispeixoto\LaravelSalesforce\Facades\Salesforce');
});

$this->app['salesforce'] = $this->app->share(function ($app) {
return new Salesforce($app['config']);
});
}

/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return array('salesforce');
}

}
Loading

0 comments on commit a343361

Please sign in to comment.