for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SilverStripe\Addons\Controllers;
use SilverStripe\Addons\Model\AddonAuthor;
use SilverStripe\Control\Controller;
use SilverStripe\Control\Director;
/**
* Handles displaying package authors.
*/
class AuthorsController extends SiteController
{
private static $url_handlers = [
'$AuthorID!' => 'author'
];
private static $allowed_actions = [
'index',
'author'
public function index()
return $this->renderWith(['Authors', 'Page']);
}
public function author($request)
$id = $request->param('AuthorID');
$author = AddonAuthor::get()->byID($id);
if (!$author) {
$this->httpError(404);
return new AuthorController($this, $author);
$author
null|object<SilverStripe\ORM\DataObject>
object<SilverStripe\Addons\Model\AddonAuthor>
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
public function Title()
return 'Authors';
public function Link()
return Controller::join_links(Director::baseURL(), 'authors');
public function Authors()
return AddonAuthor::get();