fix(continuous-integration): correction php-cs-fixer
All checks were successful
Cadoles/nineskeletor/pipeline/pr-master This commit looks good

This commit is contained in:
2022-09-23 16:14:15 +02:00
parent 5f3cc51f5c
commit b78f54b76c
70 changed files with 5943 additions and 5549 deletions

View File

@ -1,22 +1,18 @@
<?php
namespace App\Entity;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use App\Validator;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Core\User\LegacyPasswordAuthenticatedUserInterface;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use App\Validator as Validator;
use Symfony\Component\Security\Core\User\LegacyPasswordAuthenticatedUserInterface;
use Symfony\Component\Security\Core\User\UserInterface;
/**
* @ORM\Entity
* @ORM\HasLifecycleCallbacks()
* @ORM\Entity(repositoryClass="App\Repository\RegistrationRepository")
*
*
* @UniqueEntity(fields="username", message="Un utilisateur existe déjà avec ce login.")
* @UniqueEntity(fields="email", message="Un utilisateur existe déjà avec ce mail.")
*/
@ -49,7 +45,7 @@ class Registration implements UserInterface, LegacyPasswordAuthenticatedUserInte
* @ORM\Column(type="string", length=250)
*/
private $password;
/**
* @Validator\Password()
*/
@ -74,7 +70,7 @@ class Registration implements UserInterface, LegacyPasswordAuthenticatedUserInte
* @ORM\Column(type="string", length=250, nullable=true)
*/
private $postaladress;
/**
* @ORM\Column(type="string", length=60, nullable=true)
*/
@ -84,11 +80,11 @@ class Registration implements UserInterface, LegacyPasswordAuthenticatedUserInte
* @ORM\Column(type="string", length=250, nullable=true)
*/
private $job;
/**
* @ORM\Column(type="string", length=250, nullable=true)
*/
private $position;
private $position;
/**
* @ORM\Column(name="motivation", type="text", nullable=true)
@ -103,18 +99,18 @@ class Registration implements UserInterface, LegacyPasswordAuthenticatedUserInte
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $keyexpire;
private $keyexpire;
/**
* @ORM\Column(type="string", length=60, nullable=true)
*/
private $keyvalue;
private $keyvalue;
/**
* @ORM\Column(type="integer", length=60, nullable=false)
*/
private $statut;
/**
* @ORM\ManyToOne(targetEntity="Niveau01", inversedBy="registrations")
* @ORM\JoinColumn(nullable=false)
@ -124,47 +120,45 @@ class Registration implements UserInterface, LegacyPasswordAuthenticatedUserInte
/**
* @ORM\ManyToOne(targetEntity="Niveau02", inversedBy="registrations")
*/
private $niveau02;
private $niveau02;
//== CODE A NE PAS REGENERER
// == CODE A NE PAS REGENERER
private $roles;
public function getUserIdentifier(): string
{
return $this->username;
}
public function setPasswordDirect($password)
{
// Permet de setter le password généré lors de l'inscription
$this->password = $password;
return $this;
}
}
/**
* @see PasswordAuthenticatedUserInterface
*/
public function getPassword(): string
{
return $this->password;
return $this->password;
}
public function setPassword($password): self
{
if($password!=$this->password&&$password!=""){
if ($password != $this->password && '' != $password) {
// Placer le password non encodé dans une variable tempo sur laquel on va appliquer la contraite de form
$this->passwordplain = $password;
// Password encrypté format openldap
// Password encrypté format openldap
$this->salt = uniqid(mt_rand(), true);
$hash = "{SSHA}" . base64_encode(pack("H*", sha1($password . $this->salt)) . $this->salt);
$hash = '{SSHA}'.base64_encode(pack('H*', sha1($password.$this->salt)).$this->salt);
$this->password = $hash;
$this->password = $hash;
}
return $this;
}
@ -194,22 +188,24 @@ class Registration implements UserInterface, LegacyPasswordAuthenticatedUserInte
public function hasRole(string $role): ?bool
{
return in_array($role,$this->getRoles());
return in_array($role, $this->getRoles());
}
public function setRole(string $role): self
{
if(!$this->hasRole($role))
array_push($this->roles,$role);
if (!$this->hasRole($role)) {
array_push($this->roles, $role);
}
return $this;
}
public function getDisplayname() {
return $this->firstname." ".$this->lastname;
public function getDisplayname()
{
return $this->firstname.' '.$this->lastname;
}
//== FIN DU CODE A NE PAS REGENERER
// == FIN DU CODE A NE PAS REGENERER
public function getId(): ?int
{
@ -414,5 +410,4 @@ class Registration implements UserInterface, LegacyPasswordAuthenticatedUserInte
return $this;
}
}