/** * @param null $data * @param $failed * @return bool */ public function checkType($data = null, &$failed = null) { if (!$this->getNumeric()) { return parent::checkType($data, $failed); } else { if (is_null($data)) { $data = $this->getData(); } if ($this->getNull() && is_null($data)) { return true; } $valid = is_numeric($data); if (!$valid) { $failed = Structure::typeof($data); } return $valid; } }