diff --git a/Command/CheckCommand.php b/Command/CheckCommand.php index d08190ca044d7408967e31e9012bcbb8ee8c9091..74d68246895bfda736a4f4f37b03bf93f58012bf 100644 --- a/Command/CheckCommand.php +++ b/Command/CheckCommand.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Command/CollectGarbageCommand.php b/Command/CollectGarbageCommand.php index 8031485ff584b509ef62da9fb504441e648c5621..c82a8faf651fe39d33288bbdbee7df0cf0934e3d 100644 --- a/Command/CollectGarbageCommand.php +++ b/Command/CollectGarbageCommand.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Command/CreateCommand.php b/Command/CreateCommand.php index 12870c00cab6ca9ae5ce633f057f424e235b9dff..29941f5084d9e1162b979ee33051e7ebaaef6a35 100644 --- a/Command/CreateCommand.php +++ b/Command/CreateCommand.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Command/ReadCommand.php b/Command/ReadCommand.php index aa835ca2b56711146452313723ebe1c0b50c7e35..5fe31c4ecc6fa0d2ebfcae5ad2f1232efaebd188 100644 --- a/Command/ReadCommand.php +++ b/Command/ReadCommand.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Controller/UploadController.php b/Controller/UploadController.php index cb53aa90c97d52e486c47310da7c36f73a22a617..aa090075e476af49ebac2d07152e744af4ed336c 100644 --- a/Controller/UploadController.php +++ b/Controller/UploadController.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. @@ -31,7 +31,7 @@ use Symfony\Component\Templating\EngineInterface; */ class UploadController extends Controller { - const CSRF_INTENTION = 'uploaded_file'; + public const CSRF_INTENTION = 'uploaded_file'; /** * @var FileManagerInterface @@ -89,7 +89,7 @@ class UploadController extends Controller $data['name'], $data['size'], $data['type'], - isset($data['lastModified']) ? $data['lastModified'] : null, + $data['lastModified'] ?? null, null !== $token ? $token->getUsername() : null, $request->getClientIp() ); diff --git a/Controller/UploadedFileController.php b/Controller/UploadedFileController.php index 665500af114ece870396a954b7da294ec158cd90..ab7f04e2558d71fe1cce2df501db1543a5386b84 100644 --- a/Controller/UploadedFileController.php +++ b/Controller/UploadedFileController.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 82810d3bfc87736b5c8643f8d3d48b09bfadcaac..6db2e0a7b36cd42df34ac9a7aff7f8033a8eb4eb 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/DependencyInjection/IrsteaFileUploadExtension.php b/DependencyInjection/IrsteaFileUploadExtension.php index 2fbce6127dd695baffd48b2b57802401cf215b55..76aca9c2c950f81c94662244f014ff6daf3a7955 100644 --- a/DependencyInjection/IrsteaFileUploadExtension.php +++ b/DependencyInjection/IrsteaFileUploadExtension.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Entity/Repository/UploadedFileRepository.php b/Entity/Repository/UploadedFileRepository.php index 4b4f58ceaf0a7124e3bcd6683422dc82e91a9ed7..eb98e6f66093efe68beca0ecc934a25e1bb449da 100644 --- a/Entity/Repository/UploadedFileRepository.php +++ b/Entity/Repository/UploadedFileRepository.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Entity/UploadedFile.php b/Entity/UploadedFile.php index d556bfe0fc00de98aabdc0a0c9434775f8e30639..d40d37c8e1da7ff65310732b0d2421fb3e5f2c81 100644 --- a/Entity/UploadedFile.php +++ b/Entity/UploadedFile.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. @@ -29,7 +29,7 @@ class UploadedFile implements UploadedFileInterface // Taille de bloc utilisé pour les copies public static $copyBlockSize = 8192; - const ORPHAN_PREFIX = 'orphan/'; + public const ORPHAN_PREFIX = 'orphan/'; /** * @ORM\Id diff --git a/Event/FileUploadCompleteEvent.php b/Event/FileUploadCompleteEvent.php index a88860b5f0e5e007f65af0b3335d753b858a7641..5b624c722fb08529b6e61fb91708bcdc73cbb6cb 100644 --- a/Event/FileUploadCompleteEvent.php +++ b/Event/FileUploadCompleteEvent.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Exception/Exception.php b/Exception/Exception.php index 1709a8d1ddbf789c0b0f7d86fa259c3515ea9d1d..29b75e6dd5e2c6b476499a71227ebe2a7f00dad1 100644 --- a/Exception/Exception.php +++ b/Exception/Exception.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Exception/RejectedFileException.php b/Exception/RejectedFileException.php index ff44eacf68387961b3b86290b59ff9a14a18d3bd..7004211720bad79a413e5c19857783d84428b2dc 100644 --- a/Exception/RejectedFileException.php +++ b/Exception/RejectedFileException.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/FileUploadEvents.php b/FileUploadEvents.php index a63f3ade854fbdb317d6fa91d22c2051b9d55fe1..adc1ddf3c507ce0c7e68ac64774f44a2a6c9a85d 100644 --- a/FileUploadEvents.php +++ b/FileUploadEvents.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. @@ -11,5 +11,5 @@ namespace Irstea\FileUploadBundle; */ final class FileUploadEvents { - const UPLOAD_COMPLETE = 'file_upload.complete'; + public const UPLOAD_COMPLETE = 'file_upload.complete'; } diff --git a/Form/DataTranformer/UploadedFileTransformer.php b/Form/DataTranformer/UploadedFileTransformer.php index 26524818f5c1db3e5e638f729dbe6ac3dc20791e..f42be6e57fdac6b3265b24fe13ea8ec799311b8d 100644 --- a/Form/DataTranformer/UploadedFileTransformer.php +++ b/Form/DataTranformer/UploadedFileTransformer.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Form/Type/FileUploadType.php b/Form/Type/FileUploadType.php index 18ea24bf80a3d8aa82b2fa6d1d17a5af94eb8862..e12d32dc638f4456805d1956ea12b48c048c20b2 100644 --- a/Form/Type/FileUploadType.php +++ b/Form/Type/FileUploadType.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Http/UploadedFileResponse.php b/Http/UploadedFileResponse.php index df18db870089ee3e01425831270dd726e7d62d2c..6a4d140eeca03302cd4d578195e89bd38d8b0d63 100644 --- a/Http/UploadedFileResponse.php +++ b/Http/UploadedFileResponse.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/IrsteaFileUploadBundle.php b/IrsteaFileUploadBundle.php index ede2ba02c849651dca7d128f73f7b7cc7521fc03..04e1e1dc4f53175cd686720960a71975028d355e 100644 --- a/IrsteaFileUploadBundle.php +++ b/IrsteaFileUploadBundle.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Listener/CreationDataListener.php b/Listener/CreationDataListener.php index 59bdce935d02c53c80dbcd2721480781f800216a..ae40523d43260efa4880cb241f7dbcacec2f13ae 100644 --- a/Listener/CreationDataListener.php +++ b/Listener/CreationDataListener.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Listener/UploadedFileListener.php b/Listener/UploadedFileListener.php index 0d798bfdac5fcb54b5bba32b5dc19a4658bc4ba4..cce11d12b07c40e5c6ae4d4d7df6406a9f311a6e 100644 --- a/Listener/UploadedFileListener.php +++ b/Listener/UploadedFileListener.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Listener/VirusScannerListener.php b/Listener/VirusScannerListener.php index 1f38ac2237e34b6696e4150e7677c11151eabe22..7c784c82e1c76948c35f079b08633872d3f29548 100644 --- a/Listener/VirusScannerListener.php +++ b/Listener/VirusScannerListener.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Model/FileManagerInterface.php b/Model/FileManagerInterface.php index 690c41572033da648c74102e5e672ba300f83032..dba07e9ce62b406fc0c9c83b469b5dc5f0c1c514 100644 --- a/Model/FileManagerInterface.php +++ b/Model/FileManagerInterface.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Model/UploadedFileInterface.php b/Model/UploadedFileInterface.php index 41e8536cb56a9aae957f75b60750742977f1edfa..c248f7fce11cb84317ce8868bd7c9ef3b9d1d2c5 100644 --- a/Model/UploadedFileInterface.php +++ b/Model/UploadedFileInterface.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. @@ -16,42 +16,42 @@ interface UploadedFileInterface /** Fichier en cours d'upload. * @var string */ - const ETAT_EN_COURS = 'en-cours'; + public const ETAT_EN_COURS = 'en-cours'; /** Fichier orphelin. * Fichier qui n'a pas encore été associé à un objet métier. * * @var string */ - const ETAT_ORPHELIN = 'orphelin'; + public const ETAT_ORPHELIN = 'orphelin'; /** Fichier normal. * Fichier associé à un objet métier. * * @var string */ - const ETAT_NORMAL = 'normal'; + public const ETAT_NORMAL = 'normal'; /** Fichier corrompu. * Fichier dont le contenu disque ne correspond pas à la somme de contrôle enregistreé en base de données. * * @var string */ - const ETAT_CORROMPU = 'corrompu'; + public const ETAT_CORROMPU = 'corrompu'; /** Fichier manquant. * Fichier existant en base de données mais introuvable sur disque. * * @var string */ - const ETAT_MANQUANT = 'manquant'; + public const ETAT_MANQUANT = 'manquant'; /** Fichier rejeté. * Fichier uploadé mais rejeté par un listener (par exemple l'antivirus). * * @var string */ - const ETAT_REJETE = 'rejete'; + public const ETAT_REJETE = 'rejete'; /** Retourne l'identifiant du fichier. * @return string diff --git a/Service/FileUrlGenerator.php b/Service/FileUrlGenerator.php index 6ca79bee94f4b042f98cd9819bad9b0d48d8fdb4..cbf30fdc46f6ba0d295093f8ae77236065de5caa 100644 --- a/Service/FileUrlGenerator.php +++ b/Service/FileUrlGenerator.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Service/FileUrlGeneratorInterface.php b/Service/FileUrlGeneratorInterface.php index bee15eeed725be1b9d38b3d5cc77006278cf919d..b70b9acbaa37e6586804c78f24c6c35b2ef15133 100644 --- a/Service/FileUrlGeneratorInterface.php +++ b/Service/FileUrlGeneratorInterface.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Tests/Entity/UploadedFileTest.php b/Tests/Entity/UploadedFileTest.php index ffc7472d67802f859f3af03be1b3142d76f117a7..b88cf8667bf26183156afaf65a6884b93e2d402d 100644 --- a/Tests/Entity/UploadedFileTest.php +++ b/Tests/Entity/UploadedFileTest.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Tests/Form/DataTranformer/UploadedFileTransformerTest.php b/Tests/Form/DataTranformer/UploadedFileTransformerTest.php index 706646b8bc0cd27f0d3a010ac49185918cc2e2b4..3c4cb679808d334811c76212e9c7e462ad41ef6f 100644 --- a/Tests/Form/DataTranformer/UploadedFileTransformerTest.php +++ b/Tests/Form/DataTranformer/UploadedFileTransformerTest.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Tests/Listener/UploadedFileListenerTest.php b/Tests/Listener/UploadedFileListenerTest.php index 9a68c3612e58a3058da39b461507e41a9014473e..dbf5822d66b9c1f1caa4254ba07a7df13d4a4f42 100644 --- a/Tests/Listener/UploadedFileListenerTest.php +++ b/Tests/Listener/UploadedFileListenerTest.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Tests/Listener/VirusScannerListenerTest.php b/Tests/Listener/VirusScannerListenerTest.php index 86af4fdcbac5d52c2becf9bd96fb63ec1d3b4c80..fc98d766e4cc9aabec357210aa9d203a6881208c 100644 --- a/Tests/Listener/VirusScannerListenerTest.php +++ b/Tests/Listener/VirusScannerListenerTest.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Tests/Utils/MimeTypeIconTest.php b/Tests/Utils/MimeTypeIconTest.php index 1fffeb4217ab5ec9ce4c310e1349371632da3cb2..b299324d08a72d3fc47dc151dec256a6b1b61f85 100644 --- a/Tests/Utils/MimeTypeIconTest.php +++ b/Tests/Utils/MimeTypeIconTest.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Twig/FileUploadExtension.php b/Twig/FileUploadExtension.php index 4429cb02e471a1adba8f09dffe84611abaeac755..428ff0d16d11f086a0b5a39d82c0b376c586ccd8 100644 --- a/Twig/FileUploadExtension.php +++ b/Twig/FileUploadExtension.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Utils/MimeTypeIcon.php b/Utils/MimeTypeIcon.php index 5269518083a8264741b3e50632368c56f8a717bd..57cd4d6dd467b988bc839fca3a9b3318cbad3d9b 100644 --- a/Utils/MimeTypeIcon.php +++ b/Utils/MimeTypeIcon.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Validation/FileMimeType.php b/Validation/FileMimeType.php index f015d0f40361db78d0e01483331c2a91bd05d462..daf09060a339990fa4143963da89a5615f3119cf 100644 --- a/Validation/FileMimeType.php +++ b/Validation/FileMimeType.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Validation/FileMimeTypeValidator.php b/Validation/FileMimeTypeValidator.php index d1c45d6a1fda97f6bd13ff3013e3cb43d351d743..e81b823e43c780d89b257fa8d8739cfbe3dc8458 100644 --- a/Validation/FileMimeTypeValidator.php +++ b/Validation/FileMimeTypeValidator.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Validation/FileSize.php b/Validation/FileSize.php index db5158ab2a68d06896eda2144e63fd1fc7c062c8..9d9f978f983b9bb4b498d9325d20a3675130609a 100644 --- a/Validation/FileSize.php +++ b/Validation/FileSize.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/Validation/FileSizeValidator.php b/Validation/FileSizeValidator.php index 48601f320f092adfc8ed0abbd64de6e28a232bb2..ab523f33cc82080acf05971898e38272176ae844 100644 --- a/Validation/FileSizeValidator.php +++ b/Validation/FileSizeValidator.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * Copyright (C) 2015-2017 IRSTEA * All rights reserved. diff --git a/composer.json b/composer.json index 6a049b5e1ca2a4ea108247a9b1dd3a6f757dda34..86bcfa9603e7fdbd638807a2976b725fbd45d603 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ { "type": "composer", "url": "https://isdevtools.irstea.fr/satis" } ], "require": { - "php": ">=5.4", + "php": ">=7.1", "doctrine/doctrine-bundle": "^1.6", "doctrine/orm": "^2.5", "sensio/framework-extra-bundle": "^3.0.2",