Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F56373847
SourceRepositoryBuildPayload.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
SourceRepositoryBuildPayload.php
View Options
<?php
namespace
Keruald\DockerHub\Build\Payloads
;
/**
* Represents a build trigger payload to build a specific tag or branch
* from the source repository.
*/
abstract
class
SourceRepositoryBuildPayload
extends
BuildPayload
{
/**
* @var string
*/
public
$source_type
;
/**
* @var string
*/
public
$source_name
;
/**
* Initializes a new instance of the SourceRepositoryBuildPayload class.
*
* @param string $type "Tag" or "Branch"
* @param string $name The name of the tag or branch in the repository
*/
public
function
__construct
(
$type
,
$name
)
{
if
(!
self
::
isValidType
(
$type
))
{
throw
new
\InvalidArgumentException
(
"Unexpected type: $type."
);
}
$this
->
source_type
=
$type
;
$this
->
source_name
=
$name
;
}
///
/// Helper methods
///
/**
* Determines if type is "Tag" or "Branch".
*
* @param string $type
* @return bool
*/
public
static
function
isValidType
(
$type
)
{
return
$type
===
SourceRepositoryType
::
TAG
||
$type
===
SourceRepositoryType
::
BRANCH
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Nov 7, 13:42 (1 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4247357
Default Alt Text
SourceRepositoryBuildPayload.php (1 KB)
Attached To
Mode
rKDOCKERHUB Keruald Docker Hub
Attached
Detach File
Event Timeline
Log In to Comment