Aggiornato Composer
This commit is contained in:
@@ -10,12 +10,11 @@ use PhpParser\ErrorHandler;
|
||||
*
|
||||
* This allows graceful handling of errors.
|
||||
*/
|
||||
class Collecting implements ErrorHandler
|
||||
{
|
||||
class Collecting implements ErrorHandler {
|
||||
/** @var Error[] Collected errors */
|
||||
private $errors = [];
|
||||
private array $errors = [];
|
||||
|
||||
public function handleError(Error $error) {
|
||||
public function handleError(Error $error): void {
|
||||
$this->errors[] = $error;
|
||||
}
|
||||
|
||||
@@ -24,23 +23,21 @@ class Collecting implements ErrorHandler
|
||||
*
|
||||
* @return Error[]
|
||||
*/
|
||||
public function getErrors() : array {
|
||||
public function getErrors(): array {
|
||||
return $this->errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether there are any errors.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasErrors() : bool {
|
||||
public function hasErrors(): bool {
|
||||
return !empty($this->errors);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset/clear collected errors.
|
||||
*/
|
||||
public function clearErrors() {
|
||||
public function clearErrors(): void {
|
||||
$this->errors = [];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user