💄 Ajout PHP CS Fixer
All checks were successful
Apply PHP CS Fixer / php-cs-fixer (push) Successful in 1m33s
All checks were successful
Apply PHP CS Fixer / php-cs-fixer (push) Successful in 1m33s
This commit is contained in:
parent
f858359a51
commit
4cab96f9b6
17
.gitea/workflows/php-lint.yml
Normal file
17
.gitea/workflows/php-lint.yml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
name: Apply PHP CS Fixer
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
php-cs-fixer:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Run PHP CS Fixer
|
||||||
|
uses: docker://oskarstark/php-cs-fixer-ga
|
||||||
|
with:
|
||||||
|
args: --diff --dry-run
|
||||||
|
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -33,4 +33,8 @@
|
|||||||
/uploads/*
|
/uploads/*
|
||||||
!uploads/.gitkeep
|
!uploads/.gitkeep
|
||||||
|
|
||||||
/public/kumora/
|
/public/kumora/
|
||||||
|
###> friendsofphp/php-cs-fixer ###
|
||||||
|
/.php-cs-fixer.php
|
||||||
|
/.php-cs-fixer.cache
|
||||||
|
###< friendsofphp/php-cs-fixer ###
|
||||||
|
103
.php-cs-fixer.dist.php
Normal file
103
.php-cs-fixer.dist.php
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of PHP CS Fixer.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||||
|
*
|
||||||
|
* This source file is subject to the MIT license that is bundled
|
||||||
|
* with this source code in the file LICENSE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
$finder = PhpCsFixer\Finder::create()
|
||||||
|
->ignoreVCSIgnored(true)
|
||||||
|
->in(__DIR__)
|
||||||
|
->append([
|
||||||
|
__DIR__ . '/dev-tools/doc.php',
|
||||||
|
// __DIR__.'/php-cs-fixer', disabled, as we want to be able to run bootstrap file even on lower PHP version, to show nice message
|
||||||
|
__FILE__,
|
||||||
|
])
|
||||||
|
;
|
||||||
|
|
||||||
|
$config = new PhpCsFixer\Config();
|
||||||
|
$config
|
||||||
|
->setRiskyAllowed(true)
|
||||||
|
->setRules([
|
||||||
|
'@PHP82Migration' => true,
|
||||||
|
'@PHP80Migration:risky' => true,
|
||||||
|
'@PhpCsFixer:risky' => true,
|
||||||
|
'@PSR1' => true,
|
||||||
|
'@PSR2' => true,
|
||||||
|
'@PSR12' => true,
|
||||||
|
'align_multiline_comment' => [
|
||||||
|
'comment_type' => 'phpdocs_only',
|
||||||
|
],
|
||||||
|
'array_indentation' => true,
|
||||||
|
'array_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
// Anciennement 'braces'
|
||||||
|
'single_space_around_construct' => true,
|
||||||
|
'control_structure_braces' => true,
|
||||||
|
'control_structure_continuation_position' => true,
|
||||||
|
'declare_parentheses' => true,
|
||||||
|
'no_multiple_statements_per_line' => true,
|
||||||
|
'braces_position' => true,
|
||||||
|
'statement_indentation' => true,
|
||||||
|
|
||||||
|
'compact_nullable_type_declaration' => true,
|
||||||
|
'concat_space' => ['spacing' => 'one'],
|
||||||
|
'doctrine_annotation_array_assignment' => [
|
||||||
|
'operator' => '=',
|
||||||
|
],
|
||||||
|
'doctrine_annotation_spaces' => [
|
||||||
|
'after_array_assignments_equals' => false,
|
||||||
|
'before_array_assignments_equals' => false,
|
||||||
|
],
|
||||||
|
'php_unit_internal_class' => false,
|
||||||
|
'php_unit_test_class_requires_covers' => false,
|
||||||
|
'no_extra_blank_lines' => [
|
||||||
|
'tokens' => [
|
||||||
|
'break',
|
||||||
|
'continue',
|
||||||
|
'curly_brace_block',
|
||||||
|
'extra',
|
||||||
|
'parenthesis_brace_block',
|
||||||
|
'return',
|
||||||
|
'square_brace_block',
|
||||||
|
'throw',
|
||||||
|
'use',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'no_useless_else' => true,
|
||||||
|
'no_useless_return' => true,
|
||||||
|
'ordered_imports' => [
|
||||||
|
'imports_order' => [
|
||||||
|
'class',
|
||||||
|
'function',
|
||||||
|
'const',
|
||||||
|
],
|
||||||
|
'sort_algorithm' => 'alpha',
|
||||||
|
],
|
||||||
|
'php_unit_method_casing' => [
|
||||||
|
'case' => 'camel_case',
|
||||||
|
],
|
||||||
|
'phpdoc_order' => true,
|
||||||
|
'phpdoc_separation' => true,
|
||||||
|
'phpdoc_trim_consecutive_blank_line_separation' => true,
|
||||||
|
'phpdoc_types_order' => ['null_adjustment' => 'always_last'],
|
||||||
|
'strict_comparison' => true,
|
||||||
|
'strict_param' => true,
|
||||||
|
'yoda_style' => true,
|
||||||
|
'modernize_strpos' => true, // needs PHP 8+ or polyfill
|
||||||
|
'native_constant_invocation' => false,
|
||||||
|
'php_unit_strict' => false,
|
||||||
|
'native_function_invocation' => false,
|
||||||
|
])
|
||||||
|
->setFinder($finder)
|
||||||
|
;
|
||||||
|
|
||||||
|
return $config;
|
@ -107,6 +107,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
|
"friendsofphp/php-cs-fixer": "^3.68",
|
||||||
"phpunit/phpunit": "^11.5.2",
|
"phpunit/phpunit": "^11.5.2",
|
||||||
"symfony/browser-kit": "7.2.*",
|
"symfony/browser-kit": "7.2.*",
|
||||||
"symfony/css-selector": "7.2.*",
|
"symfony/css-selector": "7.2.*",
|
||||||
|
1036
composer.lock
generated
Executable file → Normal file
1036
composer.lock
generated
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
|
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
|
||||||
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
|
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {
|
declare(strict_types=1);
|
||||||
require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';
|
|
||||||
|
if (file_exists(dirname(__DIR__) . '/var/cache/prod/App_KernelProdContainer.preload.php')) {
|
||||||
|
require dirname(__DIR__) . '/var/cache/prod/App_KernelProdContainer.preload.php';
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the importmap for this application.
|
* Returns the importmap for this application.
|
||||||
*
|
*
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
use App\Kernel;
|
use App\Kernel;
|
||||||
|
|
||||||
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
|
require_once dirname(__DIR__) . '/vendor/autoload_runtime.php';
|
||||||
|
|
||||||
return function (array $context) {
|
return static fn (array $context) => new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
|
||||||
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
|
|
||||||
};
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Command;
|
namespace App\Command;
|
||||||
|
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
@ -24,8 +26,7 @@ class CreateUserCommand extends Command
|
|||||||
private readonly UserPasswordHasherInterface $passwordHasher,
|
private readonly UserPasswordHasherInterface $passwordHasher,
|
||||||
private readonly EntityManagerInterface $entityManager,
|
private readonly EntityManagerInterface $entityManager,
|
||||||
private readonly UserRepository $userRepository
|
private readonly UserRepository $userRepository
|
||||||
)
|
) {
|
||||||
{
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,7 +58,6 @@ class CreateUserCommand extends Command
|
|||||||
$io->error('Une erreur est survenue lors de la création de l\'utilisateur');
|
$io->error('Une erreur est survenue lors de la création de l\'utilisateur');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return Command::SUCCESS;
|
return Command::SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Controller;
|
namespace App\Controller;
|
||||||
|
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
@ -40,7 +42,6 @@ class AdminController extends AbstractController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#[Route('/users/create', name: 'user_create')]
|
#[Route('/users/create', name: 'user_create')]
|
||||||
#[Route('/users/edit/{user}', name: 'user_edit')]
|
#[Route('/users/edit/{user}', name: 'user_edit')]
|
||||||
public function editUsers(#[MapEntity(id: 'user')] ?User $user, Request $request): Response
|
public function editUsers(#[MapEntity(id: 'user')] ?User $user, Request $request): Response
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Controller;
|
namespace App\Controller;
|
||||||
|
|
||||||
use App\Form\CreateDirectoryType;
|
use App\Form\CreateDirectoryType;
|
||||||
@ -31,14 +33,14 @@ class FilesController extends AbstractController
|
|||||||
{
|
{
|
||||||
$path = $this->normalizePath($path);
|
$path = $this->normalizePath($path);
|
||||||
|
|
||||||
if ($path !== '' && !$defaultAdapter->directoryExists($path)) {
|
if ('' !== $path && !$defaultAdapter->directoryExists($path)) {
|
||||||
throw $this->createNotFoundException("Ce dossier n'existe pas !");
|
throw $this->createNotFoundException("Ce dossier n'existe pas !");
|
||||||
}
|
}
|
||||||
|
|
||||||
$files = $defaultAdapter->listContents('/' . $path);
|
$files = $defaultAdapter->listContents('/' . $path);
|
||||||
|
|
||||||
$realFiles = [];
|
$realFiles = [];
|
||||||
|
|
||||||
foreach ($files as $file) {
|
foreach ($files as $file) {
|
||||||
$filename = basename($file['path']);
|
$filename = basename($file['path']);
|
||||||
if (!str_starts_with($filename, '.')) {
|
if (!str_starts_with($filename, '.')) {
|
||||||
@ -47,9 +49,9 @@ class FilesController extends AbstractController
|
|||||||
'path' => $file['path'],
|
'path' => $file['path'],
|
||||||
'last_modified' => $file['lastModified'],
|
'last_modified' => $file['lastModified'],
|
||||||
'size' => $file['fileSize'] ?? null,
|
'size' => $file['fileSize'] ?? null,
|
||||||
'url' => $file['type'] === 'file'
|
'url' => 'file' === $file['type']
|
||||||
? $this->generateUrl('app_files_app_file_proxy', ['filename' => $file['path']], UrlGeneratorInterface::ABSOLUTE_URL)
|
? $this->generateUrl('app_files_app_file_proxy', ['filename' => $file['path']], UrlGeneratorInterface::ABSOLUTE_URL)
|
||||||
: $this->generateUrl('app_files_index', ['path' => $file['path']]),
|
: $this->generateUrl('app_files_index', ['path' => $file['path']]),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -58,9 +60,8 @@ class FilesController extends AbstractController
|
|||||||
usort($realFiles, static function ($a, $b) {
|
usort($realFiles, static function ($a, $b) {
|
||||||
if ($a['type'] === $b['type']) {
|
if ($a['type'] === $b['type']) {
|
||||||
return $a['path'] <=> $b['path'];
|
return $a['path'] <=> $b['path'];
|
||||||
} else {
|
|
||||||
return $a['type'] <=> $b['type'];
|
|
||||||
}
|
}
|
||||||
|
return $a['type'] <=> $b['type'];
|
||||||
});
|
});
|
||||||
|
|
||||||
return $this->render('files/index.html.twig', [
|
return $this->render('files/index.html.twig', [
|
||||||
@ -70,11 +71,11 @@ class FilesController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/file-proxy', name: 'app_file_proxy')]
|
#[Route('/file-proxy', name: 'app_file_proxy')]
|
||||||
public function fileProxy(Filesystem $defaultAdapter, #[MapQueryParameter('filename')]string $filename)
|
public function fileProxy(Filesystem $defaultAdapter, #[MapQueryParameter('filename')] string $filename)
|
||||||
{
|
{
|
||||||
$file = $this->normalizePath($filename);
|
$file = $this->normalizePath($filename);
|
||||||
$mimetype = $defaultAdapter->mimeType($file);
|
$mimetype = $defaultAdapter->mimeType($file);
|
||||||
if ($mimetype === '') {
|
if ('' === $mimetype) {
|
||||||
$mimetype = 'application/octet-stream';
|
$mimetype = 'application/octet-stream';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,7 +103,7 @@ class FilesController extends AbstractController
|
|||||||
{
|
{
|
||||||
$file = $this->normalizePath($filename);
|
$file = $this->normalizePath($filename);
|
||||||
|
|
||||||
if ($file !== '' && !str_starts_with($file, '.') && $defaultAdapter->fileExists($file)) {
|
if ('' !== $file && !str_starts_with($file, '.') && $defaultAdapter->fileExists($file)) {
|
||||||
$defaultAdapter->delete($file);
|
$defaultAdapter->delete($file);
|
||||||
|
|
||||||
$this->addFlash('success', 'Le fichier a bien été supprimé.');
|
$this->addFlash('success', 'Le fichier a bien été supprimé.');
|
||||||
@ -123,8 +124,7 @@ class FilesController extends AbstractController
|
|||||||
{
|
{
|
||||||
$path = $this->normalizePath($path);
|
$path = $this->normalizePath($path);
|
||||||
|
|
||||||
|
if ('' !== $path && !str_starts_with($path, '.') && $defaultAdapter->directoryExists($path)) {
|
||||||
if ($path !== '' && !str_starts_with($path, '.') && $defaultAdapter->directoryExists($path)) {
|
|
||||||
$defaultAdapter->deleteDirectory($path);
|
$defaultAdapter->deleteDirectory($path);
|
||||||
|
|
||||||
$this->addFlash('success', 'Le dossier a bien été supprimé.');
|
$this->addFlash('success', 'Le dossier a bien été supprimé.');
|
||||||
@ -145,7 +145,7 @@ class FilesController extends AbstractController
|
|||||||
{
|
{
|
||||||
$filepath = $this->normalizePath($filepath);
|
$filepath = $this->normalizePath($filepath);
|
||||||
|
|
||||||
if ($filepath === '' || str_starts_with($filepath, '.') || !$defaultAdapter->fileExists($filepath)) {
|
if ('' === $filepath || str_starts_with($filepath, '.') || !$defaultAdapter->fileExists($filepath)) {
|
||||||
throw $this->createNotFoundException("Ce fichier n'existe pas !");
|
throw $this->createNotFoundException("Ce fichier n'existe pas !");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,7 +220,7 @@ class FilesController extends AbstractController
|
|||||||
{
|
{
|
||||||
$filepath = $this->normalizePath($filepath);
|
$filepath = $this->normalizePath($filepath);
|
||||||
|
|
||||||
if ($filepath === '' || str_starts_with($filepath, '.') || !$defaultAdapter->directoryExists($filepath)) {
|
if ('' === $filepath || str_starts_with($filepath, '.') || !$defaultAdapter->directoryExists($filepath)) {
|
||||||
throw $this->createNotFoundException("Ce dossier n'existe pas !");
|
throw $this->createNotFoundException("Ce dossier n'existe pas !");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -264,7 +264,7 @@ class FilesController extends AbstractController
|
|||||||
|
|
||||||
$form = $this->createForm(UploadType::class);
|
$form = $this->createForm(UploadType::class);
|
||||||
|
|
||||||
if ($path !== '' && !$defaultAdapter->directoryExists($path)) {
|
if ('' !== $path && !$defaultAdapter->directoryExists($path)) {
|
||||||
throw $this->createNotFoundException("Ce dossier n'existe pas !");
|
throw $this->createNotFoundException("Ce dossier n'existe pas !");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Controller;
|
namespace App\Controller;
|
||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Controller;
|
namespace App\Controller;
|
||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Attribute\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
|
|
||||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||||
|
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
|
||||||
|
|
||||||
class SecurityController extends AbstractController
|
class SecurityController extends AbstractController
|
||||||
{
|
{
|
||||||
@ -20,7 +22,7 @@ class SecurityController extends AbstractController
|
|||||||
if ($this->isGranted('IS_AUTHENTICATED_FULLY')) {
|
if ($this->isGranted('IS_AUTHENTICATED_FULLY')) {
|
||||||
return $this->redirectToRoute('app_home');
|
return $this->redirectToRoute('app_home');
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the login error if there is one
|
// get the login error if there is one
|
||||||
$error = $authenticationUtils->getLastAuthenticationError();
|
$error = $authenticationUtils->getLastAuthenticationError();
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Entity;
|
namespace App\Entity;
|
||||||
|
|
||||||
use App\Repository\UserRepository;
|
use App\Repository\UserRepository;
|
||||||
@ -34,10 +36,9 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||||||
#[ORM\Column]
|
#[ORM\Column]
|
||||||
private ?string $password = null;
|
private ?string $password = null;
|
||||||
|
|
||||||
|
|
||||||
public function initId(): void
|
public function initId(): void
|
||||||
{
|
{
|
||||||
if ($this->id !== null) {
|
if (null !== $this->id) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
@ -19,4 +21,4 @@ class CreateDirectoryType extends AbstractType
|
|||||||
])
|
])
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
@ -44,7 +46,6 @@ class UserAdminType extends AbstractType
|
|||||||
$builder->add('submit', SubmitType::class, [
|
$builder->add('submit', SubmitType::class, [
|
||||||
'label' => 'Enregistrer',
|
'label' => 'Enregistrer',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver): void
|
public function configureOptions(OptionsResolver $resolver): void
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App;
|
namespace App;
|
||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
|
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Repository;
|
namespace App\Repository;
|
||||||
|
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Security\Authentication;
|
namespace App\Security\Authentication;
|
||||||
|
|
||||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||||
@ -20,4 +22,4 @@ class AuthenticationSuccessHandler implements AuthenticationSuccessHandlerInterf
|
|||||||
$url = $this->urlGenerator->generate('app_home');
|
$url = $this->urlGenerator->generate('app_home');
|
||||||
return new RedirectResponse($url);
|
return new RedirectResponse($url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Twig\Extension;
|
namespace App\Twig\Extension;
|
||||||
|
|
||||||
use App\Twig\Runtime\BasenameExtensionRuntime;
|
use App\Twig\Runtime\BasenameExtensionRuntime;
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Twig\Extension;
|
namespace App\Twig\Extension;
|
||||||
|
|
||||||
use App\Twig\Runtime\SizeExtensionRuntime;
|
use App\Twig\Runtime\SizeExtensionRuntime;
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Twig\Extension;
|
namespace App\Twig\Extension;
|
||||||
|
|
||||||
use App\Twig\Runtime\TimeExtensionRuntime;
|
use App\Twig\Runtime\TimeExtensionRuntime;
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Twig\Runtime;
|
namespace App\Twig\Runtime;
|
||||||
|
|
||||||
use Twig\Extension\RuntimeExtensionInterface;
|
use Twig\Extension\RuntimeExtensionInterface;
|
||||||
|
|
||||||
class BasenameExtensionRuntime implements RuntimeExtensionInterface
|
class BasenameExtensionRuntime implements RuntimeExtensionInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
public function basename($value)
|
public function basename($value)
|
||||||
{
|
{
|
||||||
return \basename($value);
|
return \basename($value);
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Twig\Runtime;
|
namespace App\Twig\Runtime;
|
||||||
|
|
||||||
use Twig\Extension\RuntimeExtensionInterface;
|
use Twig\Extension\RuntimeExtensionInterface;
|
||||||
@ -17,6 +19,6 @@ class SizeExtensionRuntime implements RuntimeExtensionInterface
|
|||||||
$size = ['B', 'KB', 'MB', 'GB','TB'];
|
$size = ['B', 'KB', 'MB', 'GB','TB'];
|
||||||
$factor = floor((strlen($bytes) - 1) / 3);
|
$factor = floor((strlen($bytes) - 1) / 3);
|
||||||
|
|
||||||
return sprintf('%.1f', $bytes / pow(1024, $factor)) . ' ' . @$size[$factor];
|
return sprintf('%.1f', $bytes / 1024 ** $factor) . ' ' . @$size[$factor];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Twig\Runtime;
|
namespace App\Twig\Runtime;
|
||||||
|
|
||||||
use Twig\Extension\RuntimeExtensionInterface;
|
use Twig\Extension\RuntimeExtensionInterface;
|
||||||
|
12
symfony.lock
12
symfony.lock
@ -26,6 +26,18 @@
|
|||||||
"migrations/.gitignore"
|
"migrations/.gitignore"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"friendsofphp/php-cs-fixer": {
|
||||||
|
"version": "3.68",
|
||||||
|
"recipe": {
|
||||||
|
"repo": "github.com/symfony/recipes",
|
||||||
|
"branch": "main",
|
||||||
|
"version": "3.0",
|
||||||
|
"ref": "be2103eb4a20942e28a6dd87736669b757132435"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
".php-cs-fixer.dist.php"
|
||||||
|
]
|
||||||
|
},
|
||||||
"oneup/flysystem-bundle": {
|
"oneup/flysystem-bundle": {
|
||||||
"version": "4.12",
|
"version": "4.12",
|
||||||
"recipe": {
|
"recipe": {
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
use Symfony\Component\Dotenv\Dotenv;
|
use Symfony\Component\Dotenv\Dotenv;
|
||||||
|
|
||||||
require dirname(__DIR__).'/vendor/autoload.php';
|
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||||
|
|
||||||
if (file_exists(dirname(__DIR__).'/config/bootstrap.php')) {
|
if (file_exists(dirname(__DIR__) . '/config/bootstrap.php')) {
|
||||||
require dirname(__DIR__).'/config/bootstrap.php';
|
require dirname(__DIR__) . '/config/bootstrap.php';
|
||||||
} elseif (method_exists(Dotenv::class, 'bootEnv')) {
|
} elseif (method_exists(Dotenv::class, 'bootEnv')) {
|
||||||
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
|
(new Dotenv())->bootEnv(dirname(__DIR__) . '/.env');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user