for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Deferred
*
* Run callback when script execution is stopped.
* @package core
* @author [email protected]
* @copyright Caffeina srl - 2016 - http://caffeina.com
*/
class Deferred {
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
protected $callback,
Only declaring a single property per statement allows you to later on add doc comments more easily.
It is also recommended by PSR2, so it is a common style that many people expect.
$enabled = true;
public function __construct( callable $callback ) {
$this->callback = $callback;
}
public function disarm() {
$this->enabled = false;
public function prime() {
$this->enabled = true;
public function __destruct() {
if ( $this->enabled ) call_user_func( $this->callback );
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.