Skip to content

myadmin-plugins/contracts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

detain/myadmin-contracts

Shared MyAdmin\App\Contracts\* interfaces for the MyAdmin billing/management platform, extracted from the core interserver/my repo so that the core and every detain/myadmin-* module can depend on a single source of truth — and unit-test against these contracts with fakes without pulling in the whole core.

Interfaces

Interface Purpose
AccountsInterface Accounts abstraction (read/add/update/delete/cross_reference/exists/get_next_id).
DatabaseInterface Abstraction over MyDb\Generic / MyDb\Mysqli\Db (query/next_record/num_rows/real_escape/getLastInsertId/qr/f).
RequestContextInterface Per-request user/view state (ima/accountId/locale/language/theme/isAdmin).
SessionInterface Session abstraction (verify/create/destroy/appsession/CSRF helpers).

Namespace-preserving: the interfaces keep their original MyAdmin\App\Contracts\ namespace, so moving them out of core requires no changes to the ~23 core consumers or to any module.

Install

composer require detain/myadmin-contracts

Writing fakes in a module's tests

use MyAdmin\App\Contracts\DatabaseInterface;

final class FakeDb implements DatabaseInterface
{
    // ... implement the interface, return canned rows ...
}

License

LGPL-2.1-only.

About

Shared MyAdmin\App\Contracts\* interfaces for the MyAdmin platform (detain/myadmin-contracts)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages