From 4b162cefeede83245dc819f2ed5632f6eb405186 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 21 Oct 2023 16:27:52 +0200 Subject: [PATCH 1/2] 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 */ From 3a4cef8705380fdb51a062f4d61558b0294015f5 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 23 Jan 2024 21:20:35 +0100 Subject: [PATCH 2/2] fixup! QUAL Force subclass MINVERSION (#26314) --- htdocs/core/db/DoliDB.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index 7011df49dc5..d20d91462e6 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -30,8 +30,8 @@ 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; + /** Force subclass to implement VERSIONMIN*/ + const VERSIONMIN = self::VERSIONMIN; /** @var bool|resource|mysqli|SQLite3|PgSql\Connection Database handler */ public $db;