for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Created by PhpStorm.
* User: arnaud
* Date: 01/11/15
* Time: 23:26
*/
namespace Ndrx\Profiler\Events\Timeline;
use Symfony\Component\EventDispatcher\Event;
class Start extends Event
{
const EVENT_NAME = 'profiler.timeline_start';
* @var mixed
protected $data;
* @var string
protected $label;
protected $key;
* @var int
protected $timestamp;
* Start constructor.
* @param mixed $data
* @param string $label
* @param string $key
* @param float $timestamp
public function __construct($key, $label, $data = null, $timestamp = null)
$this->data = $data;
$this->label = $label;
$this->key = $key;
$this->timestamp = $timestamp === null ? microtime(true) : $timestamp;
$timestamp
integer
$timestamp === null ? microtime(true) : $timestamp
double
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.
$answer = 42; $correct = false; $correct = (bool) $answer;
}
* @return mixed
public function getData()
return $this->data;
* @return string
public function getLabel()
return $this->label;
public function getKey()
return $this->key;
* @return integer
public function getTimestamp()
return $this->timestamp;
* @return array
public function toArray()
return get_object_vars($this);
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.