( ! ) Fatal error: Cannot redeclare ParameterHandler::getInt() in /home/deploy/EHungry-2-joel/Web/classes/ParameterHandler.class.php on line 172
Call Stack
#TimeMemoryFunctionLocation
10.0001400104{main}( ).../index.php:0
20.00826197768require( '/home/deploy/EHungry-2-joel/PHP/Global.php' ).../index.php:17
30.02137122872spl_autoload_call ( ).../Global.php:697
40.02137122920Composer\Autoload\ClassLoader->loadClass( ).../Global.php:697
50.02137122920Composer\Autoload\includeFile( ).../ClassLoader.php:428
Whoops! There was an error.
Whoops \ Exception \ ErrorException (E_COMPILE_ERROR)
Cannot redeclare ParameterHandler::getInt() Whoops\Exception\ErrorException thrown with message "Cannot redeclare ParameterHandler::getInt()" Stacktrace: #5 Whoops\Exception\ErrorException in /home/deploy/EHungry-2-joel/Web/classes/ParameterHandler.class.php:172 #4 Composer\Autoload\includeFile in /home/deploy/EHungry-2-joel/PHP/vendor/composer/ClassLoader.php:428 #3 Composer\Autoload\ClassLoader:loadClass in /home/deploy/EHungry-2-joel/PHP/Global.php:697 #2 spl_autoload_call in /home/deploy/EHungry-2-joel/PHP/Global.php:697 #1 in /home/deploy/EHungry-2-joel/Web/index.php:17 #0 {main} in /home/deploy/EHungry-2-joel/Web/index.php:0
Stack frames (6)
5
Whoops
\
Exception
\
ErrorException
/
home
/
deploy
/
EHungry-2-joel
/
Web
/
classes
/
ParameterHandler.class.php
172
4
Composer
\
Autoload
\
includeFile
/
vendor
/
composer
/
ClassLoader.php
428
3
Composer
\
Autoload
\
ClassLoader
loadClass
/
Global.php
697
2
spl_autoload_call
/
Global.php
697
1
/
home
/
deploy
/
EHungry-2-joel
/
Web
/
index.php
17
0
{main}
/
home
/
deploy
/
EHungry-2-joel
/
Web
/
index.php
0
/
home
/
deploy
/
EHungry-2-joel
/
Web
/
classes
/
ParameterHandler.class.php
        return $values;
    }
 
    /**
     * Was the parameter included in the request? It may be empty and this will return true if the parameter was sent.
     */
    public function hasParam(string $name): bool {
        return array_key_exists($name, $this->params);
    }
 
    /**
     * @param string $key
     * @param $value
     * @return mixed|null
     */
    public function setParam(string $key, $value = null) {
        return $this->params[$key] = $value;
    }
 
    public function getInt(string $name, ?int $default = 0): ?int {
        if (array_key_exists($name, $this->params)) {
            return intval($this->params[$name]);
        }
 
        return $default;
    }
 
    /**
     * Money is often stored as an integer value in our database
     * @return int|null (fieldVal x 100)
     */
    public function getMoneyAsInt(string $name, $default = 0, bool $allowNegative = false): ?int {
        if (array_key_exists($name, $this->params) && !empty($this->params[$name])) {
            $out = moneyStringToInt($this->params[$name]);
            $out = ($allowNegative ? $out : max(0, $out));
            return $out;
        }
 
        return $default;
    }
Arguments
  1. "Cannot redeclare ParameterHandler::getInt()"
    
/
home
/
deploy
/
EHungry-2-joel
/
PHP
/
vendor
/
composer
/
ClassLoader.php
     */
    public function unregister()
    {
        spl_autoload_unregister(array($this, 'loadClass'));
 
        if (null !== $this->vendorDir) {
            unset(self::$registeredLoaders[$this->vendorDir]);
        }
    }
 
    /**
     * Loads the given class or interface.
     *
     * @param  string    $class The name of the class
     * @return true|null True if loaded, null otherwise
     */
    public function loadClass($class)
    {
        if ($file = $this->findFile($class)) {
            includeFile($file);
 
            return true;
        }
 
        return null;
    }
 
    /**
     * Finds the path to the file where the class is defined.
     *
     * @param string $class The name of the class
     *
     * @return string|false The path if found, false otherwise
     */
    public function findFile($class)
    {
        // class map lookup
        if (isset($this->classMap[$class])) {
            return $this->classMap[$class];
        }
/
home
/
deploy
/
EHungry-2-joel
/
PHP
/
Global.php
    $_REQUEST["form"] = ($controller == 'rcs' || $controller == 'helpdesk')? 'dashboard' : 'home';
}
 
