Skip to content

Commit 3ea2da3

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

File tree

1 file changed

+32
-5
lines changed

1 file changed

+32
-5
lines changed

helper.php

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

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

84111
/**

0 commit comments

Comments
 (0)