-
Notifications
You must be signed in to change notification settings - Fork 3
[203]: add model relations property annotations #208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 10 commits
9b5e4b4
8b1a21e
4f8a534
48d2b8c
63a88a9
5e293d2
c928e1b
c3c6115
caf1c8c
484b184
21dd8aa
569c284
21ef6ff
69628d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,11 +8,14 @@ | |
| @if($hasCarbonField) | ||
| use Carbon\Carbon; | ||
| @endif | ||
| @if($hasCollectionType) | ||
| use Illuminate\Database\Eloquent\Collection; | ||
| @endif | ||
|
|
||
| @if(!empty($anotationProperties)) | ||
| @if(!empty($annotationProperties)) | ||
| /** | ||
| @foreach($anotationProperties as $key => $value) | ||
| * @property {{ $value }} ${{ $key }} | ||
| @foreach($annotationProperties as $key => $value) | ||
| * @property {!! $value !!} ${{ $key }} | ||
|
||
| @endforeach | ||
| */ | ||
| @else | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -9,27 +9,24 @@ trait ModelMockTrait | |||||
| { | ||||||
| use GeneratorMockTrait; | ||||||
|
|
||||||
|
|
||||||
| public function mockFileSystemWithoutCommentModel(): void | ||||||
| public function mockDefaultFilesystem(): void | ||||||
| { | ||||||
| $fileSystemMock = new FileSystemMock(); | ||||||
| $fileSystemMock = new FileSystemMock; | ||||||
|
||||||
| $fileSystemMock = new FileSystemMock; | |
| $fileSystemMock = new FileSystemMock(); |
ref: https://www.php-fig.org/psr/psr-12/#4-classes-properties-and-methods
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's implement it as separate methods
public function mockFilesystem(array $models = []): voidpublic function mockDefaultFilesystem(): void
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| $fileSystemMock = new FileSystemMock; | |
| $fileSystemMock = new FileSystemMock(); |
ref: https://www.php-fig.org/psr/psr-12/#4-classes-properties-and-methods
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| <?php | ||
|
|
||
| namespace RonasIT\Support\Tests\Support\Models; | ||
|
|
||
| use Illuminate\Database\Eloquent\Collection; | ||
| use Illuminate\Database\Eloquent\Model; | ||
| use RonasIT\Support\Traits\ModelTrait; | ||
|
|
||
| /** | ||
| * @property Collection<Category> $categories | ||
| */ | ||
| class WelcomeBonus extends Model | ||
| { | ||
| use ModelTrait; | ||
|
|
||
| public function getConnectionName(): string | ||
| { | ||
| return 'pgsql'; | ||
| } | ||
|
|
||
| protected $fillable = [ | ||
| 'title', | ||
| 'name', | ||
| ]; | ||
|
|
||
| public function some_relation() | ||
| { | ||
| } | ||
|
|
||
| public function categories() | ||
| { | ||
| return $this->belongsToMany(Category::class); | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.