Skip to content

Commit 9fa27d7

Browse files
author
rotimi
committed
PHP 8.1 min version readiness
1 parent 5b45f54 commit 9fa27d7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/GDAO/Model.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* @author Rotimi Adegbamigbe
1515
* @copyright (c) 2023, Rotexsoft
1616
*/
17-
abstract class Model {
17+
abstract class Model implements \Stringable {
1818

1919
/**
2020
* Name of the primary key column in the db table associated with this model
@@ -687,13 +687,13 @@ public function __construct(
687687

688688
if (strlen($this->primary_col) <= 0) {
689689

690-
$msg = 'Primary Key Column name not set for ' . get_class($this);
690+
$msg = 'Primary Key Column name not set for ' . static::class;
691691
throw new ModelPrimaryColNameNotSetDuringConstructionException($msg);
692692
}
693693

694694
if (strlen($this->table_name) <= 0) {
695695

696-
$msg = 'Table name not set for ' . get_class($this);
696+
$msg = 'Table name not set for ' . static::class;
697697
throw new ModelTableNameNotSetDuringConstructionException($msg);
698698
}
699699
}
@@ -730,7 +730,7 @@ public function toArray(): array {
730730
*/
731731
public function createNewCollection(\GDAO\Model\RecordInterface ...$list_of_records): \GDAO\Model\CollectionInterface {
732732

733-
$msg = 'Must Implement ' . get_class($this) . '::' . __FUNCTION__ . '(...)';
733+
$msg = 'Must Implement ' . static::class . '::' . __FUNCTION__ . '(...)';
734734
throw new ModelMustImplementMethodException($msg);
735735
}
736736

@@ -883,7 +883,7 @@ public abstract function deleteSpecifiedRecord(\GDAO\Model\RecordInterface $reco
883883
*/
884884
public function fetchRecordsIntoCollection(?object $query = null, array $relations_to_include = []): \GDAO\Model\CollectionInterface {
885885

886-
$msg = 'Must Implement ' . get_class($this) . '::' . __FUNCTION__ . '(...)';
886+
$msg = 'Must Implement ' . static::class . '::' . __FUNCTION__ . '(...)';
887887
throw new ModelMustImplementMethodException($msg);
888888
}
889889

0 commit comments

Comments
 (0)