generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed class property completion when using nested states
- Loading branch information
Showing
6 changed files
with
99 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 13 additions & 3 deletions
16
.../ekvedaras/classfactoryphpstorm/domain/method/state/StateMethodReferenceOutsideFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
src/test/testData/state/insideFactory/nestedStateCallsCaretAtNestedState.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
|
||
class Id { | ||
public readonly string $value; | ||
} | ||
|
||
class Age { | ||
public readonly int $value; | ||
} | ||
|
||
|
||
class Account { | ||
public function __construct( | ||
public readonly Id $id, | ||
public readonly Age $age, | ||
) {} | ||
} | ||
|
||
class IdFactory extends EKvedaras\ClassFactory\ClassFactory { | ||
protected string $class = Id::class; | ||
|
||
protected function definition(): array | ||
{ | ||
return [ | ||
'value' => 'abc', | ||
]; | ||
} | ||
} | ||
|
||
class AgeFactory extends EKvedaras\ClassFactory\ClassFactory { | ||
protected string $class = Age::class; | ||
|
||
protected function definition(): array | ||
{ | ||
return [ | ||
'value' => 1, | ||
]; | ||
} | ||
} | ||
|
||
class AccountFactory extends EKvedaras\ClassFactory\ClassFactory { | ||
protected string $class = Account::class; | ||
|
||
protected function definition(): array | ||
{ | ||
return [ | ||
'id' => IdFactory::new(), | ||
'age' => AgeFactory::new(), | ||
]; | ||
} | ||
|
||
public function specialState1(): static | ||
{ | ||
return $this->state(fn (array $attributes) => [ | ||
'id' => 1, | ||
'age' => $attributes['age']->state([ | ||
'<caret>' | ||
]), | ||
]); | ||
} | ||
} |