for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Handles displaying package authors.
*/
class AuthorsController extends SiteController
{
public static $url_handlers = array(
'$AuthorID!' => 'author'
);
public static $allowed_actions = array(
'index',
'author'
public function index()
return $this->renderWith(array('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<DataObject>
object<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();
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: