for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @package CleverStyle Framework
* @author Nazar Mokrynskyi <[email protected]>
* @copyright Copyright (c) 2011-2017, Nazar Mokrynskyi
* @license MIT License, see license.txt
*/
namespace cs;
use
ArrayAccess,
SimpleXMLElement;
* False_class is used for chained calling, when some method may return false.
*
* Usage of class is simple, just return his instance instead of real boolean <i>false</i>.
* On every call of any method or getting of any property or getting any element of array instance of the this class will be returned.
* Access to anything of this class instance will be casted to boolean <i>false</i>
* Inherits SimpleXMLElement in order to be casted from object to boolean as <i>false</i>
* @property string $error
class False_class extends SimpleXMLElement implements ArrayAccess {
* Use this method to obtain correct instance
* @return False_class
public static function instance () {
static $instance;
if (!isset($instance)) {
$instance = new self('<?xml version=\'1.0\'?><cs></cs>');
}
return $instance;
* Getting any property
* @param string $item
public function __get ($item) {
return $this;
* @return false
public function __isset ($item) {
return false;
* Calling of any method
* @param string $method
* @param mixed[] $params
public function __call ($method, $params) {
* Calling as callable
public function __invoke () {
* @return string
public function __toString () {
return '';
* If item exists
public function offsetExists ($offset) {
* Get item
public function offsetGet ($offset) {
* Set item
public function offsetSet ($offset, $value) { }
* Delete item
public function offsetUnset ($offset) { }