anax / commons
Anax Commons module, stuff used by several modules.
Installs: 15 424
Dependents: 67
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 1
Language:Makefile
Requires
- php: ^7.2
Requires (Dev)
- anax/di: ^2.0.0@alpha
- phpstan/phpstan: ^0.12
- phpunit/phpunit: ^9
- dev-master
- v2.0.14
- v2.0.13
- v2.0.12
- v2.0.11
- v2.0.10
- v2.0.9
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v2.0.0-beta.13
- v2.0.0-beta.12
- v2.0.0-beta.11
- v2.0.0-beta.10
- v2.0.0-beta.9
- v2.0.0-beta.8
- v2.0.0-beta.7
- v2.0.0-beta.6
- v2.0.0-beta.5
- v2.0.0-beta.4
- v2.0.0-beta.3
- v2.0.0-beta.2
- v2.0.0-beta.1
- v2.0.0-alpha.8
- v2.0.0-alpha.7
- v2.0.0-alpha.6
- v2.0.0-alpha.5
- v2.0.0-alpha.4
- v2.0.0-alpha.3
- v2.0.0-alpha.2
- v2.0.0-alpha.1
- v1.0.0
This package is auto-updated.
Last update: 2024-11-29 05:27:17 UTC
README
A place to store common files to have one central copy of the latest version of the file.
This repo is used by scaffolding processes which copies files to set upp fresh installations. The repo also contains development files and various configurations files for external build tools.
The repo also contains commonly used sourcecode like interfaces and traits, such code that is usually shared between several Anax modules.
Functions
The module contains a set of functions that are used by several modules. The functions are available in src/functions.php
and they are autoloaded when this module is used.
Class, interface, trait
The following classes, interfaces and traits exists.
Exceptions
There are no module specific exceptions supplied by this module.
App injectable
When a class wants to be injectable with $app
it should implement the interface AppInjectableInterface
which can be implemented by using the trait AppInjectableTrait
.
Here is a sample when used together with a controller which can be injected with $app
.
namespace Anax\Controller;
use Anax\Commons\AppInjectableInterface;
use Anax\Commons\AppInjectableTrait;
/**
* A sample controller to show how a controller class can be implemented.
* The controller will be injected with $app if implementing the interface
* AppInjectableInterface, like this sample class does.
* The controller is mounted on a particular route and can then handle all
* requests for that mount point.
*
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class SampleAppController implements AppInjectableInterface
{
use AppInjectableTrait;
Review the source of the actual interface and the trait to investigate their implementation.
Container injectable
When a class wants to be injectable with the service container $di
it should implement the interface ContainerInjectableInterface
which can be implemented by using the trait ContainerInjectableTrait
.
Here is a sample when used together with a controller which can be injected with $di
.
namespace Anax\Controller;
use Anax\Commons\ContainerInjectableInterface;
use Anax\Commons\ContainerInjectableTrait;
/**
* A sample controller to show how a controller class can be implemented.
* The controller will be injected with $di if implementing the interface
* ContainerInjectableInterface, like this sample class does.
* The controller is mounted on a particular route and can then handle all
* requests for that mount point.
*
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class SampleController implements ContainerInjectableInterface
{
use ContainerInjectableTrait;
Review the source of the actual interface and the trait to investigate their implementation.
Versioning
We use Semantic Versioning 2.0.0.
License
This software carries a MIT license. See LICENSE.txt for details.
.
..: Copyright (c) 2013 - 2019 Mikael Roos, mos@dbwebb.se