diff --git a/app/config/services.yml b/app/config/services.yml index 70976a15b..fc76142a9 100644 --- a/app/config/services.yml +++ b/app/config/services.yml @@ -149,19 +149,9 @@ services: Afup\Site\Utils\Configuration: autowire: true - Afup\Site\Utils\LegacyConnectionFactory: ~ - Afup\Site\Utils\Base_De_Donnees: - factory: '@Afup\Site\Utils\LegacyConnectionFactory' - - Afup\Site\Forum\Forum: - autowire: true - Afup\Site\Utils\Pays: autowire: true - Afup\Site\Forum\Inscriptions: - autowire: true - AppBundle\Accounting\Invoices\Generator\MemberInvoiceGenerator: ~ AppBundle\Accounting\Invoices\Generator\CompanyMemberInvoiceGenerator: ~ diff --git a/phpstan-baseline.php b/phpstan-baseline.php index 129349858..1f96be658 100644 --- a/phpstan-baseline.php +++ b/phpstan-baseline.php @@ -19,30 +19,12 @@ 'count' => 1, 'path' => __DIR__ . '/sources/Afup/Bootstrap/Http.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Cannot call method batchLoadMetadata\\(\\) on mixed\\.$#', - 'identifier' => 'method.nonObject', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Bootstrap/commonStart.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Cannot call method obtenir\\(\\) on mixed\\.$#', - 'identifier' => 'method.nonObject', - 'count' => 4, - 'path' => __DIR__ . '/sources/Afup/Bootstrap/commonStart.php', -]; $ignoreErrors[] = [ 'message' => '#^Cannot call method register_modifier\\(\\) on mixed\\.$#', 'identifier' => 'method.nonObject', 'count' => 1, 'path' => __DIR__ . '/sources/Afup/Bootstrap/commonStart.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Cannot call method setConfig\\(\\) on mixed\\.$#', - 'identifier' => 'method.nonObject', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Bootstrap/commonStart.php', -]; $ignoreErrors[] = [ 'message' => '#^Parameter \\#1 \\$locale of class Symfony\\\\Component\\\\Translation\\\\Translator constructor expects string, mixed given\\.$#', 'identifier' => 'argument.type', @@ -145,30 +127,6 @@ 'count' => 1, 'path' => __DIR__ . '/sources/Afup/Corporate/Page.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$host of method Afup\\\\Site\\\\Utils\\\\Base_De_Donnees\\:\\:__construct\\(\\) expects string, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Corporate/_Site_Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#2 \\$database of method Afup\\\\Site\\\\Utils\\\\Base_De_Donnees\\:\\:__construct\\(\\) expects string, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Corporate/_Site_Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#3 \\$user of method Afup\\\\Site\\\\Utils\\\\Base_De_Donnees\\:\\:__construct\\(\\) expects string, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Corporate/_Site_Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#4 \\$password of method Afup\\\\Site\\\\Utils\\\\Base_De_Donnees\\:\\:__construct\\(\\) expects string, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Corporate/_Site_Base_De_Donnees.php', -]; $ignoreErrors[] = [ 'message' => '#^Cannot access offset \'elements\' on mixed\\.$#', 'identifier' => 'offsetAccess.nonOffsetAccessible', @@ -200,887 +158,113 @@ 'path' => __DIR__ . '/sources/Afup/Droits.php', ]; $ignoreErrors[] = [ - 'message' => '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#', - 'identifier' => 'foreach.nonIterable', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Binary operation "\\." between \' / \' and mixed results in an error\\.$#', - 'identifier' => 'binaryOp.invalid', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Binary operation "\\." between \' \\ 'binaryOp.invalid', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Binary operation "\\." between \'l\\.id_forum \\= \' and mixed results in an error\\.$#', - 'identifier' => 'binaryOp.invalid', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Binary operation "\\." between mixed and \' \\: \' results in an error\\.$#', - 'identifier' => 'binaryOp.invalid', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Binary operation "\\." between mixed and \'\\-\' results in an error\\.$#', - 'identifier' => 'binaryOp.invalid', - 'count' => 7, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Binary operation "\\." between non\\-falsy\\-string and mixed results in an error\\.$#', + 'message' => '#^Binary operation "/" between mixed and mixed results in an error\\.$#', 'identifier' => 'binaryOp.invalid', - 'count' => 8, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Cannot access offset \'conf1\' on mixed\\.$#', - 'identifier' => 'offsetAccess.nonOffsetAccessible', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Cannot access offset \'conf2\' on mixed\\.$#', - 'identifier' => 'offsetAccess.nonOffsetAccessible', 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Cannot access offset \'debut\' on mixed\\.$#', - 'identifier' => 'offsetAccess.nonOffsetAccessible', - 'count' => 7, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Cannot access offset \'fin\' on mixed\\.$#', - 'identifier' => 'offsetAccess.nonOffsetAccessible', - 'count' => 7, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Cannot access offset \'id_salle\' on mixed\\.$#', - 'identifier' => 'offsetAccess.nonOffsetAccessible', - 'count' => 3, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', + 'path' => __DIR__ . '/sources/Afup/Pagination.php', ]; $ignoreErrors[] = [ - 'message' => '#^Cannot access offset \'jour\' on mixed\\.$#', - 'identifier' => 'offsetAccess.nonOffsetAccessible', + 'message' => '#^Cannot call method assign\\(\\) on mixed\\.$#', + 'identifier' => 'method.nonObject', 'count' => 2, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Cannot access offset \'keynote\' on mixed\\.$#', - 'identifier' => 'offsetAccess.nonOffsetAccessible', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Cannot access offset \'nom\' on mixed\\.$#', - 'identifier' => 'offsetAccess.nonOffsetAccessible', - 'count' => 4, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Cannot access offset \'session_id\' on mixed\\.$#', - 'identifier' => 'offsetAccess.nonOffsetAccessible', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Cannot access offset \'titre\' on mixed\\.$#', - 'identifier' => 'offsetAccess.nonOffsetAccessible', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Cannot access offset int\\<0, max\\> on mixed\\.$#', - 'identifier' => 'offsetAccess.nonOffsetAccessible', - 'count' => 6, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Cannot cast mixed to int\\.$#', - 'identifier' => 'cast.int', - 'count' => 5, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has parameter \\$accomodationEnabled with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has parameter \\$chemin_template with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has parameter \\$date_annonce_planning with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has parameter \\$date_debut with no value type specified in iterable type array\\.$#', - 'identifier' => 'missingType.iterableValue', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has parameter \\$date_fin with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has parameter \\$date_fin_appel_conferencier with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has parameter \\$date_fin_appel_projet with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has parameter \\$date_fin_prevente with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', + 'path' => __DIR__ . '/sources/Afup/Pagination.php', ]; $ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has parameter \\$date_fin_saisie_nuites_hotel with no type specified\\.$#', - 'identifier' => 'missingType.parameter', + 'message' => '#^Cannot call method display\\(\\) on mixed\\.$#', + 'identifier' => 'method.nonObject', 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', + 'path' => __DIR__ . '/sources/Afup/Pagination.php', ]; $ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has parameter \\$date_fin_saisie_repas_speakers with no type specified\\.$#', - 'identifier' => 'missingType.parameter', + 'message' => '#^Cannot call method register_function\\(\\) on mixed\\.$#', + 'identifier' => 'method.nonObject', 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', + 'path' => __DIR__ . '/sources/Afup/Pagination.php', ]; $ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has parameter \\$date_fin_vente with no type specified\\.$#', + 'message' => '#^Method Afup\\\\Site\\\\Pagination\\:\\:__construct\\(\\) has parameter \\$genere_route with no type specified\\.$#', 'identifier' => 'missingType.parameter', 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', + 'path' => __DIR__ . '/sources/Afup/Pagination.php', ]; $ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has parameter \\$date_fin_vente_token_sponsor with no type specified\\.$#', + 'message' => '#^Method Afup\\\\Site\\\\Pagination\\:\\:__construct\\(\\) has parameter \\$nombre_elements_par_page with no type specified\\.$#', 'identifier' => 'missingType.parameter', 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', + 'path' => __DIR__ . '/sources/Afup/Pagination.php', ]; $ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has parameter \\$date_fin_vote with no type specified\\.$#', + 'message' => '#^Method Afup\\\\Site\\\\Pagination\\:\\:__construct\\(\\) has parameter \\$nombre_elements_total with no type specified\\.$#', 'identifier' => 'missingType.parameter', 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', + 'path' => __DIR__ . '/sources/Afup/Pagination.php', ]; $ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has parameter \\$hasPricesDefinedWithVat with no type specified\\.$#', + 'message' => '#^Method Afup\\\\Site\\\\Pagination\\:\\:__construct\\(\\) has parameter \\$page_courante with no type specified\\.$#', 'identifier' => 'missingType.parameter', 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', + 'path' => __DIR__ . '/sources/Afup/Pagination.php', ]; $ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has parameter \\$logoUrl with no type specified\\.$#', - 'identifier' => 'missingType.parameter', + 'message' => '#^Binary operation "\\." between literal\\-string&non\\-falsy\\-string and mixed results in an error\\.$#', + 'identifier' => 'binaryOp.invalid', 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', + 'path' => __DIR__ . '/sources/Afup/Utils/Configuration.php', ]; $ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has parameter \\$nb_places with no type specified\\.$#', - 'identifier' => 'missingType.parameter', + 'message' => '#^Cannot access offset \'database_host\'\\|\'database_name\'\\|\'database_password\'\\|\'database_port\'\\|\'database_user\'\\|\'smtp_host\'\\|\'smtp_password\'\\|\'smtp_port\'\\|\'smtp_tls\'\\|\'smtp_username\' on 0\\|0\\.0\\|\'\'\\|\'0\'\\|array\\{\\}\\|array\\{database_host\\?\\: mixed, database_name\\?\\: mixed, database_password\\?\\: mixed, database_port\\?\\: mixed, database_user\\?\\: mixed, smtp_host\\?\\: mixed, smtp_password\\?\\: string, smtp_port\\?\\: mixed, \\.\\.\\.\\}\\|false\\|null\\.$#', + 'identifier' => 'offsetAccess.nonOffsetAccessible', 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', + 'path' => __DIR__ . '/sources/Afup/Utils/Configuration.php', ]; $ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has parameter \\$placeAddress with no type specified\\.$#', - 'identifier' => 'missingType.parameter', + 'message' => '#^Cannot access offset \'database_host\'\\|\'database_name\'\\|\'database_password\'\\|\'database_port\'\\|\'database_user\'\\|\'smtp_host\'\\|\'smtp_password\'\\|\'smtp_port\'\\|\'smtp_tls\'\\|\'smtp_username\' on 0\\|0\\.0\\|\'\'\\|\'0\'\\|array\\{\\}\\|array\\{database_host\\?\\: mixed, database_name\\?\\: mixed, database_user\\?\\: mixed, database_password\\?\\: mixed, database_port\\?\\: mixed, smtp_host\\?\\: mixed, smtp_port\\?\\: mixed, smtp_tls\\?\\: mixed, \\.\\.\\.\\}\\|false\\|null\\.$#', + 'identifier' => 'offsetAccess.nonOffsetAccessible', 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', + 'path' => __DIR__ . '/sources/Afup/Utils/Configuration.php', ]; $ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has parameter \\$placeName with no type specified\\.$#', - 'identifier' => 'missingType.parameter', + 'message' => '#^Cannot access offset \'parameters\' on mixed\\.$#', + 'identifier' => 'offsetAccess.nonOffsetAccessible', 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', + 'path' => __DIR__ . '/sources/Afup/Utils/Configuration.php', ]; $ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has parameter \\$speakersDinerEnabled with no type specified\\.$#', - 'identifier' => 'missingType.parameter', + 'message' => '#^Cannot access offset mixed on mixed\\.$#', + 'identifier' => 'offsetAccess.nonOffsetAccessible', 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', + 'path' => __DIR__ . '/sources/Afup/Utils/Configuration.php', ]; $ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has parameter \\$text with no value type specified in iterable type array\\.$#', + 'message' => '#^Method Afup\\\\Site\\\\Utils\\\\Configuration\\:\\:loadSymfonyParameters\\(\\) return type has no value type specified in iterable type array\\.$#', 'identifier' => 'missingType.iterableValue', 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has parameter \\$titre with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has parameter \\$transportInformationEnabled with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has parameter \\$voteEnabled with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:ajouter\\(\\) has parameter \\$waitingListUrl with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:genAgenda\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:genAgenda\\(\\) has parameter \\$annee with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:genAgenda\\(\\) has parameter \\$for_bo with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:genAgenda\\(\\) has parameter \\$forum_id with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:genAgenda\\(\\) has parameter \\$linkFormat with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:genAgenda\\(\\) has parameter \\$only_data with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', + 'path' => __DIR__ . '/sources/Afup/Utils/Configuration.php', ]; $ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has no return type specified\\.$#', + 'message' => '#^Method Afup\\\\Site\\\\Utils\\\\Configuration\\:\\:obtenir\\(\\) has no return type specified\\.$#', 'identifier' => 'missingType.return', 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has parameter \\$accomodationEnabled with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has parameter \\$chemin_template with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has parameter \\$date_annonce_planning with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has parameter \\$date_debut with no value type specified in iterable type array\\.$#', - 'identifier' => 'missingType.iterableValue', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has parameter \\$date_fin with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', + 'path' => __DIR__ . '/sources/Afup/Utils/Configuration.php', ]; $ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has parameter \\$date_fin_appel_conferencier with no type specified\\.$#', + 'message' => '#^Method Afup\\\\Site\\\\Utils\\\\Configuration\\:\\:obtenir\\(\\) has parameter \\$cle with no type specified\\.$#', 'identifier' => 'missingType.parameter', 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', + 'path' => __DIR__ . '/sources/Afup/Utils/Configuration.php', ]; $ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has parameter \\$date_fin_appel_projet with no type specified\\.$#', - 'identifier' => 'missingType.parameter', + 'message' => '#^Parameter \\#2 \\.\\.\\.\\$arrays of function array_merge expects array, mixed given\\.$#', + 'identifier' => 'argument.type', 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', + 'path' => __DIR__ . '/sources/Afup/Utils/Configuration.php', ]; $ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has parameter \\$date_fin_prevente with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has parameter \\$date_fin_saisie_nuites_hotel with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has parameter \\$date_fin_saisie_repas_speakers with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has parameter \\$date_fin_vente with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has parameter \\$date_fin_vente_token_sponsor with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has parameter \\$date_fin_vote with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has parameter \\$hasPricesDefinedWithVat with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has parameter \\$logoUrl with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has parameter \\$nb_places with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has parameter \\$placeAddress with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has parameter \\$placeName with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has parameter \\$speakersDinerEnabled with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has parameter \\$text with no value type specified in iterable type array\\.$#', - 'identifier' => 'missingType.iterableValue', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has parameter \\$titre with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has parameter \\$transportInformationEnabled with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has parameter \\$voteEnabled with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:modifier\\(\\) has parameter \\$waitingListUrl with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:obtenir\\(\\) return type has no value type specified in iterable type array\\.$#', - 'identifier' => 'missingType.iterableValue', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:obtenir\\(\\) should return array but returns mixed\\.$#', - 'identifier' => 'return.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:obtenirAgenda\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:obtenirAgenda\\(\\) has parameter \\$forum_id with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:obtenirDernier\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:obtenirForumPrecedent\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:obtenirForumPrecedent\\(\\) has parameter \\$id_forum with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:obtenirListActive\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:obtenirListe\\(\\) has parameter \\$filtre with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:obtenirListe\\(\\) has parameter \\$id_forum with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:obtenirListe\\(\\) return type has no value type specified in iterable type array\\.$#', - 'identifier' => 'missingType.iterableValue', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:obtenirListe\\(\\) should return array but returns array\\|false\\.$#', - 'identifier' => 'return.type', - 'count' => 2, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:supprimer\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:supprimer\\(\\) has parameter \\$id_forum with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$annee of method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:obtenirAgenda\\(\\) expects int\\|null, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$date of method Afup\\\\Site\\\\Utils\\\\Base_De_Donnees\\:\\:echapperSqlDateFromQuickForm\\(\\) expects array, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 20, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 2, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#2 \\$for_bo of method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:lienSeance\\(\\) expects bool, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#2 \\$timestamp of function date expects int\\|null, int\\|false given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#3 \\$linkFormat of method Afup\\\\Site\\\\Forum\\\\Forum\\:\\:lienSeance\\(\\) expects string\\|null, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Part \\$nomSalle \\(mixed\\) of encapsed string cannot be cast to string\\.$#', - 'identifier' => 'encapsedStringPart.nonString', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Possibly invalid array key type mixed\\.$#', - 'identifier' => 'offsetAccess.invalidOffset', - 'count' => 15, - 'path' => __DIR__ . '/sources/Afup/Forum/Forum.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Binary operation "/" between mixed and mixed results in an error\\.$#', - 'identifier' => 'binaryOp.invalid', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Pagination.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Cannot call method assign\\(\\) on mixed\\.$#', - 'identifier' => 'method.nonObject', - 'count' => 2, - 'path' => __DIR__ . '/sources/Afup/Pagination.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Cannot call method display\\(\\) on mixed\\.$#', - 'identifier' => 'method.nonObject', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Pagination.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Cannot call method register_function\\(\\) on mixed\\.$#', - 'identifier' => 'method.nonObject', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Pagination.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Pagination\\:\\:__construct\\(\\) has parameter \\$genere_route with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Pagination.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Pagination\\:\\:__construct\\(\\) has parameter \\$nombre_elements_par_page with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Pagination.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Pagination\\:\\:__construct\\(\\) has parameter \\$nombre_elements_total with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Pagination.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Pagination\\:\\:__construct\\(\\) has parameter \\$page_courante with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Pagination.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Binary operation "\\." between \' \' and mixed results in an error\\.$#', - 'identifier' => 'binaryOp.invalid', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Binary operation "\\." between \'\\:\' and mixed results in an error\\.$#', - 'identifier' => 'binaryOp.invalid', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Binary operation "\\." between mixed and \'\\-\' results in an error\\.$#', - 'identifier' => 'binaryOp.invalid', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Binary operation "\\." between non\\-falsy\\-string and mixed results in an error\\.$#', - 'identifier' => 'binaryOp.invalid', - 'count' => 3, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Cannot access offset 0 on mixed\\.$#', - 'identifier' => 'offsetAccess.nonOffsetAccessible', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Cannot cast mixed to int\\.$#', - 'identifier' => 'cast.int', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Cannot cast mixed to string\\.$#', - 'identifier' => 'cast.string', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Utils\\\\Base_De_Donnees\\:\\:__construct\\(\\) has parameter \\$port with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Utils\\\\Base_De_Donnees\\:\\:echapperSqlDateFromQuickForm\\(\\) has parameter \\$date with no value type specified in iterable type array\\.$#', - 'identifier' => 'missingType.iterableValue', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Utils\\\\Base_De_Donnees\\:\\:echapperSqlDateFromQuickForm\\(\\) should return int\\|string but returns int\\|false\\.$#', - 'identifier' => 'return.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Utils\\\\Base_De_Donnees\\:\\:executer\\(\\) should return bool but returns mysqli_result\\|true\\.$#', - 'identifier' => 'return.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Utils\\\\Base_De_Donnees\\:\\:getDbLink\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Utils\\\\Base_De_Donnees\\:\\:obtenirAssociatif\\(\\) return type has no value type specified in iterable type array\\.$#', - 'identifier' => 'missingType.iterableValue', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Utils\\\\Base_De_Donnees\\:\\:obtenirDernierId\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Utils\\\\Base_De_Donnees\\:\\:obtenirTous\\(\\) return type has no value type specified in iterable type array\\.$#', - 'identifier' => 'missingType.iterableValue', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$hostname of function mysqli_connect expects string\\|null, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$mysql of function mysqli_error expects mysqli, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 2, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$mysql of function mysqli_insert_id expects mysqli, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$mysql of function mysqli_query expects mysqli, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 5, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$mysql of function mysqli_real_escape_string expects mysqli, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$mysql of function mysqli_select_db expects mysqli, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$nom of method Afup\\\\Site\\\\Utils\\\\Base_De_Donnees\\:\\:selectionnerBase\\(\\) expects string, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$result of function mysqli_fetch_array expects mysqli_result, mysqli_result\\|true given\\.$#', - 'identifier' => 'argument.type', - 'count' => 5, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$result of function mysqli_fetch_fields expects mysqli_result, mysqli_result\\|true given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$result of function mysqli_free_result expects mysqli_result, mysqli_result\\|true given\\.$#', - 'identifier' => 'argument.type', - 'count' => 4, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$result of function mysqli_num_fields expects mysqli_result, bool\\|mysqli_result given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#2 \\$username of function mysqli_connect expects string\\|null, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#3 \\$password of function mysqli_connect expects string\\|null, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Possibly invalid array key type mixed\\.$#', - 'identifier' => 'offsetAccess.invalidOffset', - 'count' => 2, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Property Afup\\\\Site\\\\Utils\\\\Base_De_Donnees\\:\\:\\$config type has no value type specified in iterable type array\\.$#', - 'identifier' => 'missingType.iterableValue', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Property Afup\\\\Site\\\\Utils\\\\Base_De_Donnees\\:\\:\\$link \\(mysqli\\) does not accept mysqli\\|false\\.$#', - 'identifier' => 'assign.propertyType', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Base_De_Donnees.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Binary operation "\\." between literal\\-string&non\\-falsy\\-string and mixed results in an error\\.$#', - 'identifier' => 'binaryOp.invalid', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Configuration.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Cannot access offset \'database_host\'\\|\'database_name\'\\|\'database_password\'\\|\'database_port\'\\|\'database_user\'\\|\'smtp_host\'\\|\'smtp_password\'\\|\'smtp_port\'\\|\'smtp_tls\'\\|\'smtp_username\' on 0\\|0\\.0\\|\'\'\\|\'0\'\\|array\\{\\}\\|array\\{database_host\\?\\: mixed, database_name\\?\\: mixed, database_password\\?\\: mixed, database_port\\?\\: mixed, database_user\\?\\: mixed, smtp_host\\?\\: mixed, smtp_password\\?\\: string, smtp_port\\?\\: mixed, \\.\\.\\.\\}\\|false\\|null\\.$#', - 'identifier' => 'offsetAccess.nonOffsetAccessible', + 'message' => '#^Property Afup\\\\Site\\\\Utils\\\\Configuration\\:\\:\\$values has no type specified\\.$#', + 'identifier' => 'missingType.property', 'count' => 1, 'path' => __DIR__ . '/sources/Afup/Utils/Configuration.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Cannot access offset \'database_host\'\\|\'database_name\'\\|\'database_password\'\\|\'database_port\'\\|\'database_user\'\\|\'smtp_host\'\\|\'smtp_password\'\\|\'smtp_port\'\\|\'smtp_tls\'\\|\'smtp_username\' on 0\\|0\\.0\\|\'\'\\|\'0\'\\|array\\{\\}\\|array\\{database_host\\?\\: mixed, database_name\\?\\: mixed, database_user\\?\\: mixed, database_password\\?\\: mixed, database_port\\?\\: mixed, smtp_host\\?\\: mixed, smtp_port\\?\\: mixed, smtp_tls\\?\\: mixed, \\.\\.\\.\\}\\|false\\|null\\.$#', - 'identifier' => 'offsetAccess.nonOffsetAccessible', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Configuration.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Cannot access offset \'parameters\' on mixed\\.$#', - 'identifier' => 'offsetAccess.nonOffsetAccessible', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Configuration.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Cannot access offset mixed on mixed\\.$#', - 'identifier' => 'offsetAccess.nonOffsetAccessible', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Configuration.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Utils\\\\Configuration\\:\\:loadSymfonyParameters\\(\\) return type has no value type specified in iterable type array\\.$#', - 'identifier' => 'missingType.iterableValue', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Configuration.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Utils\\\\Configuration\\:\\:obtenir\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Configuration.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Utils\\\\Configuration\\:\\:obtenir\\(\\) has parameter \\$cle with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Configuration.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#2 \\.\\.\\.\\$arrays of function array_merge expects array, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Configuration.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Property Afup\\\\Site\\\\Utils\\\\Configuration\\:\\:\\$values has no type specified\\.$#', - 'identifier' => 'missingType.property', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/Configuration.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Property Afup\\\\Site\\\\Utils\\\\LegacyConnectionFactory\\:\\:\\$bdd \\(Afup\\\\Site\\\\Utils\\\\Base_De_Donnees\\) does not accept mixed\\.$#', - 'identifier' => 'assign.propertyType', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/LegacyConnectionFactory.php', -]; $ignoreErrors[] = [ 'message' => '#^Binary operation "\\." between mixed and \' \' results in an error\\.$#', 'identifier' => 'binaryOp.invalid', diff --git a/sources/Afup/Bootstrap/_Common.php b/sources/Afup/Bootstrap/_Common.php index 3a00b18d0..bac1fba4c 100644 --- a/sources/Afup/Bootstrap/_Common.php +++ b/sources/Afup/Bootstrap/_Common.php @@ -19,10 +19,6 @@ * @group Bootstraps */ -// racine de l'application (pas du document root !) -use Afup\Site\Corporate\_Site_Base_De_Donnees; -use Afup\Site\Utils\Configuration; - $root = dirname(__DIR__, 3); require_once $root . '/vendor/autoload.php'; @@ -35,15 +31,3 @@ // préparation de la requête / session require_once __DIR__ . '/../fonctions.php'; - -// chargement de la configuration -$conf = new Configuration(); - -// mets la configuration dans une 'clé de registre' accessible à tout moment -$GLOBALS['AFUP_CONF'] = $conf; - -// initialisation de la couche d'abstraction de la base de données -$bdd = new _Site_Base_De_Donnees(); - -// mets la connexion db dans une 'clé de registre' accessible à tout moment -$GLOBALS['AFUP_DB'] = $bdd; diff --git a/sources/Afup/Bootstrap/commonStart.php b/sources/Afup/Bootstrap/commonStart.php index 8cc76624c..028c4d12e 100644 --- a/sources/Afup/Bootstrap/commonStart.php +++ b/sources/Afup/Bootstrap/commonStart.php @@ -2,8 +2,6 @@ declare(strict_types=1); -use CCMBenchmark\Ting\Services; -use Symfony\Component\Security\Csrf\CsrfTokenManager; use Symfony\Component\Translation\Loader\XliffFileLoader; use Symfony\Component\Translation\Translator; @@ -30,27 +28,3 @@ if (isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] === 'afup.dev') { $debug = true; } - -// Initialisation de ting -$services = new Services(); -$services->get('ConnectionPool')->setConfig([ - 'main' => [ - 'namespace' => '\CCMBenchmark\Ting\Driver\Mysqli', - 'master' => [ - 'host' => $GLOBALS['AFUP_CONF']->obtenir('database_host'), - 'user' => $GLOBALS['AFUP_CONF']->obtenir('database_user'), - 'password' => $GLOBALS['AFUP_CONF']->obtenir('database_password'), - 'port' => 3306, - ], - ], -]); - -$services - ->get('MetadataRepository') - ->batchLoadMetadata( - 'AppBundle\Event\Model\Repository', - __DIR__ . '/../Event/Model/Repository/*.php', - ['default' => ['database' => $GLOBALS['AFUP_CONF']->obtenir('database_name')]], - ) -; -$services->set('security.csrf.token_manager', fn(): CsrfTokenManager => new CsrfTokenManager()); diff --git a/sources/Afup/Corporate/_Site_Base_De_Donnees.php b/sources/Afup/Corporate/_Site_Base_De_Donnees.php deleted file mode 100644 index 6a4da1b57..000000000 --- a/sources/Afup/Corporate/_Site_Base_De_Donnees.php +++ /dev/null @@ -1,25 +0,0 @@ -obtenir('database_host'), - $conf->obtenir('database_name'), - $conf->obtenir('database_user'), - $conf->obtenir('database_password'), - $conf->obtenir('database_port'), - ); - } -} diff --git a/sources/Afup/Forum/Forum.php b/sources/Afup/Forum/Forum.php deleted file mode 100644 index 14d2d34e6..000000000 --- a/sources/Afup/Forum/Forum.php +++ /dev/null @@ -1,460 +0,0 @@ -_bdd->obtenirEnregistrement($requete); - } - - public function obtenirForumPrecedent($id_forum) - { - $requete = 'SELECT MAX(id)'; - $requete .= 'FROM'; - $requete .= ' afup_forum '; - $requete .= 'WHERE'; - $requete .= ' id < ' . (int) $id_forum . ' AND titre like "%Forum%"'; - return $this->_bdd->obtenirUn($requete); - } - - public function obtenirDernier() - { - $requete = 'SELECT id '; - $requete .= 'FROM afup_forum '; - $requete .= 'ORDER BY date_debut desc'; - return $this->_bdd->obtenirUn($requete); - } - - /** - * Renvoit la liste des inscriptions à facturer ou facturé au forum - * - * @param string $champs Champs à renvoyer - * @param string $ordre Tri des enregistrements - * @param bool $associatif Renvoyer un tableau associatif ? - * @return array - */ - public function obtenirListe($id_forum = null, - string $champs = '*', - string $ordre = 'titre', - $associatif = false, - $filtre = false) - { - $requete = 'SELECT'; - $requete .= ' ' . $champs . ' '; - $requete .= 'FROM'; - $requete .= ' afup_forum '; - $requete .= 'ORDER BY ' . $ordre; - if ($associatif) { - return $this->_bdd->obtenirAssociatif($requete); - } else { - return $this->_bdd->obtenirTous($requete); - } - } - - public function obtenirListActive() - { - return $this->_bdd->obtenirTous('SELECT * FROM afup_forum WHERE archived_at IS NULL ORDER BY titre'); - } - - /** - * Récupérer l'agenda du forum. - * - * Pour une année donnée pass�e en paramètre, retourne - * les informations nécessaires à la construction du tableau - * de l'agenda du forum AFUP correspondant. - * - * @param Int $annee (Optionnel, retournera tout si aucunne année indiquée) - */ - public function obtenirAgenda($annee = null, $forum_id = null) - { - $aWhere = []; - if (isset($annee)) { - $tdebut = mktime(0, 0, 0, 1, 1, (int) $annee); - $tfin = mktime(0, 0, 0, 1, 1, (int) ($annee + 1)); - $aWhere[] = "p.debut >= " . $tdebut; - $aWhere[] = "p.fin < " . $tfin; - $aWhere[] = "s.plannifie = 1"; - } - - if (null !== $forum_id) { - $aWhere[] = "l.id_forum = " . $forum_id; - } - - $sWhere = "WHERE " . implode(" AND ", $aWhere); - $requete = "SELECT " - . " ( SELECT CONCAT(c.nom,' ', c.prenom , ' - ', c.societe ) FROM afup_conferenciers_sessions cs INNER JOIN afup_conferenciers c ON c.conferencier_id = cs.conferencier_id WHERE cs.session_id = s.session_id order by c.conferencier_id asc limit 1) as conf1 , - ( SELECT CONCAT(c.nom,' ', c.prenom, ' - ', c.societe) FROM afup_conferenciers_sessions cs INNER JOIN afup_conferenciers c ON c.conferencier_id = cs.conferencier_id WHERE cs.session_id = s.session_id order by c.conferencier_id asc limit 1,1) as conf2 , " - - . " s.session_id, s.titre, s.journee, " - . " FROM_UNIXTIME(p.debut, '%d-%m-%Y') AS 'jour', " - . " FROM_UNIXTIME(p.debut, '%H:%i') AS 'debut', " - . " FROM_UNIXTIME(p.fin, '%H:%i') AS 'fin', " - . " p.id_salle, " - . " p.keynote, " - . " l.nom " - . "FROM afup_sessions s " - . " JOIN afup_forum_planning p ON s.session_id = p.id_session " - . " JOIN afup_forum_salle l ON p.id_salle = l.id " - . $sWhere . " " - . "ORDER BY p.debut ASC, p.id_salle ASC"; - return $this->_bdd->obtenirTous($requete); - } - - /** - * Compte en nombre de demi-heures. - * - * Sur la base des horaires d'une scéance au format «HH:mm - HH:mm» - * calcule la durée en nombre de demi-heures. - * Servira à calculer combien de lignes d'affichage occupera une - * scéance. - * - * @param String $heures - * @return Int - */ - public function dureeSeance($heures) - { - $aHeures = explode("-", $heures); - $aDebut = explode(":", $aHeures[0]); - $aFin = explode(":", $aHeures[1]); - $iDebut = ((int) $aDebut[0] * 60) + (int) $aDebut[1]; - $iFin = ((int) $aFin[0] * 60) + (int) $aFin[1]; - return ($iFin - $iDebut) / 5; - } - - /** - * Construction des liens vers les fiches détaillées des conférences. - * - * @param String $infoSeance - * @param Boolean $for_bo - * @param ?string $linkFormat if $for_bo = false, this format will be used (if not null) to construct the link. - * i.e : "/sessions.php#%1" . %1 is the session id - * @return String - */ - public function lienSeance($infoSeance, $for_bo, $linkFormat): ?string - { - $masque = "#^(\\d+) ?: ?(.*)#"; - //$masque = "#^([0-9]+) ?| ?(.*) ?| ?(.*)#"; - - - $lien = '#$1'; - if ($for_bo === false) { - $lien = $linkFormat !== null ? sprintf($linkFormat, '$1') : './sessions.php#$1'; - } - return preg_replace($masque, '

