Documentation

JsonFile extends Coveralls
in package

Data represents "json_file" of Coveralls API.

Tags
author

Kitamura Satoshi with.no.parachute@gmail.com

SuppressWarnings

(PHPMD.ExcessiveClassComplexity)

Table of Contents

Properties

$flagName  : string
If this is set, the job being reported will be named in the view and have it’s own independent status reported to your VCS provider.
$git  : null|Git
Git data.
$metrics  : Metrics
Metrics.
$parallel  : bool
If this is set, the build will not be considered done until a webhook has been sent to https://coveralls.io/webhook?repo_token=….
$repoToken  : null|string
Repository token.
$runAt  : null|string
A timestamp when the job ran. Must be parsable by Ruby.
$serviceBranch  : string
Branch name (not documented).
$serviceBuildUrl  : string
Build URL of the project (not documented).
$serviceEventType  : string
Service event type (not documented).
$serviceJobId  : null|string
Service job id.
$serviceName  : null|string
Service name.
$serviceNumber  : string
Service number (not documented).
$servicePullRequest  : string
Pull request info (not documented).
$sourceFiles  : array<string|int, SourceFile>
Source files.

Methods

__toString()  : string
String expression (convert to json).
addSourceFile()  : mixed
Add source file.
excludeNoStatementsFiles()  : mixed
Exclude source files that have no executable statements.
fillJobs()  : $this
Fill environment variables.
getFlagName()  : null|string
Return flag name.
getGit()  : null|Git
Return git data.
getMetrics()  : Metrics
Return metrics.
getParallel()  : null|bool
Return parallel.
getRepoToken()  : null|string
Return repository token.
getRunAt()  : null|string
Return timestamp when the job ran.
getServiceBranch()  : string
Return branch name.
getServiceBuildUrl()  : string
Return build URL of the project.
getServiceEventType()  : string
Return service event type.
getServiceJobId()  : null|string
Return service job id.
getServiceName()  : null|string
Return service name.
getServiceNumber()  : string
Return service number.
getServicePullRequest()  : string
Return pull request info.
getSourceFile()  : null|SourceFile
Return source file.
getSourceFiles()  : array<string|int, SourceFile>
Return source files.
hasSourceFile()  : bool
Return whether the json file has source file.
hasSourceFiles()  : bool
Return whether the json file has a source file.
reportLineCoverage()  : float
Return line coverage.
setFlagName()  : $this
Set flag name.
setGit()  : $this
Set git data.
setParallel()  : $this
Set parallel.
setRepoToken()  : $this
Set repository token.
setRunAt()  : $this
Set timestamp when the job ran.
setServiceJobId()  : $this
Set service job id.
setServiceName()  : $this
Set service name.
sortSourceFiles()  : mixed
Sort source files by path.
toArray()  : array<string|int, mixed>
Convert to an array.
ensureJobs()  : $this
Ensure data consistency for jobs API.
fillStandardizedEnvVars()  : $this
Fill standardized environment variables.
isUnsupportedServiceJob()  : bool
Return whether the job is running on unsupported service.
onJsonError()  : mixed
requireGithubActions()  : bool
Return whether the job requires "service_number", "service_job_id" and "repo_token" (for GithubActions).
requireRepoToken()  : bool
Return whether the job requires "repo_token" (for Travis PRO).
requireServiceEventType()  : bool
Return whether the job requires "service_event_type" (for local environment).
requireServiceJobId()  : bool
Return whether the job requires "service_job_id" (for Travis CI).
requireServiceNumber()  : bool
Return whether the job requires "service_number" (for CircleCI, Jenkins, Codeship or other CIs).
toJsonProperty()  : mixed
Convert to json property.
toJsonPropertyArray()  : array<string|int, mixed>
Convert to array as json property.
throwWhenInvalidJson()  : mixed

Properties

$flagName

If this is set, the job being reported will be named in the view and have it’s own independent status reported to your VCS provider.

protected string $flagName

$parallel

If this is set, the build will not be considered done until a webhook has been sent to https://coveralls.io/webhook?repo_token=….

protected bool $parallel

$repoToken

Repository token.

protected null|string $repoToken

$runAt

A timestamp when the job ran. Must be parsable by Ruby.

protected null|string $runAt

"2013-02-18 00:52:48 -0800"

$serviceBranch

Branch name (not documented).

protected string $serviceBranch

$serviceBuildUrl

Build URL of the project (not documented).

protected string $serviceBuildUrl

$serviceEventType

Service event type (not documented).

protected string $serviceEventType

$serviceJobId

Service job id.

protected null|string $serviceJobId

$serviceName

Service name.

protected null|string $serviceName

$serviceNumber

Service number (not documented).

protected string $serviceNumber

$servicePullRequest

Pull request info (not documented).

protected string $servicePullRequest

Methods

__toString()

String expression (convert to json).

public __toString() : string
Return values
string

excludeNoStatementsFiles()

Exclude source files that have no executable statements.

public excludeNoStatementsFiles() : mixed

fillJobs()

Fill environment variables.

