Fixing PHPCI errors
This commit is contained in:
parent
28ad88cff9
commit
bda4e22315
|
@ -8,6 +8,7 @@ build_settings:
|
|||
- "PHPCI/Migrations" # Ignore the migrations directory, as both PHPMD and PHPCS can't cope with them.
|
||||
- "PHPCI/Model/Base" # These files are auto-generated, and sometimes hit PHPMD complexity thresholds.
|
||||
- "PHPCI/Languages" # PHPCS fails on character counts for non-Latin languages
|
||||
- "public/assets" # If there are any PHP files in here, we didn't write them.
|
||||
|
||||
setup:
|
||||
composer:
|
||||
|
|
|
@ -276,6 +276,10 @@ class Build extends BuildBase
|
|||
exec(sprintf(IS_WIN ? 'rmdir /S /Q "%s"' : 'rm -Rf "%s"', $buildPath));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the number of seconds a build has been running for.
|
||||
* @return int
|
||||
*/
|
||||
public function getDuration()
|
||||
{
|
||||
$start = $this->getStarted();
|
||||
|
|
|
@ -19,6 +19,10 @@ class BuildError extends BuildErrorBase
|
|||
const SEVERITY_NORMAL = 2;
|
||||
const SEVERITY_LOW = 3;
|
||||
|
||||
/**
|
||||
* Get the language string key for this error's severity level.
|
||||
* @return string
|
||||
*/
|
||||
public function getSeverityString()
|
||||
{
|
||||
switch ($this->getSeverity()) {
|
||||
|
@ -36,6 +40,10 @@ class BuildError extends BuildErrorBase
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the class to apply to HTML elements representing this error.
|
||||
* @return string
|
||||
*/
|
||||
public function getSeverityClass()
|
||||
{
|
||||
switch ($this->getSeverity()) {
|
||||
|
|
|
@ -16,6 +16,12 @@ use PHPCI\Store\Base\BuildErrorStoreBase;
|
|||
*/
|
||||
class BuildErrorStore extends BuildErrorStoreBase
|
||||
{
|
||||
/**
|
||||
* Get a list of errors for a given build, since a given time.
|
||||
* @param $buildId
|
||||
* @param string $since date string
|
||||
* @return array
|
||||
*/
|
||||
public function getErrorsForBuild($buildId, $since = null)
|
||||
{
|
||||
$query = 'SELECT * FROM build_error
|
||||
|
|
|
@ -19,6 +19,12 @@ use PHPCI\Model\BuildMeta;
|
|||
*/
|
||||
class BuildMetaStore extends BuildMetaStoreBase
|
||||
{
|
||||
/**
|
||||
* Only used by an upgrade migration to move errors from build_meta to build_error
|
||||
* @param $start
|
||||
* @param $limit
|
||||
* @return array
|
||||
*/
|
||||
public function getErrorsForUpgrade($start, $limit)
|
||||
{
|
||||
$query = 'SELECT * FROM build_meta
|
||||
|
|
Loading…
Reference in a new issue