$2

', $infoSeance); - } - - public function genAgenda($annee, $for_bo = false, $only_data = false, $forum_id = null, $linkFormat = null) - { - $aProgrammeData = []; - $aAgenda = $this->obtenirAgenda($annee, $forum_id); - if (isset($aAgenda) && count($aAgenda) > 0) { - $nbConf = count($aAgenda); - $nomSalles = []; - $j = 0; - $d = null; - $aProgramme = []; - foreach ($aAgenda as $session) { - if (!isset($nomSalles[$session['id_salle']])) { - $nomSalles[$session['id_salle']] = $session['nom']; - } - $dj = $session['jour']; - if ($dj != $d) { - $j++; - $d = $dj; - $aProgramme[$dj] = []; - } - if (!isset($aProgramme[$dj][$session['debut'] . "-" . $session['fin']])) { - $aProgramme[$dj][$session['debut'] . "-" . $session['fin']] = []; - } - if (!isset($aProgramme[$dj][$session['debut'] . "-" . $session['fin']][$session['nom']])) { - $aProgramme[$dj][$session['debut'] . "-" . $session['fin']][$session['nom']] = []; - } - $aProgrammeData[$dj][$session['debut'] . "-" . $session['fin']][] = $session; - $aProgramme[$dj][$session['debut'] . "-" . $session['fin']][$session['nom']][] = $session['session_id'] . " : " . $session['titre'] . (' ' . $session['conf1'] . ($session['conf2'] ? (' / ' . $session['conf2']) : '') . ''); - //$aProgramme[$dj][$session['debut'] ."-". $session['fin']][$session['nom']][] = array('id'=>$session['session_id'], 'titre'=> $session['titre'],'conf1'=> $session['titre'],'titre'=> $session['titre']); - } - //var_dump($aProgrammeData['12-11-2009']);die; - if ($only_data) { - return $aProgrammeData; - } - $nbSalles = count($nomSalles); - $tdWith = round(84 / $nbSalles); - - // - $sTable = ''; - $j = 1; - $aRowSpan = []; - - /* On boucle sur chaque journée du programme. */ - foreach ($aProgramme as $journee => $aInfos) { - $journee_aff = date('d/m/Y', strtotime((string) $journee)); - $sTable .= << -

