Skip to content

Instantly share code, notes, and snippets.

@a-yasui
Created November 10, 2021 06:30
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 a-yasui/df39ccfc5ebe3036c847a62999a23b59 to your computer and use it in GitHub Desktop.
Save a-yasui/df39ccfc5ebe3036c847a62999a23b59 to your computer and use it in GitHub Desktop.
Dummy class to repository
<?php
namespace Main\Repository;
interface HogeRepository
{
public getVolumes(): int;
}
namespace Tests\Dummy;
final class Hoge implements HogeRepository
{
public $getVolumes;
// もっと楽に書ける方法はないものか…
public getVolumes(): int
{
$mt = __FUNCTION__;
return $this->{$mt};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment