-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from nutgram/container
Ability to resolve objects through container
- Loading branch information
Showing
8 changed files
with
166 additions
and
3 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
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,23 @@ | ||
<?php | ||
|
||
namespace SergiX44\Hydrator\Tests\Fixtures\DI; | ||
|
||
class Leaves | ||
{ | ||
public int $n; | ||
|
||
private Sun|null $sun = null; | ||
|
||
public function __construct(?Sun $sun = null) | ||
{ | ||
$this->sun = $sun; | ||
} | ||
|
||
/** | ||
* @return Sun|null | ||
*/ | ||
public function getSun(): ?Sun | ||
{ | ||
return $this->sun; | ||
} | ||
} |
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,21 @@ | ||
<?php | ||
|
||
namespace SergiX44\Hydrator\Tests\Fixtures\DI; | ||
|
||
class Sun | ||
{ | ||
private string $from; | ||
|
||
public function __construct(string $from) | ||
{ | ||
$this->from = $from; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getFrom(): string | ||
{ | ||
return $this->from; | ||
} | ||
} |
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,27 @@ | ||
<?php | ||
|
||
namespace SergiX44\Hydrator\Tests\Fixtures\DI; | ||
|
||
class Tree | ||
{ | ||
public string $name; | ||
|
||
public Wood $wood; | ||
|
||
public Leaves $leaves; | ||
|
||
private Sun|null $sun = null; | ||
|
||
public function __construct(?Sun $sun = null) | ||
{ | ||
$this->sun = $sun; | ||
} | ||
|
||
/** | ||
* @return Sun|null | ||
*/ | ||
public function getSun(): ?Sun | ||
{ | ||
return $this->sun; | ||
} | ||
} |
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,23 @@ | ||
<?php | ||
|
||
namespace SergiX44\Hydrator\Tests\Fixtures\DI; | ||
|
||
class Wood | ||
{ | ||
public int $kg; | ||
|
||
private Sun|null $sun = null; | ||
|
||
public function __construct(?Sun $sun = null) | ||
{ | ||
$this->sun = $sun; | ||
} | ||
|
||
/** | ||
* @return Sun|null | ||
*/ | ||
public function getSun(): ?Sun | ||
{ | ||
return $this->sun; | ||
} | ||
} |
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,17 @@ | ||
<?php | ||
|
||
namespace SergiX44\Hydrator\Tests\Fixtures; | ||
|
||
use SergiX44\Hydrator\Tests\Fixtures\Store\Tag; | ||
|
||
final class ObjectWithMissingData | ||
{ | ||
public string $name; | ||
|
||
protected ?Tag $tag = null; | ||
|
||
public function getTag(): ?Tag | ||
{ | ||
return $this->tag; | ||
} | ||
} |
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