Jour {$j} : {$journee_aff}

-
- - - - - -CODE_HTML; - $s = 1; - $confNumber = 0; - foreach ($nomSalles as $idSalle => $nomSalle) { - $sTable .= <<{$nomSalle} - -CODE_HTML; - $aRowSpan[$idSalle] = 0; - $s++; - } - $sTable .= << - - - -CODE_HTML; - /* On boucle maintenant sur chaque demi-heure de l'agenda (de 08h00 à 18h00 */ - for ($h = 8; $h < 19; $h++) { - for ($i = 0; $i < 12; $i++) { - $bKeynote = false; - $m = sprintf('%02d', 5 * $i); - $m_next = sprintf('%02d', (5 * ($i + 1)) % 60); - $style = ($i % 2 == 0) ? 'lp' : 'li'; - $sHeure = ($h < 10) ? '0' . $h : $h; - $h_next = ($i < 11) ? $h : $h + 1; - $sHeure_next = ($h_next < 10) ? '0' . $h_next : $h_next; - /* Création de la ligne avec la cellule indiquant l'heure */ - $sTable .= << - - -CODE_HTML; - - /* On cherche les scéances commençant à cette heure pour chaque salle. */ - foreach ($nomSalles as $idSalle => $nomSalle) { - /* On vérifie qu'on est pas déjà sur une scéance commencée à un tour précédent. */ - if ($aRowSpan[$idSalle] <= 1): - $bSeance = false; - $rs = null; - /* Calcul du nombre de lignes occupées par la scéance s'il y en a une. */ - for ($c = 0; $c < $nbConf; $c++): - //var_dump($aAgenda[$c]); - if ( - $aAgenda[$c]['debut'] == $sHeure . ":" . $m - && $aAgenda[$c]['id_salle'] == $idSalle - && $aAgenda[$c]['jour'] == $journee - ): - /* Si on toruve une scéance, on ne mettra pas de cellule vide. */ - $bSeance = true; - - $bKeynote = $aAgenda[$c]['keynote']; - $colspan = $bKeynote ? ' colspan="' . $nbSalles . '" class="keynote" ' : ''; - $heures = $aAgenda[$c]['debut'] . "-" . $aAgenda[$c]['fin']; - $nl = $this->dureeSeance($heures); - $aRowSpan[$idSalle] = $nl; - - $class = 'conf conf_' . ($confNumber % 2 === 0 ? 'odd' : 'even'); - - $rs = ($nl > 1) ? ' rowspan="' . $nl . '"' : null; - $nbSeances = (isset($aInfos[$heures][$nomSalle])) ? count($aInfos[$heures][$nomSalle]) : 0; - if ($nbSeances > 0): - $conflit = $nbSeances > 1 ? ' style="color: inherit; background-color: #f99"' : null; - $sTable .= << - -CODE_HTML; - for ($sc = 0; $sc < $nbSeances; $sc++): - - $lien = $this->lienSeance($aInfos[$heures][$nomSalle][$sc], $for_bo, $linkFormat); - //$lien = '

$2

'; - $sTable .= $lien; - endfor; - $sTable .= ""; - $confNumber++; - endif; - break; - endif; - endfor; - if (in_array($sHeure . '_' . $m . '_' . $journee, ['17_00_12-11-2009', '10_30_12-11-2009'])) { - $bKeynote = true; - } - if (false === $bSeance && !$bKeynote): - $sTable .= "
"; - endif; - else: - $aRowSpan[$idSalle]--; - endif; - } - $sTable .= " "; - } - } - $sTable .= << -
 
{$sHeure}h{$m} - {$sHeure_next}h{$m_next}  

- -CODE_HTML; - $j++; - } - } else { - // Aucune donnée dans la base. Affichage alternatif. - $sTable = <<Aucune entrée disponible. - -CODE_HTML; - } - return $sTable; - } - - public function ajouter( - $titre, - $nb_places, - array $date_debut, - $date_fin, - $date_fin_appel_projet, - $date_fin_appel_conferencier, - $date_fin_vote, - $date_fin_prevente, - $date_fin_vente, - $date_fin_vente_token_sponsor, - $date_fin_saisie_repas_speakers, - $date_fin_saisie_nuites_hotel, - $date_annonce_planning, - $chemin_template, - array $text, - $logoUrl, - $placeName, - $placeAddress, - $voteEnabled = true, - $speakersDinerEnabled = true, - $accomodationEnabled = true, - $waitingListUrl = null, - $hasPricesDefinedWithVat = false, - $transportInformationEnabled = false, - ) { - $requete = 'INSERT INTO '; - $requete .= ' afup_forum (id, titre, nb_places, date_debut, date_fin, annee, date_fin_appel_projet,'; - $requete .= ' date_fin_appel_conferencier, date_fin_vote, date_fin_prevente, date_fin_vente, date_fin_vente_token_sponsor, date_fin_saisie_repas_speakers, date_fin_saisie_nuites_hotel, date_annonce_planning, path, `text`, - `logo_url`, `place_name`, `has_prices_defined_with_vat`, `vote_enabled`, `speakers_diner_enabled`, `accomodation_enabled`, `waiting_list_url`, `place_address`, `transport_information_enabled`) '; - $requete .= 'VALUES (null,'; - $requete .= $this->_bdd->echapper($titre) . ','; - $requete .= (int) $nb_places . ','; - $requete .= $this->_bdd->echapperSqlDateFromQuickForm($date_debut) . ','; - $requete .= $this->_bdd->echapperSqlDateFromQuickForm($date_fin) . ','; - $requete .= (int) $date_debut['Y'] . ','; - $requete .= $this->_bdd->echapperSqlDateFromQuickForm($date_fin_appel_projet, true) . ','; - $requete .= $this->_bdd->echapperSqlDateFromQuickForm($date_fin_appel_conferencier, true) . ','; - $requete .= $this->_bdd->echapperSqlDateFromQuickForm($date_fin_vote, false) . ','; - $requete .= $this->_bdd->echapperSqlDateFromQuickForm($date_fin_prevente, true) . ','; - $requete .= $this->_bdd->echapperSqlDateFromQuickForm($date_fin_vente, true) . ','; - $requete .= $this->_bdd->echapperSqlDateFromQuickForm($date_fin_vente_token_sponsor, true) . ','; - $requete .= $this->_bdd->echapperSqlDateFromQuickForm($date_fin_saisie_repas_speakers, true) . ','; - $requete .= $this->_bdd->echapperSqlDateFromQuickForm($date_fin_saisie_nuites_hotel, true) . ','; - $requete .= $this->_bdd->echapperSqlDateFromQuickForm($date_annonce_planning, true) . ','; - $requete .= $this->_bdd->echapper($chemin_template) . ','; - $requete .= $this->_bdd->echapper(json_encode($text)) . ', '; - $requete .= $this->_bdd->echapper($logoUrl) . ','; - $requete .= $this->_bdd->echapper($placeName) . ','; - $requete .= $this->_bdd->echapper($hasPricesDefinedWithVat ? 1 : 0) . ','; - $requete .= $this->_bdd->echapper($voteEnabled ? 1 : 0) . ','; - $requete .= $this->_bdd->echapper($speakersDinerEnabled ? 1 : 0) . ','; - $requete .= $this->_bdd->echapper($accomodationEnabled ? 1 : 0) . ','; - $requete .= $this->_bdd->echapper($waitingListUrl) . ','; - $requete .= $this->_bdd->echapper($placeAddress) . ','; - $requete .= $this->_bdd->echapper($transportInformationEnabled ? 1 : 0); - - $requete .= ')'; - - return $this->_bdd->executer($requete); - } - - public function modifier( - string $id, - $titre, - $nb_places, - array $date_debut, - $date_fin, - $date_fin_appel_projet, - $date_fin_appel_conferencier, - $date_fin_vote, - $date_fin_prevente, - $date_fin_vente, - $date_fin_vente_token_sponsor, - $date_fin_saisie_repas_speakers, - $date_fin_saisie_nuites_hotel, - $date_annonce_planning, - $chemin_template, - array $text, - $logoUrl = null, - $placeName = null, - $placeAddress = null, - $voteEnabled = true, - $speakersDinerEnabled = true, - $accomodationEnabled = true, - $waitingListUrl = null, - $hasPricesDefinedWithVat = false, - $transportInformationEnabled = false, - ) { - $requete = 'UPDATE '; - $requete .= ' afup_forum '; - $requete .= 'SET'; - $requete .= ' titre=' . $this->_bdd->echapper($titre) . ','; - $requete .= ' nb_places=' . (int) $nb_places . ','; - $requete .= ' date_debut=' . $this->_bdd->echapperSqlDateFromQuickForm($date_debut) . ','; - $requete .= ' date_fin=' . $this->_bdd->echapperSqlDateFromQuickForm($date_fin) . ','; - $requete .= ' annee=' . (int) $date_debut['Y'] . ','; - $requete .= ' date_fin_appel_projet=' . $this->_bdd->echapperSqlDateFromQuickForm($date_fin_appel_projet, true) . ','; - $requete .= ' date_fin_appel_conferencier=' . $this->_bdd->echapperSqlDateFromQuickForm($date_fin_appel_conferencier, true) . ','; - $requete .= ' date_fin_vote=' . $this->_bdd->echapperSqlDateFromQuickForm($date_fin_vote, false) . ','; - $requete .= ' date_fin_prevente=' . $this->_bdd->echapperSqlDateFromQuickForm($date_fin_prevente, true) . ','; - $requete .= ' date_fin_vente=' . $this->_bdd->echapperSqlDateFromQuickForm($date_fin_vente, true) . ','; - $requete .= ' date_fin_vente_token_sponsor=' . $this->_bdd->echapperSqlDateFromQuickForm($date_fin_vente_token_sponsor, true) . ','; - $requete .= ' date_fin_saisie_repas_speakers=' . $this->_bdd->echapperSqlDateFromQuickForm($date_fin_saisie_repas_speakers, true) . ','; - $requete .= ' date_fin_saisie_nuites_hotel=' . $this->_bdd->echapperSqlDateFromQuickForm($date_fin_saisie_nuites_hotel, true) . ','; - $requete .= ' date_annonce_planning=' . $this->_bdd->echapperSqlDateFromQuickForm($date_annonce_planning, true) . ','; - $requete .= ' path=' . $this->_bdd->echapper($chemin_template) . ', '; - $requete .= ' `text` = ' . $this->_bdd->echapper(json_encode($text)) . ', '; - $requete .= ' `logo_url` = ' . $this->_bdd->echapper($logoUrl) . ', '; - $requete .= ' `place_name` = ' . $this->_bdd->echapper($placeName) . ', '; - $requete .= ' `vote_enabled` = ' . $this->_bdd->echapper($voteEnabled ? 1 : 0) . ', '; - $requete .= ' `has_prices_defined_with_vat` = ' . $this->_bdd->echapper($hasPricesDefinedWithVat ? 1 : 0) . ', '; - $requete .= ' `speakers_diner_enabled` = ' . $this->_bdd->echapper($speakersDinerEnabled ? 1 : 0) . ', '; - $requete .= ' `accomodation_enabled` = ' . $this->_bdd->echapper($accomodationEnabled ? 1 : 0) . ', '; - $requete .= ' `waiting_list_url` = ' . $this->_bdd->echapper($waitingListUrl) . ','; - $requete .= ' `place_address` = ' . $this->_bdd->echapper($placeAddress) . ', '; - $requete .= ' `transport_information_enabled` = ' . $this->_bdd->echapper($transportInformationEnabled ? 1 : 0) . ' '; - $requete .= 'WHERE'; - $requete .= ' id=' . $id; - - return $this->_bdd->executer($requete); - } - - public function supprimer($id_forum) - { - $id_forum = $this->_bdd->echapper($id_forum); - - $requete = 'DELETE FROM afup_forum WHERE id = ' . $id_forum; - - return $this->_bdd->executer($requete); - } -} diff --git a/sources/Afup/Utils/Base_De_Donnees.php b/sources/Afup/Utils/Base_De_Donnees.php deleted file mode 100644 index 3847fe03a..000000000 --- a/sources/Afup/Utils/Base_De_Donnees.php +++ /dev/null @@ -1,252 +0,0 @@ -config = [ - 'host' => $host, - 'database' => $database, - 'user' => $user, - 'password' => $password, - 'port' => $port, - ]; - } - - public function getDbLink() - { - if ($this->link === null) { - $this->link = mysqli_connect($this->config['host'], $this->config['user'], $this->config['password'], null, (int) $this->config['port']) or die('Connexion à la base de données impossible'); - mysqli_set_charset($this->link, "utf8mb4"); - $this->selectionnerBase($this->config['database']); - } - return $this->link; - } - - /** - * Sélectionne la base de données indiquée - * - * @param string $nom Nom de la base - */ - public function selectionnerBase($nom): bool - { - return mysqli_select_db($this->getDbLink(), $nom); - } - - /** - * Prépare une valeur qui va être incorporée dans une requête SQL - * - * @param mixed $valeur Valeur à traiter - * @return string La valeur traitée - */ - public function echapper($valeur): string - { - if (is_string($valeur)) { - $valeur = "'" . mysqli_real_escape_string($this->getDbLink(), $valeur) . "'"; - } elseif (is_null($valeur)) { - $valeur = 'NULL'; - } - return (string) $valeur; - } - - /** - * - * @param array $date - * @param boolean $timestamp - * @return int|string - */ - public function echapperSqlDateFromQuickForm($date, $timestamp = false) - { - $dateChaine = $date['Y'] . '-' . $date['M'] . '-' . $date['d']; - if (isset($date['H']) && isset($date['i'])) { - $dateChaine .= ' ' . $date['H'] . ':' . $date['i']; - if (isset($date['s'])) { - $dateChaine .= ':' . $date['s']; - } - } - if ($timestamp) { - return strtotime($dateChaine); - } else { - return $this->echapper($dateChaine); - } - } - - /** - * Retrieve the last error message - * @return string - */ - public function getLastErrorMessage(): ?string - { - return mysqli_error($this->getDbLink()); - } - - /** - * Exécute une requête SQL - * - * @param string $requete Requête à exécuter - * @return bool - */ - public function executer($requete) - { - $result = mysqli_query($this->getDbLink(), $requete); - if (!$result) { - throw new \RuntimeException(mysqli_error($this->getDbLink())); - } - - return $result; - } - - /** - * Exécute une requête SQL et retourne le premier champ du premier enregistrement - * - * @param string $requete Requête à exécuter - * @return mixed Le premier champ du premier enregistrement ou false si la requête échoue - */ - public function obtenirUn($requete) - { - $enregistrement = $this->obtenirEnregistrement($requete, MYSQLI_NUM); - if ($enregistrement === false) { - return false; - } else { - return $enregistrement[0]; - } - } - - /** - * Exécute une requête SQL et retourne le premier enregistrement correspondant - * - * @param string $requete Requête à exécuter - * @param int $type Type de résultat souhaité. Les valeurs possibles sont MYSQLI_ASSOC, MYSQLI_NUM, MYSQLI_BOTH. - * Elles permettent respectivement de récupérer les valeurs sous forme d'un tableau associatif, indexé ou les deux. - * La valeur par défaut est MYSQLI_ASSOC. - * @return mixed L'enregistrement correspondant dans un tableau ou false si la requête échoue - */ - public function obtenirEnregistrement($requete, $type = MYSQLI_ASSOC) - { - $ressource = mysqli_query($this->getDbLink(), $requete); - if ($ressource === false) { - return false; - } - $enregistrement = mysqli_fetch_array($ressource, $type); - mysqli_free_result($ressource); - - if ($enregistrement === null) { - return false; - } else { - return $enregistrement; - } - } - - /** - * Exécute une requête SQL et retourne les enregistrements correspondant - * - * @param string $requete Requête à exécuter - * @param int $type Type de résultat souhaité. Les valeurs possibles sont MYSQLI_ASSOC, MYSQLI_NUM, MYSQLI_BOTH. - * Elles permettent respectivement de récupérer les valeurs sous forme d'un tableau associatif, indexé ou les deux. - * La valeur par défaut est MYSQLI_ASSOC. - * @return array|false Les enregistrements correspondant dans un tableau ou false si la requête échoue - */ - public function obtenirTous($requete, $type = MYSQLI_ASSOC) - { - $ressource = mysqli_query($this->getDbLink(), $requete); - if ($ressource === false) { - return false; - } - - $resultat = []; - while ($enregistrement = mysqli_fetch_array($ressource, $type)) { - $resultat[] = $enregistrement; - } - mysqli_free_result($ressource); - - return $resultat; - } - - /** - * Exécute une requête SQL et retourne les enregistrements correspondant - * - * @param string $requete Requête à exécuter - * @return mixed Les enregistrements correspondant dans un tableau ou false si la requête échoue - */ - public function obtenirColonne($requete) - { - $ressource = mysqli_query($this->getDbLink(), $requete); - if ($ressource === false) { - return false; - } - - $resultat = []; - while ($enregistrement = mysqli_fetch_array($ressource)) { - $resultat[] = $enregistrement[0]; - } - mysqli_free_result($ressource); - - return $resultat; - } - - /** - * Exécute une requête SQL et retourne les enregistrements correspondant dans un tableau associatif dont le premier champ est la clé - * - * @param string $requete Requête à exécuter - * @return array|false Les enregistrements correspondant dans un tableau associatif ou false si la requête échoue - */ - public function obtenirAssociatif($requete) - { - $ressource = mysqli_query($this->getDbLink(), $requete); - $nombre_champs = mysqli_num_fields($ressource); - if ($ressource === false || $nombre_champs < 2) { - return false; - } - - // $i = 0; - // $champs = array(); - // while ($i < $nombre_champs) { - // $champs[$i] = MYSQLI_field_name($ressource, $i); - // $i++; - // } - $champs = mysqli_fetch_fields($ressource); - - $resultat = []; - if ($nombre_champs == 2) { - while ($enregistrement = mysqli_fetch_array($ressource, MYSQLI_NUM)) { - $resultat[$enregistrement[0]] = $enregistrement[1]; - } - } else { - while ($enregistrement = mysqli_fetch_array($ressource, MYSQLI_ASSOC)) { - $resultat[$enregistrement[$champs[0]->name]] = array_slice($enregistrement, 1); - } - } - mysqli_free_result($ressource); - - return $resultat; - } - - public function obtenirDernierId() - { - return mysqli_insert_id($this->getDbLink()); - } -} diff --git a/sources/Afup/Utils/LegacyConnectionFactory.php b/sources/Afup/Utils/LegacyConnectionFactory.php deleted file mode 100644 index c3522cb47..000000000 --- a/sources/Afup/Utils/LegacyConnectionFactory.php +++ /dev/null @@ -1,23 +0,0 @@ -bdd)) { - if (isset($GLOBALS['AFUP_DB']) === false) { - throw new \RuntimeException('Could not find the legacy database connexion'); - } - - $this->bdd = $GLOBALS['AFUP_DB']; - } - - return $this->bdd; - } -} diff --git a/sources/AppBundle/Controller/Admin/HealthcheckController.php b/sources/AppBundle/Controller/Admin/HealthcheckController.php index 97698d57b..f519f876a 100644 --- a/sources/AppBundle/Controller/Admin/HealthcheckController.php +++ b/sources/AppBundle/Controller/Admin/HealthcheckController.php @@ -4,23 +4,25 @@ namespace AppBundle\Controller\Admin; -use Afup\Site\Corporate\_Site_Base_De_Donnees; use AppBundle\Event\Model\Repository\EventRepository; use DateTime; +use Doctrine\DBAL\Connection; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Kernel; class HealthcheckController extends AbstractController { - public function __construct(private readonly EventRepository $eventRepository) {} + public function __construct( + private readonly EventRepository $eventRepository, + private readonly Connection $dbalConnection, + ) {} public function __invoke(): Response { $php = new DateTime(); - $bdd = new _Site_Base_De_Donnees(); - $mysqlBdd = $bdd->obtenirUn('SELECT CURRENT_TIMESTAMP'); + $mysqlBdd = $this->dbalConnection->executeQuery('SELECT CURRENT_TIMESTAMP')->fetchOne(); $mysqlBdd = new DateTime($mysqlBdd); $mysqlTing = $this->eventRepository->getQuery('SELECT CURRENT_TIMESTAMP')->execute()['CURRENT_TIMESTAMP']; @@ -31,7 +33,7 @@ public function __invoke(): Response return $this->render('admin/healthcheck.html.twig', [ 'dates' => [ 'php' => $php->format(\DateTime::ATOM), - 'mysql_bdd' => $mysqlBdd->format(\DateTime::ATOM), + 'mysql_dbal' => $mysqlBdd->format(\DateTime::ATOM), 'mysql_ting' => $mysqlTing->format(\DateTime::ATOM), 'diff' => $diff, ], diff --git a/templates/admin/healthcheck.html.twig b/templates/admin/healthcheck.html.twig index be62c90a3..e0625241a 100644 --- a/templates/admin/healthcheck.html.twig +++ b/templates/admin/healthcheck.html.twig @@ -10,8 +10,8 @@
PHP
{{ dates.php }}
-
MySQL Base_De_Donnees
-
{{ dates.mysql_bdd }}
+
MySQL (DBAL)
+
{{ dates.mysql_dbal }}
MySQL Ting
{{ dates.mysql_ting }}
Différence MySQL et PHP