Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F4792573
RepositoryGroupMapping.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
RepositoryGroupMapping.php
View Options
<?php
namespace
Nasqueron\Notifications\Analyzers
;
class
RepositoryGroupMapping
{
///
/// Properties
///
/**
* The group the mapped repositories belong to
*
* @var string
*/
public
$group
;
/**
* An array of the repositories, each item a string with the name of the
* repository. The wildcard '*' is allowed to specify several repositories.
*
* @var array
*/
public
$repositories
;
///
/// Helper methods
///
/**
* Determines if the specified repository matches a pattern
*
* @param string $pattern The pattern, with * allowed as wildcard character
* @param string $repository The repository name to compare with the pattern
* @return bool
*/
public
static
function
doesRepositoryMatch
(
$pattern
,
$repository
)
{
return
str_is
(
$pattern
,
$repository
);
}
/**
* Determines if the specified repository belong to this mapping
*
* @return bool
*/
public
function
doesRepositoryBelong
(
$actualRepository
)
{
foreach
(
$this
->
repositories
as
$candidateRepository
)
{
if
(
static
::
doesRepositoryMatch
(
$candidateRepository
,
$actualRepository
))
{
return
true
;
}
}
return
false
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Feb 28, 20:13 (9 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2435898
Default Alt Text
RepositoryGroupMapping.php (1 KB)
Attached To
Mode
rNOTIF Notifications center
Attached
Detach File
Event Timeline
Log In to Comment