for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @author Stefano Torresi (http://stefanotorresi.it)
* @license See the file LICENSE.txt for copying permission.
* ************************************************
*/
namespace Thorr\OAuth2\Factory;
use Thorr\OAuth2\Options\ModuleOptions;
use Zend\Crypt\Password\Bcrypt;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
class BcryptFactory implements FactoryInterface
{
* Create service
*
* @param ServiceLocatorInterface $serviceLocator
* @return Bcrypt
public function createService(ServiceLocatorInterface $serviceLocator)
/** @var ModuleOptions $moduleOptions */
$moduleOptions = $serviceLocator->get(ModuleOptions::class);
return new Bcrypt(['cost' => $moduleOptions->getBcryptCost()]);
}