Skip to content

Instantly share code, notes, and snippets.

@webdevilopers
Created February 25, 2019 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webdevilopers/fa3bbfbb8e2b36a4a4619217e6469fdc to your computer and use it in GitHub Desktop.
Save webdevilopers/fa3bbfbb8e2b36a4a4619217e6469fdc to your computer and use it in GitHub Desktop.
Using Entity as Factory for Value Object
<?php
abstract class DormerType implements DormerTypeInterface
{}
<?php
interface DormerTypeInterface
{
public function canHaveGutterInstalled(): bool;
}
<?php
class FlatRoofDormer extends DormerType
{
public function canHaveGutterInstalled(): bool
{
return true;
}
}
@webdevilopers
Copy link
Author

Discussion continued on phpddd:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment