for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Abstract entity class file
*
* @package EBloodBank
* @subpackage Models
* @since 1.0
*/
namespace EBloodBank\Models;
use EBloodBank as EBB;
* Abstract entity class
* @MappedSuperclass
abstract class Entity
{
* @return mixed
public function get($key)
if (property_exists($this, $key)) {
return $this->$key;
}
* @return bool
abstract public function isExists();
* @return void
public function display($key, $format = 'html')
switch ($format) {
case 'attr':
echo EBB\escAttr($this->get($key));
escAttr
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
echo /** @scrutinizer ignore-call */ EBB\escAttr($this->get($key));
break;
case 'html':
echo EBB\escHTML($this->get($key));
default:
case 'plain':
echo $this->get($key);
public static function sanitize($key, $value)
return $value;
public static function validate($key, $value)
return true;
public function set($key, $value, $sanitize = false, $validate = true)
if ($sanitize) {
$value = static::sanitize($key, $value);
if (! $validate || static::validate($key, $value)) {
$this->$key = $value;