Skip to content

Instantly share code, notes, and snippets.

@guilhermeblanco
Last active April 25, 2016 20:57
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 guilhermeblanco/56ec0e11e7b029c2cfdcaf6fe2323742 to your computer and use it in GitHub Desktop.
Save guilhermeblanco/56ec0e11e7b029c2cfdcaf6fe2323742 to your computer and use it in GitHub Desktop.
<?php
interface Entity<ID> {
public function getId() : ID;
}
class AuctionItem implements Entity<string> {
private $id;
public function getId() : string {
return $this->id;
}
}
abstract class EntityRepository<ID, E extends Entity<ID>> {
// ...
}
final class AuctionItemRepository extends EntityRepository<string, AuctionItem> {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment