otis22/php-interfaces

Interfaces for OOP php projects

1.1.1 2021-02-07 19:00 UTC

This package is auto-updated.

Last update: 2024-04-08 01:37:11 UTC


README

GitHub CI

php-interfaces

php interfaces for OOP projects

Installation

composer require otis22/php-interfaces

KeyValue Interface

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'
        ];
    }
}