Skip to content

Commit 816a257

Browse files
Update CI Image (#37)
* Updating ci image to cimg/php:8.1. * Updating styleci. * Apply fixes from StyleCI * Updating ci to version 2.1. * Adding pecl install xdebug to ci. Co-authored-by: StyleCI Bot <bot@styleci.io>
1 parent 06b27dc commit 816a257

13 files changed

Lines changed: 44 additions & 24 deletions

File tree

.circleci/config.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
version: 2
1+
version: 2.1
22
jobs:
33
build:
44
docker:
5-
- image: ericdowell/laravel-circleci
5+
- image: cimg/php:8.1
66
environment:
77
TZ: "/usr/share/zoneinfo/America/Chicago"
88
steps:
99
- checkout
10+
- run:
11+
name: Enable xdebug Extension
12+
command: |
13+
sudo pecl install xdebug
14+
sudo docker-php-ext-enable xdebug
1015
- run:
1116
name: Install PHP Dependencies
1217
command: composer install --no-interaction --optimize-autoloader --prefer-dist

.styleci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
preset: laravel
2+
disabled:
3+
- no_unused_imports
4+
finder:
5+
not-name:
6+
- phpunit.php

src/Commands/RegisterUser.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class RegisterUser extends Command
3333
* Execute the console command.
3434
*
3535
* @return mixed
36+
*
3637
* @throws \RuntimeException
3738
*/
3839
public function handle(): int
@@ -56,8 +57,7 @@ public function handle(): int
5657
/**
5758
* Get all the attributes to create the User model with.
5859
*
59-
* @param \Illuminate\Database\Eloquent\Model $userInstance
60-
*
60+
* @param \Illuminate\Database\Eloquent\Model $userInstance
6161
* @return array
6262
*/
6363
protected function getUserAttributes(Model $userInstance): array
@@ -86,6 +86,7 @@ protected function getUserAttributes(Model $userInstance): array
8686
* Return contents of json file if option is present.
8787
*
8888
* @return array
89+
*
8990
* @throws \RuntimeException
9091
*/
9192
protected function getAttributesFromFile(): array
@@ -104,8 +105,7 @@ protected function getAttributesFromFile(): array
104105
/**
105106
* Make sure email is valid, set email as part of attributes.
106107
*
107-
* @param array $attributes
108-
*
108+
* @param array $attributes
109109
* @return void
110110
*/
111111
protected function askForEmail(array &$attributes)
@@ -124,8 +124,7 @@ protected function askForEmail(array &$attributes)
124124
/**
125125
* Make sure password and confirmation password match, set hashed password as part of attributes.
126126
*
127-
* @param array $attributes
128-
*
127+
* @param array $attributes
129128
* @return void
130129
*/
131130
protected function askForPassword(array &$attributes)

src/Contracts/Models/MediaModel.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public static function storage(): FilesystemAdapter;
2626
public function getBasePath(): string;
2727

2828
/**
29-
* @param \Illuminate\Http\UploadedFile $file
29+
* @param \Illuminate\Http\UploadedFile $file
3030
* @return string
3131
*/
3232
public function generatePath(UploadedFile $file): string;
@@ -37,33 +37,33 @@ public function generatePath(UploadedFile $file): string;
3737
public function getUrlAttribute(): string;
3838

3939
/**
40-
* @param \Illuminate\Http\UploadedFile $file
40+
* @param \Illuminate\Http\UploadedFile $file
4141
* @return string
4242
*/
4343
public function getFilename(UploadedFile $file): string;
4444

4545
/**
4646
* Save a new model and return the instance.
4747
*
48-
* @param \Illuminate\Http\UploadedFile $file
49-
* @param array $attributes
48+
* @param \Illuminate\Http\UploadedFile $file
49+
* @param array $attributes
5050
* @return \ResourceController\Traits\Models\MediaModel|\Illuminate\Database\Eloquent\Model
5151
*/
5252
public function createMedia(UploadedFile $file, array $attributes = []): Model;
5353

5454
/**
5555
* Create and return an un-saved model instance, but file saved to disk.
5656
*
57-
* @param \Illuminate\Http\UploadedFile $file
58-
* @param array $attributes
57+
* @param \Illuminate\Http\UploadedFile $file
58+
* @param array $attributes
5959
* @return \ResourceController\Traits\Models\MediaModel|\Illuminate\Database\Eloquent\Model
6060
*/
6161
public function makeMedia(UploadedFile $file, array $attributes = []): Model;
6262

6363
/**
6464
* Fill the model with an array of attributes.
6565
*
66-
* @param \Illuminate\Http\UploadedFile $file
66+
* @param \Illuminate\Http\UploadedFile $file
6767
* @return Model
6868
*/
6969
public function fillMedia(UploadedFile $file): Model;

src/Controllers/AbstractModelController.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ protected function setModelAction(string $action): self
124124
* @param string $name
125125
* @param \Illuminate\Http\Request|null $request
126126
* @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model
127+
*
127128
* @throws \Illuminate\Database\Eloquent\ModelNotFoundException
128129
*/
129130
protected function getModelParameter(string $name, Request $request = null): Model
@@ -141,7 +142,7 @@ protected function getModelParameter(string $name, Request $request = null): Mod
141142
}
142143

