php interfaces for OOP projects
composer require otis22/php-interfaces
Interface for objects which can be convert to simple assoc array key => value
<?php
declare(strict_types=1);
use Otis22\PhpInterfaces\KeyValue;
final class FakeLoginCredentials implements KeyValue
{
public function asKeyValue(): array
{
return [
'login' => 'test'
];
}
}