Skip to content

Commit

Permalink
Make modX::getInstance() work with derivative classes
Browse files Browse the repository at this point in the history
  • Loading branch information
opengeek committed May 16, 2024
1 parent d447f18 commit 52d3b1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/Revolution/modX.php
Original file line number Diff line number Diff line change
Expand Up @@ -403,11 +403,11 @@ public static function toQueryString(array $parameters = [], $numPrefix = '', $a
* @param array|null $config An optional array of config data for the instance.
* @param bool $forceNew If true a new instance will be created even if an instance
* with the provided $id already exists in modX::$instances.
* @return modX An instance of modX.
* @return static An instance of modX.
* @throws xPDOException
*/
public static function getInstance($id = null, $config = null, $forceNew = false) {
$class = __CLASS__;
$class = static::class;
if (is_null($id)) {
if (!is_null($config) || $forceNew || empty(self::$instances)) {
$id = uniqid($class);
Expand Down

0 comments on commit 52d3b1d

Please sign in to comment.