Skip to content

Commit

Permalink
Merge pull request #18 from iamyukihiro/add-birthday
Browse files Browse the repository at this point in the history
add birthday
  • Loading branch information
iamyukihiro authored Apr 29, 2024
2 parents 557027f + bda4981 commit 7981ea5
Show file tree
Hide file tree
Showing 8 changed files with 310 additions and 10 deletions.
4 changes: 4 additions & 0 deletions bin/dev/php/conf.d/php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[php]
memory_limit=-1
timezone='Asia/Tokyo'
date.timezone='Asia/Tokyo'
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"require": {
"php": "8.3.*",
"psy/psysh": "^0.12",
"symfony/var-dumper": "^7.0"
"symfony/var-dumper": "^7.0",
"symfony/clock": "^7.0"
},
"require-dev": {
"phpunit/phpunit": "^11.1",
Expand Down
281 changes: 280 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</testsuite>
</testsuites>
<php>
<ini name="date.timezone" value="UTC" />
<ini name="date.timezone" value="Asia/Tokyo" />
<ini name="intl.default_locale" value="C.UTF-8" />
<ini name="memory_limit" value="2048M" />
<env name="DB_CONNECTION" value="testing" />
Expand Down
11 changes: 7 additions & 4 deletions src/Domain/Logic/RandomMedakaGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,25 @@
use Iamyukihiro\Aquarium\Domain\Model\Fish\Medaka;
use Iamyukihiro\Aquarium\Domain\ValueObject\Breed;

use function Symfony\Component\Clock\now;

/**
* The psychopathic class.
*/
class RandomMedakaGenerator
{
public function __construct(
private NicknameGenerator $nicknameGenerator
private NicknameGenerator $nicknameGenerator,
) {
}

public function generate(): Medaka
{
return new Medaka(
$this->nicknameGenerator->generate(),
new Breed(FishType::MEDAKA, $this->pickBreedName()),
'Swim'
nickName: $this->nicknameGenerator->generate(),
breed: new Breed(FishType::MEDAKA, $this->pickBreedName()),
act: 'Swim',
birthday: now()
);
}

Expand Down
3 changes: 3 additions & 0 deletions src/Domain/Model/Fish/FishInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Iamyukihiro\Aquarium\Domain\Model\Fish;

use DateTimeImmutable;
use Iamyukihiro\Aquarium\Domain\ValueObject\Breed;

interface FishInterface
Expand All @@ -13,4 +14,6 @@ public function getNickName(): string;
public function getBreed(): Breed;

public function getAct(): string;

public function getBirthday(): DateTimeImmutable;
}
Loading

0 comments on commit 7981ea5

Please sign in to comment.