public fillJobs(array<string|int, mixed> $env) : $this
Parameters
$env : array<string|int, mixed>

$_SERVER environment

Tags
throws
RuntimeException
Return values
$this

getFlagName()

Return flag name.

public getFlagName() : null|string
Return values
null|string

getGit()

Return git data.

public getGit() : null|Git
Return values
null|Git

getParallel()

Return parallel.

public getParallel() : null|bool
Return values
null|bool

getRepoToken()

Return repository token.

public getRepoToken() : null|string
Return values
null|string

getRunAt()

Return timestamp when the job ran.

public getRunAt() : null|string
Return values
null|string

getServiceBranch()

Return branch name.

public getServiceBranch() : string
Return values
string

getServiceBuildUrl()

Return build URL of the project.

public getServiceBuildUrl() : string
Return values
string

getServiceEventType()

Return service event type.

public getServiceEventType() : string
Return values
string

getServiceJobId()

Return service job id.

public getServiceJobId() : null|string
Return values
null|string

getServiceName()

Return service name.

public getServiceName() : null|string
Return values
null|string

getServiceNumber()

Return service number.

public getServiceNumber() : string
Return values
string

getServicePullRequest()

Return pull request info.

public getServicePullRequest() : string
Return values
string

getSourceFile()

Return source file.

public getSourceFile(string $path) : null|SourceFile
Parameters
$path : string

absolute path to source file

Return values
null|SourceFile

hasSourceFile()

Return whether the json file has source file.

public hasSourceFile(string $path) : bool
Parameters
$path : string

absolute path to source file

Return values
bool

hasSourceFiles()

Return whether the json file has a source file.

public hasSourceFiles() : bool
Return values
bool

reportLineCoverage()

Return line coverage.

public reportLineCoverage() : float
Return values
float

setFlagName()

Set flag name.

public setFlagName(string $flagName) : $this
Parameters
$flagName : string

flag name

Return values
$this

setGit()

Set git data.

public setGit(Git $git) : $this
Parameters
$git : Git

git data

Return values
$this

setParallel()

Set parallel.

public setParallel(string $parallel) : $this
Parameters
$parallel : string

parallel

Return values
$this

setRepoToken()

Set repository token.

public setRepoToken(string $repoToken) : $this
Parameters
$repoToken : string

repository token

Return values
$this

setRunAt()

Set timestamp when the job ran.

public setRunAt(string $runAt) : $this
Parameters
$runAt : string

timestamp

Return values
$this

setServiceJobId()

Set service job id.

public setServiceJobId(string $serviceJobId) : $this
Parameters
$serviceJobId : string

service job id

Return values
$this

setServiceName()

Set service name.

public setServiceName(string $serviceName) : $this
Parameters
$serviceName : string

service name

Return values
$this

sortSourceFiles()

Sort source files by path.

public sortSourceFiles() : mixed

ensureJobs()

Ensure data consistency for jobs API.

protected ensureJobs() : $this
Tags
throws
RuntimeException
Return values
$this

fillStandardizedEnvVars()

Fill standardized environment variables.

protected fillStandardizedEnvVars(array<string|int, mixed> $env) : $this

"CI_NAME", "CI_BUILD_NUMBER" must be set.

Env vars are:

  • CI_NAME
  • CI_BUILD_NUMBER
  • CI_BUILD_URL
  • CI_BRANCH
  • CI_PULL_REQUEST

These vars are supported by Codeship.

Parameters
$env : array<string|int, mixed>

$_SERVER environment

Return values
$this

isUnsupportedServiceJob()

Return whether the job is running on unsupported service.

protected isUnsupportedServiceJob() : bool
Return values
bool

onJsonError()

protected onJsonError() : mixed

requireGithubActions()

Return whether the job requires "service_number", "service_job_id" and "repo_token" (for GithubActions).

protected requireGithubActions() : bool
Return values
bool

requireRepoToken()

Return whether the job requires "repo_token" (for Travis PRO).

protected requireRepoToken() : bool
Return values
bool

requireServiceEventType()

Return whether the job requires "service_event_type" (for local environment).

protected requireServiceEventType() : bool
Return values
bool

requireServiceJobId()

Return whether the job requires "service_job_id" (for Travis CI).

protected requireServiceJobId() : bool
Return values
bool

requireServiceNumber()

Return whether the job requires "service_number" (for CircleCI, Jenkins, Codeship or other CIs).

protected requireServiceNumber() : bool
Return values
bool

toJsonProperty()

Convert to json property.

protected toJsonProperty(mixed $prop) : mixed
Parameters
$prop : mixed

toJsonPropertyArray()

Convert to array as json property.

protected toJsonPropertyArray(array<string|int, mixed> $propArray) : array<string|int, mixed>
Parameters
$propArray : array<string|int, mixed>
Return values
array<string|int, mixed>

throwWhenInvalidJson()

private throwWhenInvalidJson(array<string|int, mixed> $item, string $source) : mixed
Parameters
$item : array<string|int, mixed>
$source : string

        
On this page

Search results