//don't "optimize" this `if` to a single line as we sometimes actually pass _CORDOVA_APP as a get param and don't want to override that
if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'Cordova') !== false) {
    if (isSpringroll()) {
        $_REQUEST['_SPRINGROLL_APP'] = true;
        //to keep customers logged in on the springroll app
        if (empty($_SESSION['marketplace_customer_id']) && isset($_COOKIE["springroll_t"]) && ($token = CustomerToken::validate($_COOKIE["springroll_t"]))) {
            $user = Customer::getCustomerOrMarketplaceCustomer($token->customer_id);
            if ($user->exists) {
                $user->setSessionAuth();
            }
        }
    } else {
        $_REQUEST['_CORDOVA_APP'] = true;
    }
}
 
$handler = new ParameterHandler();
 
/
home
/
deploy
/
EHungry-2-joel
/
PHP
/
Global.php
    $_REQUEST["form"] = ($controller == 'rcs' || $controller == 'helpdesk')? 'dashboard' : 'home';
}
 
//don't "optimize" this `if` to a single line as we sometimes actually pass _CORDOVA_APP as a get param and don't want to override that
if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'Cordova') !== false) {
    if (isSpringroll()) {
        $_REQUEST['_SPRINGROLL_APP'] = true;
        //to keep customers logged in on the springroll app
        if (empty($_SESSION['marketplace_customer_id']) && isset($_COOKIE["springroll_t"]) && ($token = CustomerToken::validate($_COOKIE["springroll_t"]))) {
            $user = Customer::getCustomerOrMarketplaceCustomer($token->customer_id);
            if ($user->exists) {
                $user->setSessionAuth();
            }
        }
    } else {
        $_REQUEST['_CORDOVA_APP'] = true;
    }
}
 
$handler = new ParameterHandler();
 
/
home
/
deploy
/
EHungry-2-joel
/
Web
/
index.php
<? /** @noinspection PhpIncludeInspection - to avoid marking dynamic includes */
 
//TODO create a «root»/_bootstrap.php which can be used by .psysh.php, tests/bootstrap.php and Web/index.php
require(dirname(__DIR__).'/PHP/base_consts.php');
require(dirname(__DIR__).'/PHP/autoloader.php');
initializeAutoLoader();
 
//disabled for now since we already have our own Alerts infrastructure, and it's not worth it to append another cloud provider to the startup of every freaking request; it's also not possible to catch errors this early if we depend on database checks, but we'll leave it here in case we change our mind?
//ErrorHandlers::sentryInit(); //early catch of errors and failsafe for smaller controllers, not in Sentry
 
App::startTime();
 
ErrorHandlers::register();
 
// Global.php is the core setup file for the application
App::debugbarTime('Global.php');
require(dirname(__DIR__) . '/PHP/Global.php');
App::debugbarTime('Global.php');
/** @var string $controller The main controller - defined at /PHP/Global.php */
 
App::debugbarTime('Sentry - controller');
ErrorHandlers::sentryInit($controller); //doesn't always do much - not every controller has a Sentry project
App::debugbarTime('Sentry - controller');
 
App::debugbarTime("controller: $controller");
apache_note('AppController', $controller);
if (file_exists(CORE_PATH."lib/helpers/$controller.php")) {
    require CORE_PATH."lib/helpers/$controller.php";
}
require CORE_PATH."controllers/$controller.php";
App::debugbarTime("controller: $controller");
 
/
home
/
deploy
/
EHungry-2-joel
/
Web
/
index.php
<? /** @noinspection PhpIncludeInspection - to avoid marking dynamic includes */
 
//TODO create a «root»/_bootstrap.php which can be used by .psysh.php, tests/bootstrap.php and Web/index.php
require(dirname(__DIR__).'/PHP/base_consts.php');
require(dirname(__DIR__).'/PHP/autoloader.php');
initializeAutoLoader();
 
