Skip to content

Commit bf29e6b

Browse files
committed
add backwards compatibility to helper
1 parent 431a77a commit bf29e6b

File tree

1 file changed

+32
-6
lines changed

1 file changed

+32
-6
lines changed

helper.php

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,40 @@ public function getMethods()
7171
}
7272

7373
/**
74-
* This is not a PSR-2 compliant method name
75-
* @deprecated 2025-07-04
76-
*
74+
* Magic method to handle deprecated method calls
75+
* @return mixed
7776
*/
78-
public function get_flags($setflags) // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
77+
public function __call()
7978
{
80-
dbg_deprecated('getFlags()');
81-
return $this->getFlags($setflags);
79+
$args = func_get_args();
80+
$func = array_shift($args);
81+
switch ($func) {
82+
case 'get_flags':
83+
dbg_deprecated('getFlags()');
84+
return $this->getFlags($args[0]);
85+
case '_get_instructions':
86+
dbg_deprecated('getInstructions()');
87+
return $this->getInstructions(
88+
$args[0], // page
89+
$args[1], // sect
90+
$args[2], // mode
91+
$args[3], // lvl
92+
$args[4], // flags
93+
$args[5] ?? null, // root_id
94+
$args[6] ?? [] // included_pages
95+
);
96+
case '_get_included_pages':
97+
dbg_deprecated('getIncludedPages()');
98+
return $this->getIncludedPages(
99+
$args[0], // mode
100+
$args[1], // page
101+
$args[2], // sect
102+
$args[3], // parent_id
103+
$args[4] // flags
104+
);
105+
default:
106+
throw new \BadMethodCallException("Method $func does not exist in " . __CLASS__);
107+
}
82108
}
83109

84110
/**

0 commit comments

Comments
 (0)