fix(continuous-integration): correction point phpstan de level 1
Cadoles/nineskeletor/pipeline/pr-master This commit looks good Details

This commit is contained in:
Arnaud Fornerot 2022-09-23 15:34:07 +02:00
parent 86b11372e7
commit 5f3cc51f5c
10 changed files with 32 additions and 11 deletions

View File

@ -9,7 +9,7 @@ deps:
npm ci
phpstan:
symfony php tools/phpstan/vendor/bin/phpstan analyze ./src
symfony php tools/phpstan/vendor/bin/phpstan analyze ./src -l 1
php-cs-fixer:
tools/php-cs-fixer/symfony-php-cs-fixer.sh fix --verbose --show-progress=dots

View File

@ -43,6 +43,9 @@ class CropController extends AbstractController
// Récupérer les tailles de l'image
$width = $this->getWidth($large_image_location);
$height = $this->getHeight($large_image_location);
$max_height=null;
$max_width=null;
$ratio=null;
// Définir le pourcentage de réduction de l'image
switch ($type) {
@ -146,6 +149,8 @@ class CropController extends AbstractController
$newImageWidth = ceil($width * $scale);
$newImageHeight = ceil($height * $scale);
$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);
$source=null;
switch($imageType) {
case "image/gif":
$source=imagecreatefromgif($image);
@ -192,7 +197,7 @@ class CropController extends AbstractController
$newImageWidth=900;
$newImageHeight=900;
$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);
$source=null;
switch($imageType) {
case "image/gif":

View File

@ -347,6 +347,9 @@ class GroupController extends AbstractController
$draw= $query['draw'];
$ordercolumn=$query['order'][0]['column'];
$orderdir=$query['order'][0]['dir'];
$usermodo=null;
$niveau01=null;
$niveau02=null;
// Nombre total d'enregistrement
$qb = $em->getManager()->createQueryBuilder();
@ -391,6 +394,7 @@ class GroupController extends AbstractController
break;
}
$total=$qb->getQuery()->getSingleScalarResult();
$totalf=null;
// Nombre d'enregistrement filtré
if($search["value"]=="")
@ -545,6 +549,7 @@ class GroupController extends AbstractController
$draw= $query['draw'];
$ordercolumn=$query['order'][0]['column'];
$orderdir=$query['order'][0]['dir'];
$usermodo=null;
// Nombre total d'enregistrement
$qb = $em->getManager()->createQueryBuilder();
@ -785,6 +790,7 @@ class GroupController extends AbstractController
}
private function canseemember($access,$entity,$em,$fgblock=true) {
$toreturn=false;
switch($access) {
case "admin" : $toreturn=($entity->getId()>0); break;
case "modo" : $toreturn=($entity->getId()>0); break;

View File

@ -38,6 +38,8 @@ class Niveau02Controller extends AbstractController
$draw= $query['draw'];
$ordercolumn=$query['order'][0]['column'];
$orderdir=$query['order'][0]['dir'];
$total=null;
$totalf=null;
// Nombre total d'enregistrement
switch($access) {

View File

@ -56,6 +56,7 @@ class RegistrationController extends AbstractController
$draw= $query['draw'];
$ordercolumn=$query['order'][0]['column'];
$orderdir=$query['order'][0]['dir'];
$usermodo=null;
// Nombre total d'enregistrement
if($access=="admin")

View File

@ -65,7 +65,7 @@ class SecurityController extends AbstractController
}
}
public function loginSQL(Request $request, AuthenticationUtils $authenticationUtils)
public function loginSQL(Request $request, AuthenticationUtils $authenticationUtils,ManagerRegistry $em)
{
return $this->render('Home/loginSQL.html.twig', array(
'last_username' => $authenticationUtils->getLastUsername(),
@ -143,7 +143,7 @@ class SecurityController extends AbstractController
return $this->autoconnexion($user,$redirect,$request);
}
public function loginLDAP(Request $request)
public function loginLDAP(Request $request, AuthenticationUtils $authenticationUtils,ManagerRegistry $em)
{
// Création du formulaire
$form = $this->createForm(LoginType::class);
@ -212,7 +212,7 @@ class SecurityController extends AbstractController
}
public function loginOPENID(Request $request, AuthenticationUtils $authenticationUtils)
public function loginOPENID(Request $request, AuthenticationUtils $authenticationUtils,ManagerRegistry $em)
{
$state=Uuid::uuid4();
$request->getSession()->set("oauthState",$state);
@ -256,6 +256,7 @@ class SecurityController extends AbstractController
$attributes=json_decode(json_encode($response->body), true);
// Username
$username="";
if(isset($attributes[$this->getParameter('oauthUsername')]))
$username = $attributes[$this->getParameter('oauthUsername')];

View File

@ -44,7 +44,8 @@ class UserController extends AbstractController
$draw= $query['draw'];
$ordercolumn=$query['order'][0]['column'];
$orderdir=$query['order'][0]['dir'];
$niveau01=null;
$niveau02=null;
// Nombre total d'enregistrement
switch($access) {

View File

@ -20,7 +20,9 @@ class ApiService
}
public function run($method,$url,$query,$header=null,$content="json") {
// Entete
$headerini=null;
switch($content) {
case "json":
$headerini = [

View File

@ -367,6 +367,7 @@ class LdapService
public function updateNiveauUser(User $user,$todel=false) {
$dn = $this->basedn;
$connection = $this->connect();
$result=null;
// NIVEAU01
// On recherche le Niveau01 actuellement asscocié à l'utilisateur

View File

@ -35,6 +35,8 @@ class UploadListener
$newImageWidth = ceil($width * $scale);
$newImageHeight = ceil($height * $scale);
$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);
$source=null;
switch($imageType) {
case "image/gif":
$source=imagecreatefromgif($image);