for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the core-bundle package.
*
* (c) 2018 WEBEWEB
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace WBW\Bundle\CoreBundle\Notification;
* Abstract notification.
* @author webeweb <https://github.com/webeweb/>
* @package WBW\Bundle\CoreBundle\Notification
* @abstract
abstract class AbstractNotification implements NotificationInterface {
* Content.
* @var string
private $content;
* Type.
private $type;
* Constructor.
* @param string $type The type.
* @param string $content The content.
protected function __construct($type, $content) {
$this->setContent($content);
$content
string
object<WBW\Bundle\CoreBundle\Notification\type>
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);
$this->setType($type);
}
* {@inheritdoc}
public function getContent() {
return $this->content;
public function getType() {
return $this->type;
* Set the content.
* @param type $content The content.
* @return NotificcationInterface Returns this notification.
protected function setContent($content) {
$this->content = $content;
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
return $this;
* Set the type.
* @return NotificationInterface Returns this notification.
protected function setType($type) {
$this->type = $type;
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: