Helpers refactoring

This commit is contained in:
Frederic Guillot
2015-05-24 16:02:25 -04:00
parent 65e9e5d1be
commit eeac2329ba
239 changed files with 2441 additions and 2337 deletions

View File

@@ -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];
}
}

View File

@@ -11,7 +11,7 @@ use Model\Task;
* @package integration
* @author Frederic Guillot
*/
class BitbucketWebhook extends Base
class BitbucketWebhook extends \Core\Base
{
/**
* Events

View File

@@ -11,7 +11,7 @@ use Model\Task;
* @package integration
* @author Frederic Guillot
*/
class GithubWebhook extends Base
class GithubWebhook extends \Core\Base
{
/**
* Events

View File

@@ -12,7 +12,7 @@ use Model\Task;
* @package integration
* @author Frederic Guillot
*/
class GitlabWebhook extends Base
class GitlabWebhook extends \Core\Base
{
/**
* Events

View File

@@ -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

View File

@@ -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);

View File

@@ -11,7 +11,7 @@ use Core\Tool;
* @package integration
* @author Frederic Guillot
*/
class MailgunWebhook extends Base
class MailgunWebhook extends \Core\Base
{
/**
* Parse incoming email

View File

@@ -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

View File

@@ -11,7 +11,7 @@ use Core\Tool;
* @package integration
* @author Frederic Guillot
*/
class SendgridWebhook extends Base
class SendgridWebhook extends \Core\Base
{
/**
* Parse incoming email

View File

@@ -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