for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
*
* Advertisement management. An extension for the phpBB Forum Software package.
* @copyright (c) 2017 phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*/
namespace phpbb\ads\controller;
* Front controller
class click_controller
{
/** @var \phpbb\ads\ad\manager */
protected $manager;
/** @var \phpbb\controller\helper */
protected $helper;
* Constructor
* @param \phpbb\ads\ad\manager $manager Advertisement manager object
* @param \phpbb\controller\helper $helper Controller helper object
public function __construct(\phpbb\ads\ad\manager $manager, \phpbb\controller\helper $helper)
$this->manager = $manager;
$this->helper = $helper;
}
* Increment clicks for an ad
* @param int $ad_id Advertisement ID
* @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
public function increment_clicks($ad_id)
if (!$ad_id)
throw new \phpbb\exception\http_exception(404, 'NOT_FOUND');
$this->manager->increment_ad_clicks($ad_id);
$ad_id
integer
array
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);
return $this->helper->message('');
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: