Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ablunier/laravel-database
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrián Pardellas Blunier committed Feb 5, 2016
2 parents f23b47e + a30575a commit 90f674b
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
# Laravel Database [![Build Status](https://travis-ci.org/ablunier/laravel-database.svg?branch=master)](https://travis-ci.org/ablunier/laravel-database)
# Laravel Database [![Build Status](https://travis-ci.org/ablunier/laravel-database.svg?branch=master)](https://travis-ci.org/ablunier/laravel-database) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ablunier/laravel-database/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ablunier/laravel-database/?branch=master) [![Code Coverage](https://scrutinizer-ci.com/g/ablunier/laravel-database/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/ablunier/laravel-database/?branch=master)

This package provides some utilities and patterns to work with Laravel databases

Expand Down
8 changes: 7 additions & 1 deletion src/Console/Commands/SchemaUpdate.php
Expand Up @@ -84,7 +84,7 @@ public function handle()
}

if ($this->option('force')) {
DB::transaction(function () use ($diffStatements) {
DB::transaction(function() use ($diffStatements) {
foreach ($diffStatements as $statement) {
DB::statement($statement);
}
Expand Down Expand Up @@ -120,6 +120,9 @@ protected function createInMemoryDatabase()
$this->app['config']->set('database.default', $defaultConnection);
}

/**
* @param string $connection
*/
protected function getSchemaManager($connection = null)
{
if (isset($connection)) {
Expand All @@ -131,6 +134,9 @@ protected function getSchemaManager($connection = null)
return $connection->getDoctrineSchemaManager();
}

/**
* @return \Doctrine\DBAL\Platforms\AbstractPlatform
*/
protected function getDatabasePlatform($connection = null)
{
if (isset($connection)) {
Expand Down
1 change: 0 additions & 1 deletion src/Dbal/Eloquent/AbstractionLayer.php
Expand Up @@ -13,7 +13,6 @@ class AbstractionLayer implements AbstractionLayerContract
protected $model;

/**
* @param App $app
*/
public function __construct(EloquentModel $model)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Manager/Eloquent/ModelManager.php
Expand Up @@ -28,7 +28,7 @@ public function __construct(Application $app)
*
* @param string $modelName
*
* @return Illuminate\Database\Eloquent\Model
* @return EloquentModel
*/
public function getModelInstance($modelName)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Manager/ModelManagerServiceProvider.php
Expand Up @@ -30,7 +30,7 @@ public function register()
{
$this->mergeConfigFrom(__DIR__.'/../../config/laravel-database.php', 'laravel-database');

$this->app->bind('ANavallaSuiza\Laravel\Database\Contracts\Manager\ModelManager', function ($app) {
$this->app->bind('ANavallaSuiza\Laravel\Database\Contracts\Manager\ModelManager', function($app) {
return new ModelManager($app);
});

Expand Down
4 changes: 2 additions & 2 deletions src/Repository/Eloquent/Cache.php
Expand Up @@ -53,7 +53,7 @@ public function __construct(RepositoryContract $repository, LaravelCache $cache)
*/
public function __call($method, $params)
{
if (! method_exists($this->repository, $method)) {
if (!method_exists($this->repository, $method)) {
throw new RepositoryException("Method $method not found on repository");
}

Expand All @@ -78,7 +78,7 @@ public function __call($method, $params)
$lifetime = $this->lifetime;
unset($this->lifetime);

return $this->cache->remember($key, $lifetime, function () use ($method, $params) {
return $this->cache->remember($key, $lifetime, function() use ($method, $params) {
return call_user_func_array(array($this->repository, $method), $params);
});
}
Expand Down
11 changes: 4 additions & 7 deletions src/Repository/Eloquent/Repository.php
Expand Up @@ -26,7 +26,6 @@ class Repository implements RepositoryContract, CriteriaPerformer
protected $skipCriteria = false;

/**
* @param App $app
*/
public function __construct(EloquentModel $model)
{
Expand All @@ -35,7 +34,7 @@ public function __construct(EloquentModel $model)
}

/**
* @return mixed
* @return EloquentModel
*/
public function getModel()
{
Expand Down Expand Up @@ -76,7 +75,7 @@ public function paginate($perPage = 15, array $with = array())

/**
* @param array $data
* @return mixed
* @return EloquentModel
*/
public function create(array $data)
{
Expand Down Expand Up @@ -104,7 +103,7 @@ public function update(array $data, $id, $field = "id")

/**
* @param $id
* @return mixed
* @return integer
*/
public function delete($id)
{
Expand Down Expand Up @@ -150,7 +149,6 @@ public function findOrFail($id, array $with = array())
/**
* @param $field
* @param $value
* @param array $columns
* @return mixed
*/
public function findBy($field, $value, array $with = array())
Expand All @@ -168,7 +166,6 @@ public function findBy($field, $value, array $with = array())
/**
* @param $field
* @param $value
* @param array $columns
* @return mixed
*/
public function findByOrFail($field, $value, array $with = array())
Expand Down Expand Up @@ -236,7 +233,7 @@ public function skipCriteria($status = true)
}

/**
* @return mixed
* @return Collection
*/
public function getCriteria()
{
Expand Down

0 comments on commit 90f674b

Please sign in to comment.