Skip to content

Instantly share code, notes, and snippets.

@a-yasui
Created Nov 10, 2021
Embed
What would you like to do?
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