-
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.
- Loading branch information
1 parent
1950ee0
commit 3d7daa4
Showing
10 changed files
with
102 additions
and
81 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
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 |
---|---|---|
@@ -1,4 +1,2 @@ | ||
ideaVersion = IU-2019.2 | ||
javaVersion = 1.8 | ||
javaTargetVersion = 1.8 | ||
phpPluginVersion = 192.5728.108 |
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
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,9 @@ | ||
public function equals({{ type }} $other): bool | ||
{ | ||
return {%- for property in properties -%} | ||
{%- if (loop.index > 1) -%} | ||
&& | ||
{%- endif -%} | ||
$this->{{ property.getText() }} === $other->{{ property.getText() }} | ||
{%- endfor -%}; | ||
} |
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,13 @@ | ||
public static function with( | ||
{%- for property, type in properties -%} | ||
{{ type }} ${{ property }} {%- if (loop.last == false) -%}, {%- endif -%} | ||
{%- endfor -%} | ||
): self | ||
{ | ||
$instance = new self(); | ||
{%- for property, _ in properties -%} | ||
$instance->{{ property }} = ${{ property }}; | ||
{%- endfor %} | ||
|
||
return $instance; | ||
} |
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,4 @@ | ||
public function to{{ type_method_name }}(): {{ type }} | ||
{ | ||
return $this->{{ property }}; | ||
} |
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,7 @@ | ||
public function with{{ capitalize(property) }}({{ property_type }} ${{ property }}):self | ||
{ | ||
$instance = clone $this; | ||
$instance->{{ property }} = ${{ property }}; | ||
|
||
return $instance; | ||
} |