Skip to content

Instantly share code, notes, and snippets.

@Nall-chan
Last active May 13, 2023 19:19
Show Gist options
  • Save Nall-chan/6ba6b2a29b4c0fad589c09d563c077ee to your computer and use it in GitHub Desktop.
Save Nall-chan/6ba6b2a29b4c0fad589c09d563c077ee to your computer and use it in GitHub Desktop.
<?php
echo "class IPSModuleStrict
{
protected \$InstanceID;\r\n\r\n";
$r = new ReflectionClass('IPSModuleStrict');
foreach ($r->getMethods() as $Method){
$refFunction = new ReflectionMethod('IPSModuleStrict',$Method->name);
echo ($Method->isPublic() ? ' public ': '');
echo ($Method->isPrivate() ? ' private ': '');
echo ($Method->isProtected() ? ' protected ': '');
echo 'function '.$Method->name.'(';
$Param=[];
foreach ($refFunction->getParameters() as $Parameter){
$Param[] = $Parameter->getType().' $'.$Parameter->getName();
}
echo implode(',',$Param);
echo ')';
$ReturnType = $refFunction->getReturnType();
if ($Method->name != '__construct'){
echo ': '.$ReturnType;
}
echo "\r\n";
if (($ReturnType != 'void') && ($ReturnType != '')){
if ($ReturnType == 'mixed'){
echo " {\r\n return '';\r\n }\r\n\r\n";
} else {
echo " {\r\n return (".$ReturnType.")'';\r\n }\r\n\r\n";
}
} else {
echo " {\r\n return;\r\n }\r\n\r\n";
}
}
echo "}";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment