From 4b162cefeede83245dc819f2ed5632f6eb405186 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 21 Oct 2023 16:27:52 +0200 Subject: [PATCH] QUAL Force subclass MINVERSION (#26314) * Define DoliDB::VERSIONMIN as mandatory constant in subclass See https://stackoverflow.com/a/43134924/6378634 This also helps static tool checks --- htdocs/core/db/DoliDB.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index 7d28007ec81..7011df49dc5 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -2,6 +2,7 @@ /* * Copyright (C) 2013-2015 Raphaël Doursenaud * Copyright (C) 2014-2015 Laurent Destailleur + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,6 +30,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/db/Database.interface.php'; */ abstract class DoliDB implements Database { + /** @var string Force subclass to implement VERSIONMIN */ + const VERSIONMIN=self::VERSIONMIN; + /** @var bool|resource|mysqli|SQLite3|PgSql\Connection Database handler */ public $db; /** @var string Database type */