//disabled for now since we already have our own Alerts infrastructure, and it's not worth it to append another cloud provider to the startup of every freaking request; it's also not possible to catch errors this early if we depend on database checks, but we'll leave it here in case we change our mind?
//ErrorHandlers::sentryInit(); //early catch of errors and failsafe for smaller controllers, not in Sentry
 
App::startTime();
 
ErrorHandlers::register();
 
// Global.php is the core setup file for the application
App::debugbarTime('Global.php');
require(dirname(__DIR__) . '/PHP/Global.php');
App::debugbarTime('Global.php');
/** @var string $controller The main controller - defined at /PHP/Global.php */
 
App::debugbarTime('Sentry - controller');
ErrorHandlers::sentryInit($controller); //doesn't always do much - not every controller has a Sentry project
App::debugbarTime('Sentry - controller');
 
App::debugbarTime("controller: $controller");
apache_note('AppController', $controller);
if (file_exists(CORE_PATH."lib/helpers/$controller.php")) {
    require CORE_PATH."lib/helpers/$controller.php";
}
require CORE_PATH."controllers/$controller.php";
App::debugbarTime("controller: $controller");
 

Environment & details:

Key Value
aid
"restaurant/bennywongs/order/main/chow-fun-mei-fun/25-chicken-chow-fun"
empty
empty
Key Value
PHPSESSID
"3omuc8ad06kpeapvsiacrgu0qo"
Key Value
loc
"en_US"
Key Value
UNIQUE_ID
"aWCb7cfi63UdAMaoiOA_lAAAAAo"
SCRIPT_URL
"/restaurant/bennywongs/order/main/chow-fun-mei-fun/25-chicken-chow-fun"
SCRIPT_URI
"http://www.springroll.com.2.joel.ehungry.net/restaurant/bennywongs/order/main/chow-fun-mei-fun/25-chicken-chow-fun"
HTTP_HOST
"www.springroll.com.2.joel.ehungry.net"
HTTP_X_REAL_IP
"216.73.216.113"
HTTP_X_CONFKEY
"Main_Domain:14844"
HTTP_SCHEME
"https"
HTTP_EHENV
"TODO"
HTTP_CONNECTION
"close"
HTTP_ACCEPT
"*/*"
HTTP_USER_AGENT
"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
HTTP_ACCEPT_ENCODING
"gzip, br, zstd, deflate"
HTTP_COOKIE
"PHPSESSID=3omuc8ad06kpeapvsiacrgu0qo"
PATH
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
SERVER_SIGNATURE
""
SERVER_SOFTWARE
"Apache/2.4.62 () mod_wsgi/4.6.5 Python/3.7 PHP/7.2.34"
SERVER_NAME
"www.springroll.com.2.joel.ehungry.net"
SERVER_ADDR
"127.0.0.1"
SERVER_PORT
"80"
REMOTE_ADDR
"216.73.216.113"
DOCUMENT_ROOT
"/home/deploy/EHungry-2-joel/Web"
REQUEST_SCHEME
"http"
CONTEXT_PREFIX
""
CONTEXT_DOCUMENT_ROOT
"/home/deploy/EHungry-2-joel/Web"
SERVER_ADMIN
"root@localhost"
SCRIPT_FILENAME
"/home/deploy/EHungry-2-joel/Web/index.php"
REMOTE_PORT
"41544"
GATEWAY_INTERFACE
"CGI/1.1"
SERVER_PROTOCOL
"HTTP/1.0"
REQUEST_METHOD
"GET"
QUERY_STRING
"aid=restaurant/bennywongs/order/main/chow-fun-mei-fun/25-chicken-chow-fun"
REQUEST_URI
"/restaurant/bennywongs/order/main/chow-fun-mei-fun/25-chicken-chow-fun"
SCRIPT_NAME
"/restaurant/bennywongs/order/main/chow-fun-mei-fun/25-chicken-chow-fun"
PHP_SELF
"/restaurant/bennywongs/order/main/chow-fun-mei-fun/25-chicken-chow-fun"
REQUEST_TIME_FLOAT
1767939053.188
REQUEST_TIME
1767939053
empty
0. Whoops\Handler\PrettyPageHandler