<?php
namespace Moto\Update; use Moto; class AbstractClass { protected static $_currentBuild; protected static $_errors = array(); protected static $_errorNames = array(); public static function getErrors() { return static::$_errors; } public static function addError($name, $build = null) { if ($name == 'CANT_UPGRADE' && array_key_exists($name, static::$_errorNames)) { return; } $error = array( 'name' => $name, 'currentBuild' => static::$_currentBuild ); if ($build) { $error['newBuild'] = $build; } static::$_errors[] = $error; static::$_errorNames[$name] = $error; } public static function isError() { return count(static::$_errors); } }