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,11 +1,12 @@
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Yaml\Yaml;
use Doctrine\Persistence\ManagerRegistry;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Finder\Finder;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Yaml\Yaml;
class ThemeController extends AbstractController
{
@ -13,43 +14,43 @@ class ThemeController extends AbstractController
{
$finder = new Finder();
$dir = $this->getParameter('kernel.project_dir')."/public/themes";
$url=$this->getParameter('appAlias')."themes";
$dir = $this->getParameter('kernel.project_dir').'/public/themes';
$url = $this->getParameter('appAlias').'themes';
$finder->in($dir)->directories()->depth('== 0');
$themes=[];
$themes[""]["dir"]="";
$themes[""]["url"]=$url;
$themes[""]["name"]="Thème par défaut";
$themes = [];
$themes['']['dir'] = '';
$themes['']['url'] = $url;
$themes['']['name'] = 'Thème par défaut';
foreach ($finder as $file) {
$key=$file->getRelativePathname();
$themes[$key]["dir"]=$key;
$themes[$key]["url"]=$url."/".$key;
$key = $file->getRelativePathname();
$themes[$key]['dir'] = $key;
$themes[$key]['url'] = $url.'/'.$key;
$yml=Yaml::parseFile($dir.'/'.$key.'/info.yml');
$themes[$key]["name"]=$yml["name"];
$yml = Yaml::parseFile($dir.'/'.$key.'/info.yml');
$themes[$key]['name'] = $yml['name'];
}
$current=$request->getSession()->get("apptheme");
$currentheme=$themes[$current];
$current = $request->getSession()->get('apptheme');
$currentheme = $themes[$current];
unset($themes[$current]);
return $this->render('Theme/list.html.twig',[
'useheader' => true,
'usesidebar' => true,
'currentheme' => $currentheme,
'themes' => $themes
return $this->render('Theme/list.html.twig', [
'useheader' => true,
'usesidebar' => true,
'currentheme' => $currentheme,
'themes' => $themes,
]);
}
}
public function select($name,Request $request,ManagerRegistry $em)
public function select($name, Request $request, ManagerRegistry $em)
{
$config=$em->getRepository("App\Entity\Config")->findoneBy(["id"=>"apptheme"]);
$config = $em->getRepository("App\Entity\Config")->findoneBy(['id' => 'apptheme']);
$config->setValue($name);
$em->getManager()->flush();
$em->getManager()->flush();
return $this->redirectToRoute("app_admin_theme");
return $this->redirectToRoute('app_admin_theme');
}
}