I'm not sure if it will work, but maybe you can try
http://www.php.net/manual/en/function.array-shift.php
return array(
'client_id' => $client[0]->getId(),
'client secret' => $client[0]->getSecret(),
'redirect_uri' => array_shift($client[0]->GetClientEndpoints())->getRedirectUri(),
'name' => $client[0]->getName());
At least this snippet works without any errors:
<?php
error_reporting(E_ALL);
class class1{
public function getRedirectUri()
{
return 'something';
}
}
$arr1 = array(new class1(), new class1());
$arr = array(
'client_id' => 'something',
'client secret' => 'something',
'redirect_uri' => array_shift($arr1)->getRedirectUri(),
'name' => 'something');
UPDATE (thanks Rudie)
As it turns out, the sample above is not identical to the case of the author, so a better example (which throws E_STRICT and therefore my answer should not be considered) is:
<?php
error_reporting(E_ALL);
class class2{
public function getRedirectUri()
{
return 'something';
}
}
class class1 {
public function getArrays() {
return array(new class2(), new class2());
}
}
$var = new class1 ();
$arr = array(
'client_id' => 'something',
'client secret' => 'something',
'redirect_uri' => array_shift($var->getArrays())->getRedirectUri(),
'name' => 'something');