for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace AbterPhp\Framework\Bootstrappers\Vendor;
use AbterPhp\Framework\Authorization\CacheManager;
use AbterPhp\Framework\Authorization\CombinedAdapter;
use CasbinAdapter\Database\Adapter;
use Opulence\Ioc\Bootstrappers\Bootstrapper;
use Opulence\Ioc\Bootstrappers\ILazyBootstrapper;
use Opulence\Ioc\IContainer;
class CasbinCombinedAdapterBootstrapper extends Bootstrapper implements ILazyBootstrapper
{
/**
* @return array
*/
public function getBindings(): array
return [
CombinedAdapter::class,
];
}
* @param IContainer $container
public function registerBindings(IContainer $container)
$cacheManager = $container->resolve(CacheManager::class);
$databaseAdapter = $container->resolve(Adapter::class);
$combinedAdapter = new CombinedAdapter($databaseAdapter, $cacheManager);
$container->bindInstance(CombinedAdapter::class, $combinedAdapter);