@@ -120,6 +120,9 @@ discard block |
||
| 120 | 120 | $this->app['config']->set('database.default', $defaultConnection); |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | + /** |
|
| 124 | + * @param string $connection |
|
| 125 | + */ |
|
| 123 | 126 | protected function getSchemaManager($connection = null) |
| 124 | 127 | { |
| 125 | 128 | if (isset($connection)) { |
@@ -131,6 +134,9 @@ discard block |
||
| 131 | 134 | return $connection->getDoctrineSchemaManager(); |
| 132 | 135 | } |
| 133 | 136 | |
| 137 | + /** |
|
| 138 | + * @return \Doctrine\DBAL\Platforms\AbstractPlatform |
|
| 139 | + */ |
|
| 134 | 140 | protected function getDatabasePlatform($connection = null) |
| 135 | 141 | { |
| 136 | 142 | if (isset($connection)) { |
@@ -84,7 +84,7 @@ |
||
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | if ($this->option('force')) { |
| 87 | - DB::transaction(function () use ($diffStatements) { |
|
| 87 | + DB::transaction(function() use ($diffStatements) { |
|
| 88 | 88 | foreach ($diffStatements as $statement) { |
| 89 | 89 | DB::statement($statement); |
| 90 | 90 | } |
@@ -13,7 +13,6 @@ |
||
| 13 | 13 | protected $model; |
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | - * @param App $app |
|
| 17 | 16 | */ |
| 18 | 17 | public function __construct(EloquentModel $model) |
| 19 | 18 | { |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | { |
| 46 | 46 | $columns = $this->getTableColumns(); |
| 47 | 47 | |
| 48 | - if (! array_key_exists($name, $columns)) { |
|
| 48 | + if (!array_key_exists($name, $columns)) { |
|
| 49 | 49 | throw new \Exception("Column ".$name." not found on ".$this->model->getTable()); |
| 50 | 50 | } |
| 51 | 51 | |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | * |
| 29 | 29 | * @param string $modelName |
| 30 | 30 | * |
| 31 | - * @return Illuminate\Database\Eloquent\Model |
|
| 31 | + * @return EloquentModel |
|
| 32 | 32 | */ |
| 33 | 33 | public function getModelInstance($modelName) |
| 34 | 34 | { |
@@ -10,9 +10,9 @@ |
||
| 10 | 10 | |
| 11 | 11 | class ModelManager implements ModelManagerContract |
| 12 | 12 | { |
| 13 | - /** |
|
| 14 | - * @var Application |
|
| 15 | - */ |
|
| 13 | + /** |
|
| 14 | + * @var Application |
|
| 15 | + */ |
|
| 16 | 16 | private $app; |
| 17 | 17 | |
| 18 | 18 | /** |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | { |
| 35 | 35 | $modelInstance = $this->app->make($modelName); |
| 36 | 36 | |
| 37 | - if (! $modelInstance instanceof EloquentModel) { |
|
| 37 | + if (!$modelInstance instanceof EloquentModel) { |
|
| 38 | 38 | $message = "Target [$modelName] is not an Illuminate\Database\Eloquent\Model instance."; |
| 39 | 39 | |
| 40 | 40 | throw new \Exception($message); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | if ($modelInstance instanceof HasCustomRepository) { |
| 56 | 56 | $repository = $this->app->make($modelInstance->repository(), $args); |
| 57 | 57 | |
| 58 | - if (! $repository instanceof Repository) { |
|
| 58 | + if (!$repository instanceof Repository) { |
|
| 59 | 59 | $message = "The [$modelName] custom repository must extend ANavallaSuiza\Laravel\Database\Repository\Eloquent\Repository."; |
| 60 | 60 | |
| 61 | 61 | throw new \Exception($message); |
@@ -26,7 +26,6 @@ discard block |
||
| 26 | 26 | protected $skipCriteria = false; |
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | - * @param App $app |
|
| 30 | 29 | */ |
| 31 | 30 | public function __construct(EloquentModel $model) |
| 32 | 31 | { |
@@ -35,7 +34,7 @@ discard block |
||
| 35 | 34 | } |
| 36 | 35 | |
| 37 | 36 | /** |
| 38 | - * @return mixed |
|
| 37 | + * @return EloquentModel |
|
| 39 | 38 | */ |
| 40 | 39 | public function getModel() |
| 41 | 40 | { |
@@ -76,7 +75,7 @@ discard block |
||
| 76 | 75 | |
| 77 | 76 | /** |
| 78 | 77 | * @param array $data |
| 79 | - * @return mixed |
|
| 78 | + * @return EloquentModel |
|
| 80 | 79 | */ |
| 81 | 80 | public function create(array $data) |
| 82 | 81 | { |
@@ -104,7 +103,7 @@ discard block |
||
| 104 | 103 | |
| 105 | 104 | /** |
| 106 | 105 | * @param $id |
| 107 | - * @return mixed |
|
| 106 | + * @return integer |
|
| 108 | 107 | */ |
| 109 | 108 | public function delete($id) |
| 110 | 109 | { |
@@ -150,7 +149,6 @@ discard block |
||
| 150 | 149 | /** |
| 151 | 150 | * @param $field |
| 152 | 151 | * @param $value |
| 153 | - * @param array $columns |
|
| 154 | 152 | * @return mixed |
| 155 | 153 | */ |
| 156 | 154 | public function findBy($field, $value, array $with = array()) |
@@ -168,7 +166,6 @@ discard block |
||
| 168 | 166 | /** |
| 169 | 167 | * @param $field |
| 170 | 168 | * @param $value |
| 171 | - * @param array $columns |
|
| 172 | 169 | * @return mixed |
| 173 | 170 | */ |
| 174 | 171 | public function findByOrFail($field, $value, array $with = array()) |
@@ -236,7 +233,7 @@ discard block |
||
| 236 | 233 | } |
| 237 | 234 | |
| 238 | 235 | /** |
| 239 | - * @return mixed |
|
| 236 | + * @return Collection |
|
| 240 | 237 | */ |
| 241 | 238 | public function getCriteria() |
| 242 | 239 | { |
@@ -216,7 +216,7 @@ |
||
| 216 | 216 | */ |
| 217 | 217 | protected function refresh() |
| 218 | 218 | { |
| 219 | - if (! $this->model instanceof EloquentModel) { |
|
| 219 | + if (!$this->model instanceof EloquentModel) { |
|
| 220 | 220 | $this->model = $this->model->getModel(); |
| 221 | 221 | } |
| 222 | 222 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | { |
| 31 | 31 | $this->mergeConfigFrom(__DIR__.'/../../config/laravel-database.php', 'laravel-database'); |
| 32 | 32 | |
| 33 | - $this->app->bind('ANavallaSuiza\Laravel\Database\Contracts\Manager\ModelManager', function ($app) { |
|
| 33 | + $this->app->bind('ANavallaSuiza\Laravel\Database\Contracts\Manager\ModelManager', function($app) { |
|
| 34 | 34 | return new ModelManager($app); |
| 35 | 35 | }); |
| 36 | 36 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function __call($method, $params) |
| 55 | 55 | { |
| 56 | - if (! method_exists($this->repository, $method)) { |
|
| 56 | + if (!method_exists($this->repository, $method)) { |
|
| 57 | 57 | throw new RepositoryException("Method $method not found on repository"); |
| 58 | 58 | } |
| 59 | 59 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $lifetime = $this->lifetime; |
| 79 | 79 | unset($this->lifetime); |
| 80 | 80 | |
| 81 | - return $this->cache->remember($key, $lifetime, function () use ($method, $params) { |
|
| 81 | + return $this->cache->remember($key, $lifetime, function() use ($method, $params) { |
|
| 82 | 82 | return call_user_func_array(array($this->repository, $method), $params); |
| 83 | 83 | }); |
| 84 | 84 | } |