Skip to content

Instantly share code, notes, and snippets.

View koyablue's full-sized avatar
👾
Thriving

koyablue

👾
Thriving
View GitHub Profile
@koyablue
koyablue / test.php
Last active January 27, 2021 02:50
test
class Sample
{
public function test()
{
echo 'aaaaaaa!!';
}
}
<?php
interface Vehicle
{
public function run();
public function stop();
public function manipulateWindows(string $openOrClose);
<?php
class NotificationController
{
private $service;
public function __construct(NotificationServiceInterface $service)
{
$this->service = $service;
}
<?php
class Controller
{
private $service;
public function __construct(EmailLibInterface $service)
{
$this->service = $service;
}
<?php
interface NotificationServiceInterface
{
public function send(int $notificationCode);
}
class UserNotificationService implements NotificationServiceInterface
{
//略
<?php echo 'Hello world'; php>
<?php
class FileImportController extends Controller
{
public function dummy(FileImportRequest $request)
{
$fileType = $request->file_type;
if ($fileType === config('values.file_type.office_work.value')) {
//do something
<form action="{{route('route_name')}}" method="post">
@csrf
<input type="file" name="joblist_file" />
<select name="file_type">
@foreach(config('values.file_type') as $label => $fileType)
<option value="{{$fileType}}">{{$label}}</option>
@endforeach
</select>
</form>
<?php
namespace App\Services\FileImport\Interface;
use App\Models\Dto\FileImportDto;
interface FileImporterInterface
{
/**
* readData
<?php
namespace App\Services\FileImport\Importer;
use App\Models\Dto\FileImportDto;
use App\Services\FileImport\Interface\FileImporterInterface;
class RestaurantJoblistFileImporter implements FileImporterInterface
{
public function readData(FileImportDto $fileDto): array