Page MenuHomeDevCentral

No OneTemporary

diff --git a/app/Analyzers/GitHub/Events/CreateEvent.php b/app/Analyzers/GitHub/Events/CreateEvent.php
index d46b2d3..fb4bec3 100644
--- a/app/Analyzers/GitHub/Events/CreateEvent.php
+++ b/app/Analyzers/GitHub/Events/CreateEvent.php
@@ -1,78 +1,78 @@
<?php
namespace Nasqueron\Notifications\Analyzers\GitHub\Events;
/**
* CreateEvent payload analyzer
*
* We don't support the repository ref type, as, according the documentation,
* "webhooks will not receive this event for created repositories".webhooks
*
* Another case when we won't receive the event is when at least four tags are
* pushed at once.
*
* @link https://developer.github.com/v3/activity/events/types/#createevent
*/
class CreateEvent extends Event {
use WithRef;
/**
* Gets description for the payload
*
* @return string
*/
public function getDescription () : string {
$repository = $this->payload->repository->full_name;
$type = $this->payload->ref_type;
$ref = $this->payload->ref;
if (!self::isValidRefType($type)) {
return trans(
'GitHub.EventsDescriptions.CreateEventUnknown',
[
'type' => $type,
'ref' => $ref,
]
);
}
return trans(
'GitHub.EventsDescriptions.CreateEvent',
[
'type' => $type,
'ref' => $ref,
'repository' => $repository,
]
);
}
/**
* Gets link segments for the type
*
* @return array
* @SuppressWarnings(PHPMD.UnusedPrivateMethod)
*/
private function getLinkRefSegments () : array {
return [
- 'tag' => '/releases/tag/',
- 'branch' => '/tree/',
+ 'tag' => '/releases/tag/',
+ 'branch' => '/tree/',
];
}
/**
* Gets link for the payload
*
* @return string
*/
public function getLink () : string {
$type = $this->payload->ref_type;
$ref = $this->payload->ref;
$url = $this->payload->repository->html_url;
$url .= $this->getLinkRefSegment($type);
$url .= $ref;
return $url;
}
}
diff --git a/app/Analyzers/GitHub/Events/DeleteEvent.php b/app/Analyzers/GitHub/Events/DeleteEvent.php
index 418161c..20a8a6d 100644
--- a/app/Analyzers/GitHub/Events/DeleteEvent.php
+++ b/app/Analyzers/GitHub/Events/DeleteEvent.php
@@ -1,73 +1,73 @@
<?php
namespace Nasqueron\Notifications\Analyzers\GitHub\Events;
/**
* DeleteEvent payload analyzer
*
* Another case when we won't receive the event is when at least four tags are
* deleted at once.
*
* @link https://developer.github.com/v3/activity/events/types/#deleteevent
*/
class DeleteEvent extends Event {
use WithRef;
/**
* Gets description for the payload
*
* @return string
*/
public function getDescription () : string {
$repository = $this->payload->repository->full_name;
$type = $this->payload->ref_type;
$ref = $this->payload->ref;
if (!self::isValidRefType($type)) {
return trans(
'GitHub.EventsDescriptions.DeleteEventUnknown',
[
'type' => $type,
'ref' => $ref,
]
);
}
return trans(
'GitHub.EventsDescriptions.DeleteEvent',
[
'type' => $type,
'ref' => $ref,
'repository' => $repository,
]
);
}
/**
* Gets link segments for the type
*
* @return Array
* @SuppressWarnings(PHPMD.UnusedPrivateMethod)
*/
private function getLinkRefSegments () {
return [
- 'tag' => '/tags',
- 'branch' => '/branches',
+ 'tag' => '/tags',
+ 'branch' => '/branches',
];
}
/**
* Gets link for the payload
*
* @return string
*/
public function getLink () : string {
$type = $this->payload->ref_type;
$url = $this->payload->repository->html_url;
$url .= $this->getLinkRefSegment($type);
return $url;
}
}

File Metadata

Mime Type
text/x-diff
Expires
Tue, Jan 28, 08:10 (6 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2379949
Default Alt Text
(4 KB)

Event Timeline