Helpers refactoring
This commit is contained in:
@@ -1,53 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Integration;
|
||||
|
||||
use Pimple\Container;
|
||||
|
||||
/**
|
||||
* Base class
|
||||
*
|
||||
* @package integration
|
||||
* @author Frederic Guillot
|
||||
*
|
||||
* @property \Model\ProjectActivity $projectActivity
|
||||
* @property \Model\ProjectIntegration $projectIntegration
|
||||
* @property \Model\ProjectPermission $projectPermission
|
||||
* @property \Model\Task $task
|
||||
* @property \Model\TaskFinder $taskFinder
|
||||
* @property \Model\User $user
|
||||
* @property \Model\Project $project
|
||||
*/
|
||||
abstract class Base
|
||||
{
|
||||
/**
|
||||
* Container instance
|
||||
*
|
||||
* @access protected
|
||||
* @var \Pimple\Container
|
||||
*/
|
||||
protected $container;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param \Pimple\Container $container
|
||||
*/
|
||||
public function __construct(Container $container)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load automatically class from the container
|
||||
*
|
||||
* @access public
|
||||
* @param string $name
|
||||
* @return mixed
|
||||
*/
|
||||
public function __get($name)
|
||||
{
|
||||
return $this->container[$name];
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ use Model\Task;
|
||||
* @package integration
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class BitbucketWebhook extends Base
|
||||
class BitbucketWebhook extends \Core\Base
|
||||
{
|
||||
/**
|
||||
* Events
|
||||
|
||||
@@ -11,7 +11,7 @@ use Model\Task;
|
||||
* @package integration
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class GithubWebhook extends Base
|
||||
class GithubWebhook extends \Core\Base
|
||||
{
|
||||
/**
|
||||
* Events
|
||||
|
||||
@@ -12,7 +12,7 @@ use Model\Task;
|
||||
* @package integration
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class GitlabWebhook extends Base
|
||||
class GitlabWebhook extends \Core\Base
|
||||
{
|
||||
/**
|
||||
* Events
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Integration;
|
||||
* @package integration
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class HipchatWebhook extends Base
|
||||
class HipchatWebhook extends \Core\Base
|
||||
{
|
||||
/**
|
||||
* Return true if Hipchat is enabled for this project or globally
|
||||
|
||||
@@ -14,7 +14,7 @@ use Fabiang\Xmpp\Protocol\Presence;
|
||||
* @package integration
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class Jabber extends Base
|
||||
class Jabber extends \Core\Base
|
||||
{
|
||||
/**
|
||||
* Return true if Jabber is enabled for this project or globally
|
||||
@@ -82,7 +82,7 @@ class Jabber extends Base
|
||||
|
||||
if ($this->config->get('application_url')) {
|
||||
$payload .= ' '.$this->config->get('application_url');
|
||||
$payload .= $this->helper->url('task', 'show', array('task_id' => $task_id, 'project_id' => $project_id));
|
||||
$payload .= $this->helper->url->to('task', 'show', array('task_id' => $task_id, 'project_id' => $project_id));
|
||||
}
|
||||
|
||||
$this->sendMessage($project_id, $payload);
|
||||
|
||||
@@ -11,7 +11,7 @@ use Core\Tool;
|
||||
* @package integration
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class MailgunWebhook extends Base
|
||||
class MailgunWebhook extends \Core\Base
|
||||
{
|
||||
/**
|
||||
* Parse incoming email
|
||||
|
||||
@@ -10,7 +10,7 @@ use HTML_To_Markdown;
|
||||
* @package integration
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class PostmarkWebhook extends Base
|
||||
class PostmarkWebhook extends \Core\Base
|
||||
{
|
||||
/**
|
||||
* Parse incoming email
|
||||
|
||||
@@ -11,7 +11,7 @@ use Core\Tool;
|
||||
* @package integration
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class SendgridWebhook extends Base
|
||||
class SendgridWebhook extends \Core\Base
|
||||
{
|
||||
/**
|
||||
* Parse incoming email
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Integration;
|
||||
* @package integration
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class SlackWebhook extends Base
|
||||
class SlackWebhook extends \Core\Base
|
||||
{
|
||||
/**
|
||||
* Return true if Slack is enabled for this project or globally
|
||||
|
||||
Reference in New Issue
Block a user