Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Parse error: syntax error, unexpected ':', expecting ';' or '{' in C:\xampp\htdocs\akadaulo\components\com_spsimpleportfolio\router.php on line 88


private function getAlias(string $id, string $table) : string
{
try
{
$this->queryBuilder->clear();
$this->queryBuilder->select('alias')
->from($this->db->quoteName($table))
->where($this->db->quoteName('id') . ' = ' . (int) $id);
$this->db->setQuery($this->queryBuilder);

return (string) $this->db->loadResult();
}
catch (Exception $e)
{
echo $e->getMessage();

return '';
}
}

What I have tried:

I have checked the php code in the component, but i don't have a clue how to correct it
Posted
Updated 15-Nov-21 2:58am

1 solution

PHP
private function getAlias(string $id, string $table) : string
                                                     ^^^^^^^^

The ": string" in the above line should not be there. That feature is not available in PHP before version 7.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900