bapcat / services
Installs: 519
Dependents: 4
Suggesters: 4
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
pkg:composer/bapcat/services
Requires
- php: ^7.1
- bapcat/phi: ^1.0 || ^2.0 || ^3.0
Requires (Dev)
- phpunit/phpunit: ^7.5
- roave/security-advisories: dev-master
This package is auto-updated.
Last update: 2025-10-15 08:15:36 UTC
README
Services
This package provides a controlled boot environment for cross-package dependencies.
Installation
Composer
Composer is the recommended method of installation for BapCat packages.
$ composer require bapcat/services
GitHub
BapCat packages may be downloaded from GitHub.
Features
Registration
The main use for Services is to register IoC bindings.
<?php namespace BapCat\CoolLogger; use BapCat\CoolLogger\Logger; use BapCat\Interfaces\Ioc\Ioc; class LoggingServiceProvider implements ServiceProvider { private $ioc; public function __construct(Ioc $ioc) { $this->ioc = $ioc; } public function register() { // Make Logger a singleton $this->ioc->singleton(Logger::class, Logger::class); // Bind the bap.log alias to the Logger singleton $this->ioc->bind('bap.log', Logger::class); } }