for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Smart\AuthenticationBundle\DataFixtures\Processor;
use Fidry\AliceDataFixtures\ProcessorInterface;
use Smart\AuthenticationBundle\Security\SmartUserInterface;
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
/**
* Nicolas Bastien <[email protected]>
*/
class UserProcessor implements ProcessorInterface
{
* @var UserPasswordEncoderInterface
private $encoder;
* @param UserPasswordEncoderInterface $encoder
public function __construct(UserPasswordEncoderInterface $encoder)
$this->encoder = $encoder;
}
* @inheritdoc
public function preProcess(string $fixtureId, $object): void
if (!$object instanceof SmartUserInterface) {
return;
$object->setPassword($this->encoder->encodePassword($object, $object->getPlainPassword()));
public function postProcess(string $fixtureId, $object): void