Merge pull request #215 from cachethq/cleanup

Cleanup
This commit is contained in:
Graham Campbell 2015-01-01 20:17:11 +00:00
commit 9d3f68bbf7
9 changed files with 69 additions and 42 deletions

View File

@ -11,8 +11,20 @@ class ComponentController extends Controller
{
use ControllerTrait;
/**
* The component repository instance.
*
* @var \CachetHQ\Cachet\Repositories\Component\ComponentRepository
*/
protected $component;
/**
* Create a new component controller instance.
*
* @param \CachetHQ\Cachet\Repositories\Component\ComponentRepository $component
*
* @return void
*/
public function __construct(ComponentRepository $component)
{
$this->component = $component;

View File

@ -11,8 +11,20 @@ class IncidentController extends Controller
{
use ControllerTrait;
/**
* The incident repository instance.
*
* @var \CachetHQ\Cachet\Repositories\Incident\IncidentRepository
*/
protected $incident;
/**
* Create a new incident controller instance.
*
* @param \CachetHQ\Cachet\Repositories\Incident\IncidentRepository $incident
*
* @return void
*/
public function __construct(IncidentRepository $incident)
{
$this->incident = $incident;
@ -33,7 +45,7 @@ class IncidentController extends Controller
*
* @param int $id
*
* @return Incident
* @return \Incident
*/
public function getIncident($id)
{
@ -43,7 +55,7 @@ class IncidentController extends Controller
/**
* Create a new incident.
*
* @return Incident
* @return \Incident
*/
public function postIncidents()
{
@ -55,7 +67,7 @@ class IncidentController extends Controller
*
* @param int $id
*
* @return Incident
* @return \Incident
*/
public function putIncident($id)
{

View File

@ -11,8 +11,20 @@ class MetricController extends Controller
{
use ControllerTrait;
/**
* The metric repository instance.
*
* @var \CachetHQ\Cachet\Repositories\Metric\MetricRepository
*/
protected $metric;
/**
* Create a new metric controller instance.
*
* @param \CachetHQ\Cachet\Repositories\Metric\MetricRepository $metric
*
* @return void
*/
public function __construct(MetricRepository $metric)
{
$this->metric = $metric;
@ -32,7 +44,7 @@ class MetricController extends Controller
*
* @param int $id
*
* @return Metric
* @return \Metric
*/
public function getMetric($id)
{
@ -42,7 +54,7 @@ class MetricController extends Controller
/**
* Create a new metric.
*
* @return Metric
* @return \Metric
*/
public function postMetrics()
{
@ -54,7 +66,7 @@ class MetricController extends Controller
*
* @param int $id
*
* @return Metric
* @return \Metric
*/
public function putMetric($id)
{

View File

@ -11,11 +11,23 @@ class MetricPointController extends Controller
{
use ControllerTrait;
protected $metricpoint;
/**
* The metric point repository instance.
*
* @var \CachetHQ\Cachet\Repositories\MetricPoint\MetricPointRepository
*/
protected $metricPoint;
public function __construct(MetricPointRepository $metricpoint)
/**
* Create a new metric point controller instance.
*
* @param \CachetHQ\Cachet\Repositories\MetricPoint\MetricPointRepository $metricPoint
*
* @return void
*/
public function __construct(MetricPointRepository $metricPoint)
{
$this->metricpoint = $metricpoint;
$this->metricPoint = $metricPoint;
}
/**
* Get all metric points.
@ -24,7 +36,7 @@ class MetricPointController extends Controller
*/
public function getMetricPoints()
{
return $this->metricpoint->all();
return $this->metricPoint->all();
}
/**
@ -32,20 +44,20 @@ class MetricPointController extends Controller
*
* @param int $id
*
* @return MetricPoint
* @return \MetricPoint
*/
public function getMetricPoint($id)
{
return $this->metricpoint->findOrFail($id);
return $this->metricPoint->findOrFail($id);
}
/**
* Create a new metric point.
*
* @return MetricPoint
* @return \MetricPoint
*/
public function postMetricPoints()
{
return $this->metricpoint->create(Input::all());
return $this->metricPoint->create(Input::all());
}
}

View File

@ -7,13 +7,6 @@ use Component;
class EloquentComponentRepository extends EloquentRepository implements ComponentRepository
{
/**
* The eloquent model instance.
*
* @var \Component
*/
protected $model;
/**
* Create a new eloquent component repository instance.
*

View File

@ -7,6 +7,13 @@ use Illuminate\Database\Eloquent\ModelNotFoundException;
abstract class EloquentRepository
{
/**
* The eloquent model instance.
*
* @var \Illuminate\Database\Eloquent\Model
*/
protected $model;
/**
* Returns all models.
*

View File

@ -7,13 +7,6 @@ use Incident;
class EloquentIncidentRepository extends EloquentRepository implements IncidentRepository
{
/**
* The eloquent model instance.
*
* @var \Incident
*/
protected $model;
/**
* Create a new eloquent incident repository instance.
*

View File

@ -7,13 +7,6 @@ use Metric;
class EloquentMetricRepository extends EloquentRepository implements MetricRepository
{
/**
* The eloquent model instance.
*
* @var \Metric
*/
protected $model;
/**
* Create a new eloquent metric repository instance.
*

View File

@ -7,13 +7,6 @@ use MetricPoint;
class EloquentMetricPointRepository extends EloquentRepository implements MetricPointRepository
{
/**
* The eloquent model instance.
*
* @var \MetricPoint
*/
protected $model;
/**
* Create a new eloquent metric point repository instance.
*