@@ -47,6 +47,7 @@ |
||
| 47 | 47 | * By default Laravel takes (server/database/factories) as the |
| 48 | 48 | * path to the factories, this function changes the path to load |
| 49 | 49 | * the factories from the infrastructure directory. |
| 50 | + * @param string $customPath |
|
| 50 | 51 | */ |
| 51 | 52 | public function changeTheDefaultDatabaseModelsFactoriesPath($customPath) |
| 52 | 53 | { |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | { |
| 28 | 28 | if (Config::get('database.query_debugging')) { |
| 29 | 29 | // TODO: might not work in laravel 5.2 - check the events section of the upgrading giud and test it |
| 30 | - DB::listen(function ($query, $bindings, $time, $connection) use ($terminal, $log) { |
|
| 30 | + DB::listen(function($query, $bindings, $time, $connection) use ($terminal, $log) { |
|
| 31 | 31 | $fullQuery = vsprintf(str_replace(['%', '?'], ['%%', '%s'], $query), $bindings); |
| 32 | 32 | |
| 33 | 33 | $text = $connection . ' (' . $time . '): ' . $fullQuery; |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function changeTheDefaultDatabaseModelsFactoriesPath($customPath) |
| 52 | 52 | { |
| 53 | - $this->app->singleton(\Illuminate\Database\Eloquent\Factory::class, function ($app) use ($customPath) { |
|
| 53 | + $this->app->singleton(\Illuminate\Database\Eloquent\Factory::class, function($app) use ($customPath) { |
|
| 54 | 54 | $faker = $app->make(\Faker\Generator::class); |
| 55 | 55 | |
| 56 | 56 | return \Illuminate\Database\Eloquent\Factory::construct($faker, base_path() . $customPath); |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $allServiceProviders[] = PortButler::buildMainServiceProvider($containersNamespace, $containerName); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - return array_unique($allServiceProviders) ? : []; |
|
| 84 | + return array_unique($allServiceProviders) ?: []; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | // if DataArray `\League\Fractal\Serializer\DataArraySerializer` do noting since it's set by default by the Dingo API |
| 103 | 103 | if ($serializerName !== 'DataArray') { |
| 104 | - app('Dingo\Api\Transformer\Factory')->setAdapter(function () use ($serializerName) { |
|
| 104 | + app('Dingo\Api\Transformer\Factory')->setAdapter(function() use ($serializerName) { |
|
| 105 | 105 | switch ($serializerName) { |
| 106 | 106 | case 'JsonApi': |
| 107 | 107 | $serializer = new \League\Fractal\Serializer\JsonApiSerializer(Config::get('api.domain')); |
@@ -28,10 +28,10 @@ discard block |
||
| 28 | 28 | public $loggedInTestingUser; |
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | - * @param $endpoint |
|
| 31 | + * @param string $endpoint |
|
| 32 | 32 | * @param string $verb |
| 33 | 33 | * @param array $data |
| 34 | - * @param bool|true $protected |
|
| 34 | + * @param boolean $protected |
|
| 35 | 35 | * @param array $header |
| 36 | 36 | * |
| 37 | 37 | * @throws \Symfony\Component\Debug\Exception\UndefinedMethodException |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | /** |
| 117 | 117 | * @param null $userDetails |
| 118 | 118 | * |
| 119 | - * @return mixed |
|
| 119 | + * @return App\Containers\User\Models\User |
|
| 120 | 120 | */ |
| 121 | 121 | public function registerAndLoginTestingUser($userDetails = null) |
| 122 | 122 | { |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | /** |
| 146 | - * @param $keys |
|
| 146 | + * @param string[] $keys |
|
| 147 | 147 | * @param $response |
| 148 | 148 | */ |
| 149 | 149 | public function assertResponseContainKeys($keys, $response) |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | public function up() |
| 13 | 13 | { |
| 14 | - Schema::create('users', function (Blueprint $table) { |
|
| 14 | + Schema::create('users', function(Blueprint $table) { |
|
| 15 | 15 | $table->increments('id'); |
| 16 | 16 | $table->string('name'); |
| 17 | 17 | |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | public function up() |
| 13 | 13 | { |
| 14 | - Schema::create('password_resets', function (Blueprint $table) { |
|
| 14 | + Schema::create('password_resets', function(Blueprint $table) { |
|
| 15 | 15 | $table->string('email')->index(); |
| 16 | 16 | $table->string('token')->index(); |
| 17 | 17 | $table->timestamp('created_at'); |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | // User |
| 4 | -$factory->define(App\Containers\User\Models\User::class, function (Faker\Generator $faker) { |
|
| 4 | +$factory->define(App\Containers\User\Models\User::class, function(Faker\Generator $faker) { |
|
| 5 | 5 | return [ |
| 6 | 6 | 'name' => $faker->name, |
| 7 | 7 | 'email' => $faker->email, |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | public function up() |
| 20 | 20 | { |
| 21 | - Schema::create('stripe_accounts', function (Blueprint $table) { |
|
| 21 | + Schema::create('stripe_accounts', function(Blueprint $table) { |
|
| 22 | 22 | $table->increments('id'); |
| 23 | 23 | $table->string('customer_id'); |
| 24 | 24 | $table->string('card_id')->nullable(); |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | public function up() |
| 20 | 20 | { |
| 21 | - Schema::create('paypal_accounts', function (Blueprint $table) { |
|
| 21 | + Schema::create('paypal_accounts', function(Blueprint $table) { |
|
| 22 | 22 | $table->increments('id'); |
| 23 | 23 | |
| 24 | 24 | $table->string('some_id'); |
@@ -3,6 +3,6 @@ |
||
| 3 | 3 | // Default root route |
| 4 | 4 | use Illuminate\Support\Facades\Config; |
| 5 | 5 | |
| 6 | -$router->any('/', function () { |
|
| 6 | +$router->any('/', function() { |
|
| 7 | 7 | return response()->json(['Welcome to ' . Config::get('api.name') . '.']); |
| 8 | 8 | }); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $apiVersionNumber = $this->getRouteFileVersionNumber($fileNameWithoutExtension); |
| 55 | 55 | |
| 56 | 56 | $this->apiRouter->version('v' . $apiVersionNumber, |
| 57 | - function (DingoApiRouter $router) use ($file, $containerPath, $containersNamespace) { |
|
| 57 | + function(DingoApiRouter $router) use ($file, $containerPath, $containersNamespace) { |
|
| 58 | 58 | |
| 59 | 59 | $router->group([ |
| 60 | 60 | // Routes Namespace |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | 'limit' => Config::get('api.limit'), |
| 66 | 66 | // The API limit expiry time. |
| 67 | 67 | 'expires' => Config::get('api.limit_expires'), |
| 68 | - ], function ($router) use ($file) { |
|
| 68 | + ], function($router) use ($file) { |
|
| 69 | 69 | |
| 70 | 70 | require $file->getPathname(); |
| 71 | 71 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | foreach ($files as $file) { |
| 97 | 97 | $this->webRouter->group([ |
| 98 | 98 | 'namespace' => $containersNamespace . '\\Containers\\' . basename($containerPath) . '\\Controllers', |
| 99 | - ], function (LaravelRouter $router) use ($file) { |
|
| 99 | + ], function(LaravelRouter $router) use ($file) { |
|
| 100 | 100 | require $file->getPathname(); |
| 101 | 101 | }); |
| 102 | 102 | } |