143144
/**
144-
* @param string $name
145+
* @param string $name
145146
* @return string
146147
*/
147148
protected function guessModelParameterNamespace(string $name): string
@@ -150,7 +151,7 @@ protected function guessModelParameterNamespace(string $name): string
150151
}
151152

152153
/**
153-
* @param string $name
154+
* @param string $name
154155
* @return string
155156
*/
156157
protected function guessModelParameterClass(string $name): string
@@ -160,7 +161,7 @@ protected function guessModelParameterClass(string $name): string
160161

161162
/**
162163
* @param string $name
163-
* @param mixed $model
164+
* @param mixed $model
164165
* @return \Illuminate\Database\Eloquent\Model
165166
*/
166167
protected function guessModelParameterFindOrFail(string $name, $model): Model
@@ -191,6 +192,7 @@ protected function getUserModel(Request $request = null): Model
191192
* an instanceof a specific interface/class.
192193
*
193194
* @param \Illuminate\Database\Eloquent\Model $model
195+
*
194196
* @throws \RuntimeException
195197
*/
196198
protected function isModelInstanceOf(Model $model): void
@@ -540,6 +542,7 @@ protected function gateDestroy(Model $instance): void
540542
*
541543
* @param \Illuminate\Http\Request $request
542544
* @return \Symfony\Component\HttpFoundation\Response|\Illuminate\Http\JsonResponse
545+
*
543546
* @throws \Exception
544547
*/
545548
public function destroy(Request $request)

src/Controllers/JsonHtml/AbstractModelController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ protected function additionalViewData(array &$data): void
5858
* @param int $status
5959
* @param array $headers
6060
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
61+
*
6162
* @throws \Throwable
6263
*/
6364
protected function response($data = [], $status = null, array $headers = [])
@@ -132,6 +133,7 @@ protected function gateCreate(Model $instance): void
132133
* Show the form for creating a new resource.
133134
*
134135
* @return \Illuminate\Http\Response
136+
*
135137
* @throws \Throwable|\Symfony\Component\HttpKernel\Exception\NotFoundHttpException
136138
*/
137139
public function create()
@@ -160,6 +162,7 @@ protected function gateEdit(Model $instance): void
160162
* Show the form for editing the specified resource.
161163
*
162164
* @return \Illuminate\Http\Response
165+
*
163166
* @throws \Throwable|\Symfony\Component\HttpKernel\Exception\NotFoundHttpException
164167
*/
165168
public function edit()

src/ServiceProvider.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ protected function packageName()
5050
/**
5151
* Return the base path for this package.
5252
*
53-
* @param string $path
54-
*
53+
* @param string $path
5554
* @return string
5655
*/
5756
protected function packageBasePath(string $path)

src/Traits/Controllers/Response/WithHtml.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ protected function getTemplateName(): string
3535
*
3636
* @param \Illuminate\Contracts\Support\Arrayable|array $data
3737
* @return array|string
38+
*
3839
* @throws \Throwable
3940
*/
4041
protected function renderHtml(array $data = [])
@@ -51,6 +52,7 @@ protected function renderHtml(array $data = [])
5152
* @param int $status
5253
* @param array $headers
5354
* @return \Symfony\Component\HttpFoundation\Response|\Illuminate\Http\Response
55+
*
5456
* @throws \Throwable
5557
*/
5658
protected function response($data = [], $status = 200, array $headers = [])

src/Traits/Controllers/UploadMediaFile.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ abstract protected function setForeignKeys(FormRequest $request, array &$attribu
3636

3737
/**
3838
* @param \Illuminate\Database\Eloquent\Model $model
39+
*
3940
* @throws \RuntimeException
4041
*/
4142
protected function isModelInstanceOf(Model $model): void
@@ -62,6 +63,7 @@ protected function getMedia(FormRequest $request): UploadedFile
6263
*
6364
* @param FormRequest $request
6465
* @return \Illuminate\Database\Eloquent\Model
66+
*
6567
* @throws \RuntimeException
6668
*/
6769
protected function modelCreate(FormRequest $request): Model

tests/src/Models/TestPost.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111
*
1212
* @property-read \ResourceController\Tests\Models\TestUser $user
1313
* @mixin \Illuminate\Database\Eloquent\Builder
14+
*
1415
* @property int $id
1516
* @property string $title
1617
* @property string $body
1718
* @property int $test_user_id
1819
* @property \Carbon\Carbon|null $created_at
1920
* @property \Carbon\Carbon|null $updated_at
21+
*
2022
* @method static \Illuminate\Database\Eloquent\Builder|\ResourceController\Tests\Models\TestPost whereBody($value)
2123
* @method static \Illuminate\Database\Eloquent\Builder|\ResourceController\Tests\Models\TestPost whereCreatedAt($value)
2224
* @method static \Illuminate\Database\Eloquent\Builder|\ResourceController\Tests\Models\TestPost whereId($value)

0 commit comments

Comments
 (0)