Where is Param()?

Hi,

v2025

have several custom files that run as cron services. these are not generated by phpM.

in 2 files we use the Param() function but receive error:

PHP Fatal error:  Uncaught TypeError: PHPMaker2025\dams\Request(): Return value must be of type Psr\Http\Message\ServerRequestInterface, null returned in phpfn.php:229
Stack trace:
#0 phpfn.php(794): PHPMaker2025\dams\Request()
#1 /daemons/xxxxxxxx.php(49): PHPMaker2025\dams\Param()
#2 {main}
  thrown in /srv/www/htdocs/dams/src/phpfn.php on line 229

include headers:

<?php
namespace PHPMaker2025\dams;

use DI\ContainerBuilder;

// Autoload
require_once "../vendor/autoload.php";

// Require files
require_once "../src/constants.php";
require_once "../src/config.php";
require_once "../src/phpfn.php";
require_once "../src/userfn.php";

$containerBuilder = new ContainerBuilder();
$containerBuilder->useAttributes(true);

// Add definitions
$containerBuilder->addDefinitions("src/definitions.php");

// Dispatch container build event
DispatchEvent(new ContainerBuildEvent($containerBuilder), ContainerBuildEvent::NAME);

// Build PHP-DI container instance
$container = $containerBuilder->build();
?>

Call:

    $c = Param("c", "");   
    $t = Param("t", "");

where does Param() live ?, can’t seem to locate the “use”

we substituted with this for the interim:

    $c = $_GET['c'];   
    $t = $_GET['t'];  

thanks,
JS

In order to use the Request object in your Custom File with Include common files disabled, then you must to create it first.

Before this line:

$c = Param("c", "");

Simply insert the following code:

// Create request object
$Request = $container->get("request.creator")->createServerRequestFromGlobals();

then try again. It should work now.

thanks,
strange thought I searched for that as well