for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Dtc\QueueBundle\Model;
use Dtc\QueueBundle\Util\Util;
trait MicrotimeTrait
{
public function setWhenAt(\DateTime $whenAt)
parent::setWhenAt($whenAt);
return $this->setWhenUs(Util::getMicrotimeDecimalFormat($whenAt));
}
/**
* @return \DateTime|null
*/
public function getWhenAt()
$whenUs = isset($this->whenUs) ? $this->whenUs : null;
whenUs
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
if ($whenUs) {
return Util::getDateTimeFromDecimalFormat($whenUs);
return null;
* @param string
public function setWhenUs($whenUs)
$this->whenUs = $whenUs;
return $this;
public function getWhenUs()
return isset($this->whenUs) ? $this->whenUs : null;
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: