public function size() { if ($this->is_empty()) { return 0; } $count = 0; foreach ($this->errors as $attribute => $error) { $count += count($error); } return $count; }