From 9d8d89248f704df3b35c7325005af270e21e7fdf Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Sat, 20 Dec 2014 21:20:17 +0000 Subject: [PATCH] CS fixes --- .../Controllers/Api/ComponentController.php | 90 ++--- .../Controllers/Api/IncidentController.php | 22 +- .../Controllers/Api/MetricController.php | 22 +- .../Controllers/Api/MetricPointController.php | 19 +- .../Component/ComponentRepository.php | 11 +- .../Component/EloquentComponentRepository.php | 29 +- .../Repositories/EloquentRepository.php | 210 ++++++----- .../Incident/EloquentIncidentRepository.php | 44 ++- .../Incident/IncidentRepository.php | 11 +- .../Metric/EloquentMetricRepository.php | 42 ++- .../Repositories/Metric/MetricRepository.php | 11 +- .../EloquentMetricPointRepository.php | 42 ++- .../MetricPoint/MetricPointRepository.php | 11 +- app/CachetHQ/Cachet/Service/EmailService.php | 15 +- .../Cachet/Service/ServiceInterface.php | 3 +- .../RepositoryServiceProvider.php | 32 +- .../RoutingServiceProvider.php | 46 +-- .../Transformers/ComponentTransformer.php | 7 +- .../Transformers/IncidentTransformer.php | 6 +- .../Transformers/MetricPointTransformer.php | 9 +- .../Cachet/Transformers/MetricTransformer.php | 9 +- app/config/app.php | 352 +++++++++--------- app/config/auth.php | 112 +++--- app/config/cache.php | 144 +++---- app/config/compile.php | 26 +- app/config/database.php | 206 +++++----- app/config/heroku/database.php | 14 +- app/config/local/app.php | 28 +- app/config/mail.php | 206 +++++----- app/config/packages/dingo/api/config.php | 12 +- app/config/queue.php | 136 +++---- app/config/remote.php | 92 ++--- app/config/services.php | 48 +-- app/config/session.php | 232 ++++++------ app/config/testing/cache.php | 30 +- app/config/testing/session.php | 32 +- app/config/view.php | 48 +-- app/config/workbench.php | 48 +-- app/controllers/AuthController.php | 13 +- app/controllers/DashComponentController.php | 125 ++++--- app/controllers/DashIncidentController.php | 102 ++--- app/controllers/DashSettingsController.php | 69 ++-- app/controllers/DashboardController.php | 16 +- app/controllers/HomeController.php | 9 +- app/controllers/RSSController.php | 10 +- app/controllers/SetupController.php | 18 +- ...2014_11_16_224719_CreateIncidentsTable.php | 63 ++-- ...014_11_16_224937_CreateComponentsTable.php | 57 ++- .../2014_11_17_144232_CreateSettingsTable.php | 53 ++- .../2014_11_22_134023_CreateWebHooksTable.php | 65 ++-- ..._22_134136_CreateWebHookResponsesTable.php | 67 ++-- .../2014_11_24_153408_CreateUsersTable.php | 65 ++-- ...24_164650_CreateIncidentTemplatesTable.php | 57 ++- .../2014_11_25_111315_CreateMetricsTable.php | 57 ++- ...4_11_25_111609_CreateMetricPointsTable.php | 55 ++- ...11_25_114040_UserIdColumnForComponents.php | 54 ++- ..._11_25_114101_UserIdColumnForIncidents.php | 54 ++- ...14_11_25_160545_CreateSubscribersTable.php | 53 ++- .../2014_11_26_164111_CreateServicesTable.php | 55 ++- ...terTableIncidentsRenameComponentColumn.php | 52 ++- ...44_AlterIncidentsTableMoveUserIdColumn.php | 52 ++- ...erTableIncidentsRemoveDefaultComponent.php | 52 ++- ...2014_12_13_122009_create_session_table.php | 49 ++- ...35117_AlterTableComponentsAddDeletedAt.php | 43 +-- app/database/seeds/ComponentTableSeeder.php | 63 ++-- app/database/seeds/DatabaseSeeder.php | 28 +- app/database/seeds/IncidentTableSeeder.php | 87 ++--- app/database/seeds/SettingsTableSeeder.php | 41 +- app/filters.php | 11 +- app/filters/AllowedDomainsFilter.php | 22 +- app/filters/CORSFilter.php | 7 +- app/filters/HasSettingFilter.php | 6 +- app/filters/IsSetupFilter.php | 6 +- app/helpers.php | 20 +- app/lang/en/cachet.php | 64 ++-- app/lang/en/pagination.php | 28 +- app/lang/en/reminders.php | 34 +- app/lang/en/validation.php | 194 +++++----- app/models/Component.php | 16 +- app/models/Incident.php | 16 +- app/models/IncidentTemplate.php | 8 +- app/models/Metric.php | 12 +- app/models/MetricPoint.php | 6 +- app/models/Service.php | 11 +- app/models/Setting.php | 13 +- app/models/Subscriber.php | 7 +- app/models/User.php | 16 +- app/models/WebHook.php | 34 +- app/models/WebHookResponse.php | 14 +- app/routes/api.php | 6 +- app/routes/app.php | 4 +- app/routes/auth.php | 4 +- app/routes/dashboard.php | 2 +- app/start/artisan.php | 1 - app/start/global.php | 32 +- app/start/local.php | 2 +- .../Api/ComponentControllerTest.php | 46 +-- app/tests/TestCase.php | 27 +- app/view-composers.php | 6 +- bootstrap/autoload.php | 10 +- bootstrap/paths.php | 92 ++--- bootstrap/start.php | 8 +- server.php | 5 +- 103 files changed, 2478 insertions(+), 2353 deletions(-) diff --git a/app/CachetHQ/Cachet/Controllers/Api/ComponentController.php b/app/CachetHQ/Cachet/Controllers/Api/ComponentController.php index e5291edcf..0dcaff471 100644 --- a/app/CachetHQ/Cachet/Controllers/Api/ComponentController.php +++ b/app/CachetHQ/Cachet/Controllers/Api/ComponentController.php @@ -2,56 +2,62 @@ namespace CachetHQ\Cachet\Controllers\Api; -use Input; +use CachetHQ\Cachet\Repositories\Component\ComponentRepository; use Dingo\Api\Routing\ControllerTrait; use Illuminate\Routing\Controller; -use CachetHQ\Cachet\Repositories\Component\ComponentRepository; +use Input; -class ComponentController extends Controller { +class ComponentController extends Controller +{ - use ControllerTrait; + use ControllerTrait; - protected $component; + protected $component; - public function __construct(ComponentRepository $component) { - $this->component = $component; - } + public function __construct(ComponentRepository $component) + { + $this->component = $component; + } - /** - * Get all components - * - * @return \Illuminate\Database\Eloquent\Collection - */ - public function getComponents() { - return $this->component->all(); - } + /** + * Get all components + * + * @return \Illuminate\Database\Eloquent\Collection + */ + public function getComponents() + { + return $this->component->all(); + } - /** - * Get a single component - * - * @param int $id - * - * @return \Component - */ - public function getComponent($id) { - return $this->component->findOrFail($id); - } + /** + * Get a single component + * + * @param int $id + * + * @return \Component + */ + public function getComponent($id) + { + return $this->component->findOrFail($id); + } - /** - * Return a component with incidents - * @param int $id Component ID - * @return \Component - */ - public function getComponentIncidents($id) { - return $this->component->with($id, ['incidents']); - } + /** + * Return a component with incidents + * @param int $id Component ID + * @return \Component + */ + public function getComponentIncidents($id) + { + return $this->component->with($id, ['incidents']); + } - /** - * Create a new component - * - * @return \Component - */ - public function postComponents() { - return $this->component->create($this->auth->user()->id, Input::all()); - } + /** + * Create a new component + * + * @return \Component + */ + public function postComponents() + { + return $this->component->create($this->auth->user()->id, Input::all()); + } } diff --git a/app/CachetHQ/Cachet/Controllers/Api/IncidentController.php b/app/CachetHQ/Cachet/Controllers/Api/IncidentController.php index 18b2bf7a5..ce7328bf2 100644 --- a/app/CachetHQ/Cachet/Controllers/Api/IncidentController.php +++ b/app/CachetHQ/Cachet/Controllers/Api/IncidentController.php @@ -2,18 +2,20 @@ namespace CachetHQ\Cachet\Controllers\Api; -use Input; +use CachetHQ\Cachet\Repositories\Incident\IncidentRepository; use Dingo\Api\Routing\ControllerTrait; use Illuminate\Routing\Controller; -use CachetHQ\Cachet\Repositories\Incident\IncidentRepository; +use Input; -class IncidentController extends Controller { +class IncidentController extends Controller +{ use ControllerTrait; protected $incident; - public function __construct(IncidentRepository $incident) { + public function __construct(IncidentRepository $incident) + { $this->incident = $incident; } @@ -22,7 +24,8 @@ class IncidentController extends Controller { * * @return \Illuminate\Database\Eloquent\Collection */ - public function getIncidents() { + public function getIncidents() + { return $this->incident->all(); } @@ -33,7 +36,8 @@ class IncidentController extends Controller { * * @return Incident */ - public function getIncident($id) { + public function getIncident($id) + { return $this->incident->findOrFail($id); } @@ -42,7 +46,8 @@ class IncidentController extends Controller { * * @return Incident */ - public function postIncidents() { + public function postIncidents() + { return $this->incident->create($this->auth->user()->id, Input::all()); } @@ -53,7 +58,8 @@ class IncidentController extends Controller { * * @return Incident */ - public function putIncident($id) { + public function putIncident($id) + { return $this->incident->update($id, Input::all()); } } diff --git a/app/CachetHQ/Cachet/Controllers/Api/MetricController.php b/app/CachetHQ/Cachet/Controllers/Api/MetricController.php index 6c684279f..b9b90645e 100644 --- a/app/CachetHQ/Cachet/Controllers/Api/MetricController.php +++ b/app/CachetHQ/Cachet/Controllers/Api/MetricController.php @@ -2,18 +2,20 @@ namespace CachetHQ\Cachet\Controllers\Api; -use Input; +use CachetHQ\Cachet\Repositories\Metric\MetricRepository; use Dingo\Api\Routing\ControllerTrait; use Illuminate\Routing\Controller; -use CachetHQ\Cachet\Repositories\Metric\MetricRepository; +use Input; -class MetricController extends Controller { +class MetricController extends Controller +{ use ControllerTrait; protected $metric; - public function __construct(MetricRepository $metric) { + public function __construct(MetricRepository $metric) + { $this->metric = $metric; } /** @@ -21,7 +23,8 @@ class MetricController extends Controller { * * @return \Illuminate\Database\Eloquent\Collection */ - public function getMetrics() { + public function getMetrics() + { return $this->metric->all(); } @@ -32,7 +35,8 @@ class MetricController extends Controller { * * @return Metric */ - public function getMetric($id) { + public function getMetric($id) + { return $this->metric->findOrFail($id); } @@ -41,7 +45,8 @@ class MetricController extends Controller { * * @return Metric */ - public function postMetrics() { + public function postMetrics() + { return $this->metric->create(Input::all()); } @@ -52,7 +57,8 @@ class MetricController extends Controller { * * @return Metric */ - public function putMetric($id) { + public function putMetric($id) + { return $this->metric->update($id, Input::all()); } } diff --git a/app/CachetHQ/Cachet/Controllers/Api/MetricPointController.php b/app/CachetHQ/Cachet/Controllers/Api/MetricPointController.php index a761d2f31..adddefe62 100644 --- a/app/CachetHQ/Cachet/Controllers/Api/MetricPointController.php +++ b/app/CachetHQ/Cachet/Controllers/Api/MetricPointController.php @@ -2,18 +2,20 @@ namespace CachetHQ\Cachet\Controllers\Api; -use Input; +use CachetHQ\Cachet\Repositories\MetricPoint\MetricPointRepository; use Dingo\Api\Routing\ControllerTrait; use Illuminate\Routing\Controller; -use CachetHQ\Cachet\Repositories\MetricPoint\MetricPointRepository; +use Input; -class MetricController extends Controller { +class MetricPointController extends Controller +{ use ControllerTrait; protected $metricpoint; - public function __construct(MetricPointRepository $metricpoint) { + public function __construct(MetricPointRepository $metricpoint) + { $this->metricpoint = $metricpoint; } /** @@ -21,7 +23,8 @@ class MetricController extends Controller { * * @return \Illuminate\Database\Eloquent\Collection */ - public function getMetricPoints() { + public function getMetricPoints() + { return $this->metricpoint->all(); } @@ -32,7 +35,8 @@ class MetricController extends Controller { * * @return MetricPoint */ - public function getMetricPoint($id) { + public function getMetricPoint($id) + { return $this->metricpoint->findOrFail($id); } @@ -41,7 +45,8 @@ class MetricController extends Controller { * * @return MetricPoint */ - public function postMetricPoints() { + public function postMetricPoints() + { return $this->metricpoint->create(Input::all()); } } diff --git a/app/CachetHQ/Cachet/Repositories/Component/ComponentRepository.php b/app/CachetHQ/Cachet/Repositories/Component/ComponentRepository.php index f700e007a..34d54f9a8 100644 --- a/app/CachetHQ/Cachet/Repositories/Component/ComponentRepository.php +++ b/app/CachetHQ/Cachet/Repositories/Component/ComponentRepository.php @@ -2,13 +2,14 @@ namespace CachetHQ\Cachet\Repositories\Component; -interface ComponentRepository { +interface ComponentRepository +{ - public function all(); + public function all(); - public function create($id, array $array); + public function create($id, array $array); - public function findOrFail($id); + public function findOrFail($id); - public function with($id, array $with); + public function with($id, array $with); } diff --git a/app/CachetHQ/Cachet/Repositories/Component/EloquentComponentRepository.php b/app/CachetHQ/Cachet/Repositories/Component/EloquentComponentRepository.php index 0db0b90e3..7a4660740 100644 --- a/app/CachetHQ/Cachet/Repositories/Component/EloquentComponentRepository.php +++ b/app/CachetHQ/Cachet/Repositories/Component/EloquentComponentRepository.php @@ -4,23 +4,26 @@ namespace CachetHQ\Cachet\Repositories\Component; use CachetHQ\Cachet\Repositories\EloquentRepository; use Component; -use Exception; -class EloquentComponentRepository extends EloquentRepository implements ComponentRepository { +class EloquentComponentRepository extends EloquentRepository implements ComponentRepository +{ - protected $model; + protected $model; - public function __construct(Component $model) { - $this->model = $model; - } + public function __construct(Component $model) + { + $this->model = $model; + } - public function create($user_id, array $array) { - $component = new $this->model($array); - $component->user_id = $user_id; + public function create($user_id, array $array) + { + $component = new $this->model($array); + $component->user_id = $user_id; - $this->validate($component); + $this->validate($component); - $component->saveOrFail(); - return $component; - } + $component->saveOrFail(); + + return $component; + } } diff --git a/app/CachetHQ/Cachet/Repositories/EloquentRepository.php b/app/CachetHQ/Cachet/Repositories/EloquentRepository.php index 0a17995c5..79b53ff34 100644 --- a/app/CachetHQ/Cachet/Repositories/EloquentRepository.php +++ b/app/CachetHQ/Cachet/Repositories/EloquentRepository.php @@ -2,119 +2,131 @@ namespace CachetHQ\Cachet\Repositories; -use Illuminate\Database\Eloquent\ModelNotFoundException; use Exception; +use Illuminate\Database\Eloquent\ModelNotFoundException; -abstract class EloquentRepository { +abstract class EloquentRepository +{ - /** - * Returns all models - * @return object - */ - public function all() { - return $this->model->all(); - } + /** + * Returns all models + * @return object + */ + public function all() + { + return $this->model->all(); + } - /** - * Returns an object with related relationships - * @param id $id - * @param array $with Array of model relationships - * @return object|ModelNotFoundException - */ - public function with($id, array $with = []) { - return $this->model->with($with)->findOrFail($id); - } + /** + * Returns an object with related relationships + * @param id $id + * @param array $with Array of model relationships + * @return object|ModelNotFoundException + */ + public function with($id, array $with = []) + { + return $this->model->with($with)->findOrFail($id); + } - /** - * Sets the model to query against a user id - * @param integer $id - * @param string $column - * @return $this - */ - public function withAuth($id, $column = 'user_id') { - $this->model = $this->model->where($column, $id); - return $this; - } + /** + * Sets the model to query against a user id + * @param integer $id + * @param string $column + * @return $this + */ + public function withAuth($id, $column = 'user_id') + { + $this->model = $this->model->where($column, $id); - /** - * Finds a model by ID - * @param int $id - * @return object - */ - public function find(int $id) { - return $this->model->find($id); - } + return $this; + } - /** - * Finds a model by ID - * @param integer $id - * @return object|ModelNotFoundException - */ - public function findOrFail($id) { - return $this->model->findOrFail($id); - } + /** + * Finds a model by ID + * @param int $id + * @return object + */ + public function find(int $id) + { + return $this->model->find($id); + } - /** - * Finds a model by type - * @param string $key - * @param string $value - * @param array $columns - * @return object|ModelNotFoundException - */ - public function findByOrFail($key, $value, $columns = ['*']) { - if (! is_null($item = $this->model->where($key, $value)->first($columns))) { - return $item; - } + /** + * Finds a model by ID + * @param integer $id + * @return object|ModelNotFoundException + */ + public function findOrFail($id) + { + return $this->model->findOrFail($id); + } - throw new ModelNotFoundException; - } + /** + * Finds a model by type + * @param string $key + * @param string $value + * @param array $columns + * @return object|ModelNotFoundException + */ + public function findByOrFail($key, $value, $columns = ['*']) + { + if (! is_null($item = $this->model->where($key, $value)->first($columns))) { + return $item; + } - /** - * Counts the number of rows returned - * @param string $key - * @param string $value - * @return integer - */ - public function count($key = null, $value = null) { - if (is_null($key) || is_null($value)) { - return $this->model->where($key, $value)->count(); - } + throw new ModelNotFoundException(); + } - return $this->model->count(); - } + /** + * Counts the number of rows returned + * @param string $key + * @param string $value + * @return integer + */ + public function count($key = null, $value = null) + { + if (is_null($key) || is_null($value)) { + return $this->model->where($key, $value)->count(); + } - /** - * Deletes a model by ID - * @param inetegr $id - */ - public function destroy($id) { - $this->model->delete($id); - } + return $this->model->count(); + } - /** - * Validate a given model with Watson validation - * @param object $model - * @return Exception - */ - public function validate($model) { - if ($model->isInvalid()) { - throw new Exception('Invalid model validation'); - } + /** + * Deletes a model by ID + * @param inetegr $id + */ + public function destroy($id) + { + $this->model->delete($id); + } - return $this; - } + /** + * Validate a given model with Watson validation + * @param object $model + * @return Exception + */ + public function validate($model) + { + if ($model->isInvalid()) { + throw new Exception('Invalid model validation'); + } - /** - * Validate whether a model has a correct relationship - * @param object $model - * @param string $relationship Name of the relationship to validate against - * @return Exception - */ - public function hasRelationship($model, $relationship) { - if (! $model->$relationship) { - throw new Exception('Invalid relationship exception'); - } + return $this; + } - return $this; - } + /** + * Validate whether a model has a correct relationship + * @param object $model + * @param string $relationship Name of the relationship to validate against + * @return Exception + */ + public function hasRelationship($model, $relationship) + { + if (! $model->$relationship) { + throw new Exception('Invalid relationship exception'); + } + + return $this; + } } diff --git a/app/CachetHQ/Cachet/Repositories/Incident/EloquentIncidentRepository.php b/app/CachetHQ/Cachet/Repositories/Incident/EloquentIncidentRepository.php index 946457e8b..2e8c750bc 100644 --- a/app/CachetHQ/Cachet/Repositories/Incident/EloquentIncidentRepository.php +++ b/app/CachetHQ/Cachet/Repositories/Incident/EloquentIncidentRepository.php @@ -5,31 +5,37 @@ namespace CachetHQ\Cachet\Repositories\Incident; use CachetHQ\Cachet\Repositories\EloquentRepository; use Incident; -class EloquentIncidentRepository extends EloquentRepository implements IncidentRepository { +class EloquentIncidentRepository extends EloquentRepository implements IncidentRepository +{ - protected $model; + protected $model; - public function __construct(Incident $model) { - $this->model = $model; - } + public function __construct(Incident $model) + { + $this->model = $model; + } - public function create($user_id, array $array) { - $incident = new $this->model($array); - $incident->user_id = $user_id; + public function create($user_id, array $array) + { + $incident = new $this->model($array); + $incident->user_id = $user_id; - $this->validate($incident)->hasRelationship($incident, 'component'); + $this->validate($incident)->hasRelationship($incident, 'component'); - $incident->saveOrFail(); - return $incident; - } + $incident->saveOrFail(); - public function update($id, array $array) { - $incident = $this->model->findOrFail($id); - $incident->fill($array); + return $incident; + } - $this->validate($incident)->hasRelationship($incident, 'component'); + public function update($id, array $array) + { + $incident = $this->model->findOrFail($id); + $incident->fill($array); - $incident->update($array); - return $incident; - } + $this->validate($incident)->hasRelationship($incident, 'component'); + + $incident->update($array); + + return $incident; + } } diff --git a/app/CachetHQ/Cachet/Repositories/Incident/IncidentRepository.php b/app/CachetHQ/Cachet/Repositories/Incident/IncidentRepository.php index 3564146a0..6e6098690 100644 --- a/app/CachetHQ/Cachet/Repositories/Incident/IncidentRepository.php +++ b/app/CachetHQ/Cachet/Repositories/Incident/IncidentRepository.php @@ -2,13 +2,14 @@ namespace CachetHQ\Cachet\Repositories\Incident; -interface IncidentRepository { +interface IncidentRepository +{ - public function all(); + public function all(); - public function create($id, array $array); + public function create($id, array $array); - public function findOrFail($id); + public function findOrFail($id); - public function update($id, array $with); + public function update($id, array $with); } diff --git a/app/CachetHQ/Cachet/Repositories/Metric/EloquentMetricRepository.php b/app/CachetHQ/Cachet/Repositories/Metric/EloquentMetricRepository.php index 035be1ff4..e49ed8c23 100644 --- a/app/CachetHQ/Cachet/Repositories/Metric/EloquentMetricRepository.php +++ b/app/CachetHQ/Cachet/Repositories/Metric/EloquentMetricRepository.php @@ -5,30 +5,36 @@ namespace CachetHQ\Cachet\Repositories\Metric; use CachetHQ\Cachet\Repositories\EloquentRepository; use Metric; -class EloquentMetricRepository extends EloquentRepository implements MetricRepository { +class EloquentMetricRepository extends EloquentRepository implements MetricRepository +{ - protected $model; + protected $model; - public function __construct(Metric $model) { - $this->model = $model; - } + public function __construct(Metric $model) + { + $this->model = $model; + } - public function create(array $array) { - $metric = new $this->model($array); + public function create(array $array) + { + $metric = new $this->model($array); - $this->validate($metric); + $this->validate($metric); - $metric->saveOrFail(); - return $metric; - } + $metric->saveOrFail(); - public function update($id, array $array) { - $metric = $this->model->findOrFail($id); - $metric->fill($array); + return $metric; + } - $this->validate($metric); + public function update($id, array $array) + { + $metric = $this->model->findOrFail($id); + $metric->fill($array); - $metric->update($array); - return $metric; - } + $this->validate($metric); + + $metric->update($array); + + return $metric; + } } diff --git a/app/CachetHQ/Cachet/Repositories/Metric/MetricRepository.php b/app/CachetHQ/Cachet/Repositories/Metric/MetricRepository.php index 9ae376e91..dd981d507 100644 --- a/app/CachetHQ/Cachet/Repositories/Metric/MetricRepository.php +++ b/app/CachetHQ/Cachet/Repositories/Metric/MetricRepository.php @@ -2,13 +2,14 @@ namespace CachetHQ\Cachet\Repositories\Metric; -interface MetricRepository { +interface MetricRepository +{ - public function all(); + public function all(); - public function create(array $array); + public function create(array $array); - public function findOrFail($id); + public function findOrFail($id); - public function update($id, array $with); + public function update($id, array $with); } diff --git a/app/CachetHQ/Cachet/Repositories/MetricPoint/EloquentMetricPointRepository.php b/app/CachetHQ/Cachet/Repositories/MetricPoint/EloquentMetricPointRepository.php index 09e261dfe..cda39f5c0 100644 --- a/app/CachetHQ/Cachet/Repositories/MetricPoint/EloquentMetricPointRepository.php +++ b/app/CachetHQ/Cachet/Repositories/MetricPoint/EloquentMetricPointRepository.php @@ -5,30 +5,36 @@ namespace CachetHQ\Cachet\Repositories\MetricPoint; use CachetHQ\Cachet\Repositories\EloquentRepository; use MetricPoint; -class EloquentMetricRepository extends EloquentRepository implements MetricRepository { +class EloquentMetricPointRepository extends EloquentRepository implements MetricRepository +{ - protected $model; + protected $model; - public function __construct(MetricPoint $model) { - $this->model = $model; - } + public function __construct(MetricPoint $model) + { + $this->model = $model; + } - public function create(array $array) { - $metric = new $this->model($array); + public function create(array $array) + { + $metric = new $this->model($array); - $this->validate($metric); + $this->validate($metric); - $metric->saveOrFail(); - return $metric; - } + $metric->saveOrFail(); - public function update($id, array $array) { - $metric = $this->model->findOrFail($id); - $metric->fill($array); + return $metric; + } - $this->validate($metric); + public function update($id, array $array) + { + $metric = $this->model->findOrFail($id); + $metric->fill($array); - $metric->update($array); - return $metric; - } + $this->validate($metric); + + $metric->update($array); + + return $metric; + } } diff --git a/app/CachetHQ/Cachet/Repositories/MetricPoint/MetricPointRepository.php b/app/CachetHQ/Cachet/Repositories/MetricPoint/MetricPointRepository.php index 0c30663b1..7b6681f01 100644 --- a/app/CachetHQ/Cachet/Repositories/MetricPoint/MetricPointRepository.php +++ b/app/CachetHQ/Cachet/Repositories/MetricPoint/MetricPointRepository.php @@ -2,13 +2,14 @@ namespace CachetHQ\Cachet\Repositories\MetricPoint; -interface MetricPointRepository { +interface MetricPointRepository +{ - public function all(); + public function all(); - public function create(array $array); + public function create(array $array); - public function findOrFail($id); + public function findOrFail($id); - public function update($id, array $with); + public function update($id, array $with); } diff --git a/app/CachetHQ/Cachet/Service/EmailService.php b/app/CachetHQ/Cachet/Service/EmailService.php index 626342402..acb13a954 100644 --- a/app/CachetHQ/Cachet/Service/EmailService.php +++ b/app/CachetHQ/Cachet/Service/EmailService.php @@ -2,18 +2,19 @@ namespace CachetHQ\Cachet\Service\Email; -class EmailService implements ServiceInterface { +class EmailService implements ServiceInterface +{ protected $properties; - public function register() { - + public function register() + { } - public function unregister() { - + public function unregister() + { } - public function fire($data) { - + public function fire($data) + { } } diff --git a/app/CachetHQ/Cachet/Service/ServiceInterface.php b/app/CachetHQ/Cachet/Service/ServiceInterface.php index 45d2f4763..da0c59f90 100644 --- a/app/CachetHQ/Cachet/Service/ServiceInterface.php +++ b/app/CachetHQ/Cachet/Service/ServiceInterface.php @@ -2,7 +2,8 @@ namespace CachetHQ\Cachet\Service; -interface ServiceInterface { +interface ServiceInterface +{ public function register(); public function unregister(); public function fire($data); diff --git a/app/CachetHQ/Cachet/Support/ServiceProviders/RepositoryServiceProvider.php b/app/CachetHQ/Cachet/Support/ServiceProviders/RepositoryServiceProvider.php index 598efcde5..c193b5d3a 100644 --- a/app/CachetHQ/Cachet/Support/ServiceProviders/RepositoryServiceProvider.php +++ b/app/CachetHQ/Cachet/Support/ServiceProviders/RepositoryServiceProvider.php @@ -4,19 +4,21 @@ namespace CachetHQ\Cachet\Support\ServiceProviders; use Illuminate\Support\ServiceProvider; -class RepositoryServiceProvider extends ServiceProvider { - public function register() { - $this->app->bind( - 'CachetHQ\Cachet\Repositories\Component\ComponentRepository', - 'CachetHQ\Cachet\Repositories\Component\EloquentComponentRepository' - ); - $this->app->bind( - 'CachetHQ\Cachet\Repositories\Incident\IncidentRepository', - 'CachetHQ\Cachet\Repositories\Incident\EloquentIncidentRepository' - ); - $this->app->bind( - 'CachetHQ\Cachet\Repositories\Metric\MetricRepository', - 'CachetHQ\Cachet\Repositories\Metric\EloquentMetricRepository' - ); - } +class RepositoryServiceProvider extends ServiceProvider +{ + public function register() + { + $this->app->bind( + 'CachetHQ\Cachet\Repositories\Component\ComponentRepository', + 'CachetHQ\Cachet\Repositories\Component\EloquentComponentRepository' + ); + $this->app->bind( + 'CachetHQ\Cachet\Repositories\Incident\IncidentRepository', + 'CachetHQ\Cachet\Repositories\Incident\EloquentIncidentRepository' + ); + $this->app->bind( + 'CachetHQ\Cachet\Repositories\Metric\MetricRepository', + 'CachetHQ\Cachet\Repositories\Metric\EloquentMetricRepository' + ); + } } diff --git a/app/CachetHQ/Cachet/Support/ServiceProviders/RoutingServiceProvider.php b/app/CachetHQ/Cachet/Support/ServiceProviders/RoutingServiceProvider.php index 6cc443515..b48b17590 100644 --- a/app/CachetHQ/Cachet/Support/ServiceProviders/RoutingServiceProvider.php +++ b/app/CachetHQ/Cachet/Support/ServiceProviders/RoutingServiceProvider.php @@ -5,31 +5,35 @@ namespace CachetHQ\Cachet\Support\ServiceProviders; use Illuminate\Support\ServiceProvider; use RecursiveDirectoryIterator; -class RoutingServiceProvider extends ServiceProvider { +class RoutingServiceProvider extends ServiceProvider +{ - public function register() {} + public function register() + { + } - public function boot() { - $this->routesInDirectory(); - } + public function boot() + { + $this->routesInDirectory(); + } - /** - * Organise Routes - * @param string $app - */ - private function routesInDirectory($app = '') { - $routeDir = app_path('routes/' . $app . ($app !== '' ? '/' : null)); + /** + * Organise Routes + * @param string $app + */ + private function routesInDirectory($app = '') + { + $routeDir = app_path('routes/'.$app.($app !== '' ? '/' : null)); - $iterator = new RecursiveDirectoryIterator($routeDir); - $iterator->setFlags(RecursiveDirectoryIterator::SKIP_DOTS); + $iterator = new RecursiveDirectoryIterator($routeDir); + $iterator->setFlags(RecursiveDirectoryIterator::SKIP_DOTS); - foreach ($iterator as $route) { - $isDotFile = strpos($route->getFilename(), '.') === 0; - - if (!$isDotFile && !$route->isDir()) { - require $routeDir . $route->getFilename(); - } - } - } + foreach ($iterator as $route) { + $isDotFile = strpos($route->getFilename(), '.') === 0; + if (!$isDotFile && !$route->isDir()) { + require $routeDir.$route->getFilename(); + } + } + } } diff --git a/app/CachetHQ/Cachet/Transformers/ComponentTransformer.php b/app/CachetHQ/Cachet/Transformers/ComponentTransformer.php index 44e49abb9..962b07c95 100644 --- a/app/CachetHQ/Cachet/Transformers/ComponentTransformer.php +++ b/app/CachetHQ/Cachet/Transformers/ComponentTransformer.php @@ -5,9 +5,11 @@ namespace CachetHQ\Cachet\Transformers; use Component; use League\Fractal\TransformerAbstract; -class ComponentTransformer extends TransformerAbstract { +class ComponentTransformer extends TransformerAbstract +{ - public function transform(Component $component) { + public function transform(Component $component) + { return [ 'id' => (int) $component->id, 'name' => $component->name, @@ -19,5 +21,4 @@ class ComponentTransformer extends TransformerAbstract { 'updated_at' => $component->updated_at->timestamp, ]; } - } diff --git a/app/CachetHQ/Cachet/Transformers/IncidentTransformer.php b/app/CachetHQ/Cachet/Transformers/IncidentTransformer.php index 1882f8797..32bbd55e4 100644 --- a/app/CachetHQ/Cachet/Transformers/IncidentTransformer.php +++ b/app/CachetHQ/Cachet/Transformers/IncidentTransformer.php @@ -5,9 +5,11 @@ namespace CachetHQ\Cachet\Transformers; use Incident; use League\Fractal\TransformerAbstract; -class IncidentTransformer extends TransformerAbstract { +class IncidentTransformer extends TransformerAbstract +{ - public function transform(Incident $incident) { + public function transform(Incident $incident) + { $component = $incident->component; $transformer = $component->getTransformer(); diff --git a/app/CachetHQ/Cachet/Transformers/MetricPointTransformer.php b/app/CachetHQ/Cachet/Transformers/MetricPointTransformer.php index 0be36d23b..fc20a112a 100644 --- a/app/CachetHQ/Cachet/Transformers/MetricPointTransformer.php +++ b/app/CachetHQ/Cachet/Transformers/MetricPointTransformer.php @@ -2,12 +2,14 @@ namespace CachetHQ\Cachet\Transformers; -use MetricPoint; use League\Fractal\TransformerAbstract; +use MetricPoint; -class MetricPointTransformer extends TransformerAbstract { +class MetricPointTransformer extends TransformerAbstract +{ - public function transform(MetricPoint $metricPoint) { + public function transform(MetricPoint $metricPoint) + { return [ 'id' => (int) $metricPoint->id, 'metric_id' => $metricPoint->metric_id, @@ -16,5 +18,4 @@ class MetricPointTransformer extends TransformerAbstract { 'updated_at' => $metricPoint->updated_at->timestamp, ]; } - } diff --git a/app/CachetHQ/Cachet/Transformers/MetricTransformer.php b/app/CachetHQ/Cachet/Transformers/MetricTransformer.php index da4fc1113..098827560 100644 --- a/app/CachetHQ/Cachet/Transformers/MetricTransformer.php +++ b/app/CachetHQ/Cachet/Transformers/MetricTransformer.php @@ -2,12 +2,14 @@ namespace CachetHQ\Cachet\Transformers; -use Metric; use League\Fractal\TransformerAbstract; +use Metric; -class MetricTransformer extends TransformerAbstract { +class MetricTransformer extends TransformerAbstract +{ - public function transform(Metric $metric) { + public function transform(Metric $metric) + { return [ 'id' => (int) $metric->id, 'name' => $metric->name, @@ -18,5 +20,4 @@ class MetricTransformer extends TransformerAbstract { 'updated_at' => $metric->updated_at->timestamp, ]; } - } diff --git a/app/config/app.php b/app/config/app.php index ff0fafd16..abbc4d159 100644 --- a/app/config/app.php +++ b/app/config/app.php @@ -1,204 +1,204 @@ false, + 'debug' => false, - /* - |-------------------------------------------------------------------------- - | Application URL - |-------------------------------------------------------------------------- - | - | This URL is used by the console to properly generate URLs when using - | the Artisan command line tool. You should set this to the root of - | your application so that it is used when running Artisan tasks. - | - */ + /* + |-------------------------------------------------------------------------- + | Application URL + |-------------------------------------------------------------------------- + | + | This URL is used by the console to properly generate URLs when using + | the Artisan command line tool. You should set this to the root of + | your application so that it is used when running Artisan tasks. + | + */ - 'url' => 'http://localhost', + 'url' => 'http://localhost', - /* - |-------------------------------------------------------------------------- - | Application Timezone - |-------------------------------------------------------------------------- - | - | Here you may specify the default timezone for your application, which - | will be used by the PHP date and date-time functions. We have gone - | ahead and set this to a sensible default for you out of the box. - | - */ + /* + |-------------------------------------------------------------------------- + | Application Timezone + |-------------------------------------------------------------------------- + | + | Here you may specify the default timezone for your application, which + | will be used by the PHP date and date-time functions. We have gone + | ahead and set this to a sensible default for you out of the box. + | + */ - 'timezone' => 'UTC', + 'timezone' => 'UTC', - /* - |-------------------------------------------------------------------------- - | Application Locale Configuration - |-------------------------------------------------------------------------- - | - | The application locale determines the default locale that will be used - | by the translation service provider. You are free to set this value - | to any of the locales which will be supported by the application. - | - */ + /* + |-------------------------------------------------------------------------- + | Application Locale Configuration + |-------------------------------------------------------------------------- + | + | The application locale determines the default locale that will be used + | by the translation service provider. You are free to set this value + | to any of the locales which will be supported by the application. + | + */ - 'locale' => 'en', + 'locale' => 'en', - /* - |-------------------------------------------------------------------------- - | Application Fallback Locale - |-------------------------------------------------------------------------- - | - | The fallback locale determines the locale to use when the current one - | is not available. You may change the value to correspond to any of - | the language folders that are provided through your application. - | - */ + /* + |-------------------------------------------------------------------------- + | Application Fallback Locale + |-------------------------------------------------------------------------- + | + | The fallback locale determines the locale to use when the current one + | is not available. You may change the value to correspond to any of + | the language folders that are provided through your application. + | + */ - 'fallback_locale' => 'en', + 'fallback_locale' => 'en', - /* - |-------------------------------------------------------------------------- - | Encryption Key - |-------------------------------------------------------------------------- - | - | This key is used by the Illuminate encrypter service and should be set - | to a random, 32 character string, otherwise these encrypted strings - | will not be safe. Please do this before deploying an application! - | - */ + /* + |-------------------------------------------------------------------------- + | Encryption Key + |-------------------------------------------------------------------------- + | + | This key is used by the Illuminate encrypter service and should be set + | to a random, 32 character string, otherwise these encrypted strings + | will not be safe. Please do this before deploying an application! + | + */ - 'key' => 'kCifbUiHYswooAvSZBQjWZVY1S6aBdnD', + 'key' => 'kCifbUiHYswooAvSZBQjWZVY1S6aBdnD', - 'cipher' => MCRYPT_RIJNDAEL_128, + 'cipher' => MCRYPT_RIJNDAEL_128, - /* - |-------------------------------------------------------------------------- - | Autoloaded Service Providers - |-------------------------------------------------------------------------- - | - | The service providers listed here will be automatically loaded on the - | request to your application. Feel free to add your own services to - | this array to grant expanded functionality to your applications. - | - */ + /* + |-------------------------------------------------------------------------- + | Autoloaded Service Providers + |-------------------------------------------------------------------------- + | + | The service providers listed here will be automatically loaded on the + | request to your application. Feel free to add your own services to + | this array to grant expanded functionality to your applications. + | + */ - 'providers' => array( + 'providers' => [ - 'Illuminate\Foundation\Providers\ArtisanServiceProvider', - 'Illuminate\Auth\AuthServiceProvider', - 'Illuminate\Cache\CacheServiceProvider', - 'Illuminate\Session\CommandsServiceProvider', - 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider', - 'Illuminate\Routing\ControllerServiceProvider', - 'Illuminate\Cookie\CookieServiceProvider', - 'Illuminate\Database\DatabaseServiceProvider', - 'Illuminate\Encryption\EncryptionServiceProvider', - 'Illuminate\Filesystem\FilesystemServiceProvider', - 'Illuminate\Hashing\HashServiceProvider', - 'Illuminate\Html\HtmlServiceProvider', - 'Illuminate\Log\LogServiceProvider', - 'Illuminate\Mail\MailServiceProvider', - 'Illuminate\Database\MigrationServiceProvider', - 'Illuminate\Pagination\PaginationServiceProvider', - 'Illuminate\Queue\QueueServiceProvider', - 'Illuminate\Redis\RedisServiceProvider', - 'Illuminate\Remote\RemoteServiceProvider', - 'Illuminate\Auth\Reminders\ReminderServiceProvider', - 'Illuminate\Database\SeedServiceProvider', - 'Illuminate\Session\SessionServiceProvider', - 'Illuminate\Translation\TranslationServiceProvider', - 'Illuminate\Validation\ValidationServiceProvider', - 'Illuminate\View\ViewServiceProvider', - 'Illuminate\Workbench\WorkbenchServiceProvider', + 'Illuminate\Foundation\Providers\ArtisanServiceProvider', + 'Illuminate\Auth\AuthServiceProvider', + 'Illuminate\Cache\CacheServiceProvider', + 'Illuminate\Session\CommandsServiceProvider', + 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider', + 'Illuminate\Routing\ControllerServiceProvider', + 'Illuminate\Cookie\CookieServiceProvider', + 'Illuminate\Database\DatabaseServiceProvider', + 'Illuminate\Encryption\EncryptionServiceProvider', + 'Illuminate\Filesystem\FilesystemServiceProvider', + 'Illuminate\Hashing\HashServiceProvider', + 'Illuminate\Html\HtmlServiceProvider', + 'Illuminate\Log\LogServiceProvider', + 'Illuminate\Mail\MailServiceProvider', + 'Illuminate\Database\MigrationServiceProvider', + 'Illuminate\Pagination\PaginationServiceProvider', + 'Illuminate\Queue\QueueServiceProvider', + 'Illuminate\Redis\RedisServiceProvider', + 'Illuminate\Remote\RemoteServiceProvider', + 'Illuminate\Auth\Reminders\ReminderServiceProvider', + 'Illuminate\Database\SeedServiceProvider', + 'Illuminate\Session\SessionServiceProvider', + 'Illuminate\Translation\TranslationServiceProvider', + 'Illuminate\Validation\ValidationServiceProvider', + 'Illuminate\View\ViewServiceProvider', + 'Illuminate\Workbench\WorkbenchServiceProvider', - 'Dingo\Api\Provider\ApiServiceProvider', - 'Thujohn\Rss\RssServiceProvider', + 'Dingo\Api\Provider\ApiServiceProvider', + 'Thujohn\Rss\RssServiceProvider', - 'CachetHQ\Cachet\Support\ServiceProviders\RepositoryServiceProvider', - 'CachetHQ\Cachet\Support\ServiceProviders\RoutingServiceProvider', - - ), + 'CachetHQ\Cachet\Support\ServiceProviders\RepositoryServiceProvider', + 'CachetHQ\Cachet\Support\ServiceProviders\RoutingServiceProvider', - /* - |-------------------------------------------------------------------------- - | Service Provider Manifest - |-------------------------------------------------------------------------- - | - | The service provider manifest is used by Laravel to lazy load service - | providers which are not needed for each request, as well to keep a - | list of all of the services. Here, you may set its storage spot. - | - */ + ], - 'manifest' => storage_path().'/meta', + /* + |-------------------------------------------------------------------------- + | Service Provider Manifest + |-------------------------------------------------------------------------- + | + | The service provider manifest is used by Laravel to lazy load service + | providers which are not needed for each request, as well to keep a + | list of all of the services. Here, you may set its storage spot. + | + */ - /* - |-------------------------------------------------------------------------- - | Class Aliases - |-------------------------------------------------------------------------- - | - | This array of class aliases will be registered when this application - | is started. However, feel free to register as many as you wish as - | the aliases are "lazy" loaded so they don't hinder performance. - | - */ + 'manifest' => storage_path().'/meta', - 'aliases' => array( + /* + |-------------------------------------------------------------------------- + | Class Aliases + |-------------------------------------------------------------------------- + | + | This array of class aliases will be registered when this application + | is started. However, feel free to register as many as you wish as + | the aliases are "lazy" loaded so they don't hinder performance. + | + */ - 'App' => 'Illuminate\Support\Facades\App', - 'Artisan' => 'Illuminate\Support\Facades\Artisan', - 'Auth' => 'Illuminate\Support\Facades\Auth', - 'Blade' => 'Illuminate\Support\Facades\Blade', - 'Cache' => 'Illuminate\Support\Facades\Cache', - 'Carbon' => 'Carbon\Carbon', - 'ClassLoader' => 'Illuminate\Support\ClassLoader', - 'Config' => 'Illuminate\Support\Facades\Config', - 'Controller' => 'Illuminate\Routing\Controller', - 'Cookie' => 'Illuminate\Support\Facades\Cookie', - 'Crypt' => 'Illuminate\Support\Facades\Crypt', - 'DB' => 'Illuminate\Support\Facades\DB', - 'Eloquent' => 'Illuminate\Database\Eloquent\Model', - 'Event' => 'Illuminate\Support\Facades\Event', - 'File' => 'Illuminate\Support\Facades\File', - 'Form' => 'Illuminate\Support\Facades\Form', - 'Hash' => 'Illuminate\Support\Facades\Hash', - 'HTML' => 'Illuminate\Support\Facades\HTML', - 'Input' => 'Illuminate\Support\Facades\Input', - 'Lang' => 'Illuminate\Support\Facades\Lang', - 'Log' => 'Illuminate\Support\Facades\Log', - 'Mail' => 'Illuminate\Support\Facades\Mail', - 'Paginator' => 'Illuminate\Support\Facades\Paginator', - 'Password' => 'Illuminate\Support\Facades\Password', - 'Queue' => 'Illuminate\Support\Facades\Queue', - 'Redirect' => 'Illuminate\Support\Facades\Redirect', - 'Redis' => 'Illuminate\Support\Facades\Redis', - 'Request' => 'Illuminate\Support\Facades\Request', - 'Response' => 'Illuminate\Support\Facades\Response', - 'Route' => 'Illuminate\Support\Facades\Route', - 'Schema' => 'Illuminate\Support\Facades\Schema', - 'Seeder' => 'Illuminate\Database\Seeder', - 'Session' => 'Illuminate\Support\Facades\Session', - 'SoftDeletingTrait' => 'Illuminate\Database\Eloquent\SoftDeletingTrait', - 'SSH' => 'Illuminate\Support\Facades\SSH', - 'Str' => 'Illuminate\Support\Str', - 'URL' => 'Illuminate\Support\Facades\URL', - 'Validator' => 'Illuminate\Support\Facades\Validator', - 'View' => 'Illuminate\Support\Facades\View', + 'aliases' => [ - 'API' => 'Dingo\Api\Facade\API', - 'RSS' => 'Thujohn\Rss\RssFacade', + 'App' => 'Illuminate\Support\Facades\App', + 'Artisan' => 'Illuminate\Support\Facades\Artisan', + 'Auth' => 'Illuminate\Support\Facades\Auth', + 'Blade' => 'Illuminate\Support\Facades\Blade', + 'Cache' => 'Illuminate\Support\Facades\Cache', + 'Carbon' => 'Carbon\Carbon', + 'ClassLoader' => 'Illuminate\Support\ClassLoader', + 'Config' => 'Illuminate\Support\Facades\Config', + 'Controller' => 'Illuminate\Routing\Controller', + 'Cookie' => 'Illuminate\Support\Facades\Cookie', + 'Crypt' => 'Illuminate\Support\Facades\Crypt', + 'DB' => 'Illuminate\Support\Facades\DB', + 'Eloquent' => 'Illuminate\Database\Eloquent\Model', + 'Event' => 'Illuminate\Support\Facades\Event', + 'File' => 'Illuminate\Support\Facades\File', + 'Form' => 'Illuminate\Support\Facades\Form', + 'Hash' => 'Illuminate\Support\Facades\Hash', + 'HTML' => 'Illuminate\Support\Facades\HTML', + 'Input' => 'Illuminate\Support\Facades\Input', + 'Lang' => 'Illuminate\Support\Facades\Lang', + 'Log' => 'Illuminate\Support\Facades\Log', + 'Mail' => 'Illuminate\Support\Facades\Mail', + 'Paginator' => 'Illuminate\Support\Facades\Paginator', + 'Password' => 'Illuminate\Support\Facades\Password', + 'Queue' => 'Illuminate\Support\Facades\Queue', + 'Redirect' => 'Illuminate\Support\Facades\Redirect', + 'Redis' => 'Illuminate\Support\Facades\Redis', + 'Request' => 'Illuminate\Support\Facades\Request', + 'Response' => 'Illuminate\Support\Facades\Response', + 'Route' => 'Illuminate\Support\Facades\Route', + 'Schema' => 'Illuminate\Support\Facades\Schema', + 'Seeder' => 'Illuminate\Database\Seeder', + 'Session' => 'Illuminate\Support\Facades\Session', + 'SoftDeletingTrait' => 'Illuminate\Database\Eloquent\SoftDeletingTrait', + 'SSH' => 'Illuminate\Support\Facades\SSH', + 'Str' => 'Illuminate\Support\Str', + 'URL' => 'Illuminate\Support\Facades\URL', + 'Validator' => 'Illuminate\Support\Facades\Validator', + 'View' => 'Illuminate\Support\Facades\View', - ), + 'API' => 'Dingo\Api\Facade\API', + 'RSS' => 'Thujohn\Rss\RssFacade', -); + ], + +]; diff --git a/app/config/auth.php b/app/config/auth.php index eacbbfaed..63c84908d 100644 --- a/app/config/auth.php +++ b/app/config/auth.php @@ -1,71 +1,71 @@ 'eloquent', + 'driver' => 'eloquent', - /* - |-------------------------------------------------------------------------- - | Authentication Model - |-------------------------------------------------------------------------- - | - | When using the "Eloquent" authentication driver, we need to know which - | Eloquent model should be used to retrieve your users. Of course, it - | is often just the "User" model but you may use whatever you like. - | - */ + /* + |-------------------------------------------------------------------------- + | Authentication Model + |-------------------------------------------------------------------------- + | + | When using the "Eloquent" authentication driver, we need to know which + | Eloquent model should be used to retrieve your users. Of course, it + | is often just the "User" model but you may use whatever you like. + | + */ - 'model' => 'User', + 'model' => 'User', - /* - |-------------------------------------------------------------------------- - | Authentication Table - |-------------------------------------------------------------------------- - | - | When using the "Database" authentication driver, we need to know which - | table should be used to retrieve your users. We have chosen a basic - | default value but you may easily change it to any table you like. - | - */ + /* + |-------------------------------------------------------------------------- + | Authentication Table + |-------------------------------------------------------------------------- + | + | When using the "Database" authentication driver, we need to know which + | table should be used to retrieve your users. We have chosen a basic + | default value but you may easily change it to any table you like. + | + */ - 'table' => 'users', + 'table' => 'users', - /* - |-------------------------------------------------------------------------- - | Password Reminder Settings - |-------------------------------------------------------------------------- - | - | Here you may set the settings for password reminders, including a view - | that should be used as your password reminder e-mail. You will also - | be able to set the name of the table that holds the reset tokens. - | - | The "expire" time is the number of minutes that the reminder should be - | considered valid. This security feature keeps tokens short-lived so - | they have less time to be guessed. You may change this as needed. - | - */ + /* + |-------------------------------------------------------------------------- + | Password Reminder Settings + |-------------------------------------------------------------------------- + | + | Here you may set the settings for password reminders, including a view + | that should be used as your password reminder e-mail. You will also + | be able to set the name of the table that holds the reset tokens. + | + | The "expire" time is the number of minutes that the reminder should be + | considered valid. This security feature keeps tokens short-lived so + | they have less time to be guessed. You may change this as needed. + | + */ - 'reminder' => array( + 'reminder' => [ - 'email' => 'emails.auth.reminder', + 'email' => 'emails.auth.reminder', - 'table' => 'password_reminders', + 'table' => 'password_reminders', - 'expire' => 60, + 'expire' => 60, - ), + ], -); +]; diff --git a/app/config/cache.php b/app/config/cache.php index ce8984239..ee54b62db 100644 --- a/app/config/cache.php +++ b/app/config/cache.php @@ -1,89 +1,89 @@ 'file', + 'driver' => 'file', - /* - |-------------------------------------------------------------------------- - | File Cache Location - |-------------------------------------------------------------------------- - | - | When using the "file" cache driver, we need a location where the cache - | files may be stored. A sensible default has been specified, but you - | are free to change it to any other place on disk that you desire. - | - */ + /* + |-------------------------------------------------------------------------- + | File Cache Location + |-------------------------------------------------------------------------- + | + | When using the "file" cache driver, we need a location where the cache + | files may be stored. A sensible default has been specified, but you + | are free to change it to any other place on disk that you desire. + | + */ - 'path' => storage_path().'/cache', + 'path' => storage_path().'/cache', - /* - |-------------------------------------------------------------------------- - | Database Cache Connection - |-------------------------------------------------------------------------- - | - | When using the "database" cache driver you may specify the connection - | that should be used to store the cached items. When this option is - | null the default database connection will be utilized for cache. - | - */ + /* + |-------------------------------------------------------------------------- + | Database Cache Connection + |-------------------------------------------------------------------------- + | + | When using the "database" cache driver you may specify the connection + | that should be used to store the cached items. When this option is + | null the default database connection will be utilized for cache. + | + */ - 'connection' => null, + 'connection' => null, - /* - |-------------------------------------------------------------------------- - | Database Cache Table - |-------------------------------------------------------------------------- - | - | When using the "database" cache driver we need to know the table that - | should be used to store the cached items. A default table name has - | been provided but you're free to change it however you deem fit. - | - */ + /* + |-------------------------------------------------------------------------- + | Database Cache Table + |-------------------------------------------------------------------------- + | + | When using the "database" cache driver we need to know the table that + | should be used to store the cached items. A default table name has + | been provided but you're free to change it however you deem fit. + | + */ - 'table' => 'cache', + 'table' => 'cache', - /* - |-------------------------------------------------------------------------- - | Memcached Servers - |-------------------------------------------------------------------------- - | - | Now you may specify an array of your Memcached servers that should be - | used when utilizing the Memcached cache driver. All of the servers - | should contain a value for "host", "port", and "weight" options. - | - */ + /* + |-------------------------------------------------------------------------- + | Memcached Servers + |-------------------------------------------------------------------------- + | + | Now you may specify an array of your Memcached servers that should be + | used when utilizing the Memcached cache driver. All of the servers + | should contain a value for "host", "port", and "weight" options. + | + */ - 'memcached' => array( + 'memcached' => [ - array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100), + ['host' => '127.0.0.1', 'port' => 11211, 'weight' => 100], - ), + ], - /* - |-------------------------------------------------------------------------- - | Cache Key Prefix - |-------------------------------------------------------------------------- - | - | When utilizing a RAM based store such as APC or Memcached, there might - | be other applications utilizing the same cache. So, we'll specify a - | value to get prefixed to all our keys so we can avoid collisions. - | - */ + /* + |-------------------------------------------------------------------------- + | Cache Key Prefix + |-------------------------------------------------------------------------- + | + | When utilizing a RAM based store such as APC or Memcached, there might + | be other applications utilizing the same cache. So, we'll specify a + | value to get prefixed to all our keys so we can avoid collisions. + | + */ - 'prefix' => 'laravel', + 'prefix' => 'laravel', -); +]; diff --git a/app/config/compile.php b/app/config/compile.php index d5e55181b..63f573756 100644 --- a/app/config/compile.php +++ b/app/config/compile.php @@ -1,18 +1,16 @@ PDO::FETCH_CLASS, + 'fetch' => PDO::FETCH_CLASS, - /* - |-------------------------------------------------------------------------- - | Default Database Connection Name - |-------------------------------------------------------------------------- - | - | Here you may specify which of the database connections below you wish - | to use as your default connection for all database work. Of course - | you may use many connections at once using the Database library. - | - */ + /* + |-------------------------------------------------------------------------- + | Default Database Connection Name + |-------------------------------------------------------------------------- + | + | Here you may specify which of the database connections below you wish + | to use as your default connection for all database work. Of course + | you may use many connections at once using the Database library. + | + */ - 'default' => $_ENV['DB_DRIVER'], + 'default' => $_ENV['DB_DRIVER'], - /* - |-------------------------------------------------------------------------- - | Database Connections - |-------------------------------------------------------------------------- - | - | Here are each of the database connections setup for your application. - | Of course, examples of configuring each database platform that is - | supported by Laravel is shown below to make development simple. - | - | - | All database work in Laravel is done through the PHP PDO facilities - | so make sure you have the driver for your particular database of - | choice installed on your machine before you begin development. - | - */ + /* + |-------------------------------------------------------------------------- + | Database Connections + |-------------------------------------------------------------------------- + | + | Here are each of the database connections setup for your application. + | Of course, examples of configuring each database platform that is + | supported by Laravel is shown below to make development simple. + | + | + | All database work in Laravel is done through the PHP PDO facilities + | so make sure you have the driver for your particular database of + | choice installed on your machine before you begin development. + | + */ - 'connections' => array( + 'connections' => [ - 'sqlite' => array( - 'driver' => 'sqlite', - 'database' => __DIR__.'/../database/'.$_ENV['DB_DATABASE'], - 'prefix' => '', - ), + 'sqlite' => [ + 'driver' => 'sqlite', + 'database' => __DIR__.'/../database/'.$_ENV['DB_DATABASE'], + 'prefix' => '', + ], - 'mysql' => array( - 'driver' => 'mysql', - 'host' => $_ENV['DB_HOST'], - 'database' => $_ENV['DB_DATABASE'], - 'username' => $_ENV['DB_USERNAME'], - 'password' => $_ENV['DB_PASSWORD'], - 'charset' => 'utf8', - 'collation' => 'utf8_unicode_ci', - 'prefix' => '', - ), + 'mysql' => [ + 'driver' => 'mysql', + 'host' => $_ENV['DB_HOST'], + 'database' => $_ENV['DB_DATABASE'], + 'username' => $_ENV['DB_USERNAME'], + 'password' => $_ENV['DB_PASSWORD'], + 'charset' => 'utf8', + 'collation' => 'utf8_unicode_ci', + 'prefix' => '', + ], - 'pgsql' => array( - 'driver' => 'pgsql', - 'host' => $_ENV['DB_HOST'], - 'database' => $_ENV['DB_DATABASE'], - 'username' => $_ENV['DB_USERNAME'], - 'password' => $_ENV['DB_PASSWORD'], - 'charset' => 'utf8', - 'prefix' => '', - 'schema' => 'public', - ), + 'pgsql' => [ + 'driver' => 'pgsql', + 'host' => $_ENV['DB_HOST'], + 'database' => $_ENV['DB_DATABASE'], + 'username' => $_ENV['DB_USERNAME'], + 'password' => $_ENV['DB_PASSWORD'], + 'charset' => 'utf8', + 'prefix' => '', + 'schema' => 'public', + ], - 'sqlsrv' => array( - 'driver' => 'sqlsrv', - 'host' => $_ENV['DB_HOST'], - 'database' => $_ENV['DB_DATABASE'], - 'username' => $_ENV['DB_USERNAME'], - 'password' => $_ENV['DB_PASSWORD'], - 'prefix' => '', - ), + 'sqlsrv' => [ + 'driver' => 'sqlsrv', + 'host' => $_ENV['DB_HOST'], + 'database' => $_ENV['DB_DATABASE'], + 'username' => $_ENV['DB_USERNAME'], + 'password' => $_ENV['DB_PASSWORD'], + 'prefix' => '', + ], - ), + ], - /* - |-------------------------------------------------------------------------- - | Migration Repository Table - |-------------------------------------------------------------------------- - | - | This table keeps track of all the migrations that have already run for - | your application. Using this information, we can determine which of - | the migrations on disk haven't actually been run in the database. - | - */ + /* + |-------------------------------------------------------------------------- + | Migration Repository Table + |-------------------------------------------------------------------------- + | + | This table keeps track of all the migrations that have already run for + | your application. Using this information, we can determine which of + | the migrations on disk haven't actually been run in the database. + | + */ - 'migrations' => 'migrations', + 'migrations' => 'migrations', - /* - |-------------------------------------------------------------------------- - | Redis Databases - |-------------------------------------------------------------------------- - | - | Redis is an open source, fast, and advanced key-value store that also - | provides a richer set of commands than a typical key-value systems - | such as APC or Memcached. Laravel makes it easy to dig right in. - | - */ + /* + |-------------------------------------------------------------------------- + | Redis Databases + |-------------------------------------------------------------------------- + | + | Redis is an open source, fast, and advanced key-value store that also + | provides a richer set of commands than a typical key-value systems + | such as APC or Memcached. Laravel makes it easy to dig right in. + | + */ - 'redis' => array( + 'redis' => [ - 'cluster' => false, + 'cluster' => false, - 'default' => array( - 'host' => '127.0.0.1', - 'port' => 6379, - 'database' => 0, - ), + 'default' => [ + 'host' => '127.0.0.1', + 'port' => 6379, + 'database' => 0, + ], - ), + ], -); +]; diff --git a/app/config/heroku/database.php b/app/config/heroku/database.php index 41c73981e..5d2a26e79 100644 --- a/app/config/heroku/database.php +++ b/app/config/heroku/database.php @@ -3,10 +3,10 @@ $dbURL = parse_url(getenv('CLEARDB_DATABASE_URL')); $dbName = substr($dbURL["path"], 1); -return array( - 'default' => 'cleardb', - 'connections' => array( - 'cleardb' => array( +return [ + 'default' => 'cleardb', + 'connections' => [ + 'cleardb' => [ 'driver' => 'mysql', 'host' => $dbURL['host'], 'database' => $dbName, @@ -15,6 +15,6 @@ return array( 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', - ), - ) -); + ], + ], +]; diff --git a/app/config/local/app.php b/app/config/local/app.php index 5fb965813..94e936e15 100644 --- a/app/config/local/app.php +++ b/app/config/local/app.php @@ -1,20 +1,20 @@ true, + 'debug' => true, - 'url' => 'http://cachet.io.dev', + 'url' => 'http://cachet.io.dev', -); +]; diff --git a/app/config/mail.php b/app/config/mail.php index 76fd9e4f8..6e4a18718 100644 --- a/app/config/mail.php +++ b/app/config/mail.php @@ -1,124 +1,124 @@ 'smtp', + 'driver' => 'smtp', - /* - |-------------------------------------------------------------------------- - | SMTP Host Address - |-------------------------------------------------------------------------- - | - | Here you may provide the host address of the SMTP server used by your - | applications. A default option is provided that is compatible with - | the Mailgun mail service which will provide reliable deliveries. - | - */ + /* + |-------------------------------------------------------------------------- + | SMTP Host Address + |-------------------------------------------------------------------------- + | + | Here you may provide the host address of the SMTP server used by your + | applications. A default option is provided that is compatible with + | the Mailgun mail service which will provide reliable deliveries. + | + */ - 'host' => 'smtp.mailgun.org', + 'host' => 'smtp.mailgun.org', - /* - |-------------------------------------------------------------------------- - | SMTP Host Port - |-------------------------------------------------------------------------- - | - | This is the SMTP port used by your application to deliver e-mails to - | users of the application. Like the host we have set this value to - | stay compatible with the Mailgun e-mail application by default. - | - */ + /* + |-------------------------------------------------------------------------- + | SMTP Host Port + |-------------------------------------------------------------------------- + | + | This is the SMTP port used by your application to deliver e-mails to + | users of the application. Like the host we have set this value to + | stay compatible with the Mailgun e-mail application by default. + | + */ - 'port' => 587, + 'port' => 587, - /* - |-------------------------------------------------------------------------- - | Global "From" Address - |-------------------------------------------------------------------------- - | - | You may wish for all e-mails sent by your application to be sent from - | the same address. Here, you may specify a name and address that is - | used globally for all e-mails that are sent by your application. - | - */ + /* + |-------------------------------------------------------------------------- + | Global "From" Address + |-------------------------------------------------------------------------- + | + | You may wish for all e-mails sent by your application to be sent from + | the same address. Here, you may specify a name and address that is + | used globally for all e-mails that are sent by your application. + | + */ - 'from' => array('address' => null, 'name' => null), + 'from' => ['address' => null, 'name' => null], - /* - |-------------------------------------------------------------------------- - | E-Mail Encryption Protocol - |-------------------------------------------------------------------------- - | - | Here you may specify the encryption protocol that should be used when - | the application send e-mail messages. A sensible default using the - | transport layer security protocol should provide great security. - | - */ + /* + |-------------------------------------------------------------------------- + | E-Mail Encryption Protocol + |-------------------------------------------------------------------------- + | + | Here you may specify the encryption protocol that should be used when + | the application send e-mail messages. A sensible default using the + | transport layer security protocol should provide great security. + | + */ - 'encryption' => 'tls', + 'encryption' => 'tls', - /* - |-------------------------------------------------------------------------- - | SMTP Server Username - |-------------------------------------------------------------------------- - | - | If your SMTP server requires a username for authentication, you should - | set it here. This will get used to authenticate with your server on - | connection. You may also set the "password" value below this one. - | - */ + /* + |-------------------------------------------------------------------------- + | SMTP Server Username + |-------------------------------------------------------------------------- + | + | If your SMTP server requires a username for authentication, you should + | set it here. This will get used to authenticate with your server on + | connection. You may also set the "password" value below this one. + | + */ - 'username' => null, + 'username' => null, - /* - |-------------------------------------------------------------------------- - | SMTP Server Password - |-------------------------------------------------------------------------- - | - | Here you may set the password required by your SMTP server to send out - | messages from your application. This will be given to the server on - | connection so that the application will be able to send messages. - | - */ + /* + |-------------------------------------------------------------------------- + | SMTP Server Password + |-------------------------------------------------------------------------- + | + | Here you may set the password required by your SMTP server to send out + | messages from your application. This will be given to the server on + | connection so that the application will be able to send messages. + | + */ - 'password' => null, + 'password' => null, - /* - |-------------------------------------------------------------------------- - | Sendmail System Path - |-------------------------------------------------------------------------- - | - | When using the "sendmail" driver to send e-mails, we will need to know - | the path to where Sendmail lives on this server. A default path has - | been provided here, which will work well on most of your systems. - | - */ + /* + |-------------------------------------------------------------------------- + | Sendmail System Path + |-------------------------------------------------------------------------- + | + | When using the "sendmail" driver to send e-mails, we will need to know + | the path to where Sendmail lives on this server. A default path has + | been provided here, which will work well on most of your systems. + | + */ - 'sendmail' => '/usr/sbin/sendmail -bs', + 'sendmail' => '/usr/sbin/sendmail -bs', - /* - |-------------------------------------------------------------------------- - | Mail "Pretend" - |-------------------------------------------------------------------------- - | - | When this option is enabled, e-mail will not actually be sent over the - | web and will instead be written to your application's logs files so - | you may inspect the message. This is great for local development. - | - */ + /* + |-------------------------------------------------------------------------- + | Mail "Pretend" + |-------------------------------------------------------------------------- + | + | When this option is enabled, e-mail will not actually be sent over the + | web and will instead be written to your application's logs files so + | you may inspect the message. This is great for local development. + | + */ - 'pretend' => false, + 'pretend' => false, -); +]; diff --git a/app/config/packages/dingo/api/config.php b/app/config/packages/dingo/api/config.php index 341a476ca..440c5aff8 100644 --- a/app/config/packages/dingo/api/config.php +++ b/app/config/packages/dingo/api/config.php @@ -78,7 +78,7 @@ return [ 'auth' => [ 'basic' => function ($app) { return new Dingo\Api\Auth\BasicProvider($app['auth']); - } + }, ], /* @@ -101,15 +101,15 @@ return [ 'authenticated' => [ 'limit' => 0, - 'reset' => 60 + 'reset' => 60, ], 'unauthenticated' => [ 'limit' => 0, - 'reset' => 60 + 'reset' => 60, ], - 'exceeded' => 'API rate limit has been exceeded.' + 'exceeded' => 'API rate limit has been exceeded.', ], @@ -126,7 +126,7 @@ return [ */ 'transformer' => function ($app) { - $fractal = new League\Fractal\Manager; + $fractal = new League\Fractal\Manager(); return new Dingo\Api\Transformer\FractalTransformer($fractal); }, @@ -146,7 +146,7 @@ return [ 'formats' => [ - 'json' => new Dingo\Api\Http\ResponseFormat\JsonResponseFormat + 'json' => new Dingo\Api\Http\ResponseFormat\JsonResponseFormat(), ] diff --git a/app/config/queue.php b/app/config/queue.php index 940a4cdfe..5fe950c7a 100755 --- a/app/config/queue.php +++ b/app/config/queue.php @@ -1,85 +1,85 @@ 'sync', + 'default' => 'sync', - /* - |-------------------------------------------------------------------------- - | Queue Connections - |-------------------------------------------------------------------------- - | - | Here you may configure the connection information for each server that - | is used by your application. A default configuration has been added - | for each back-end shipped with Laravel. You are free to add more. - | - */ + /* + |-------------------------------------------------------------------------- + | Queue Connections + |-------------------------------------------------------------------------- + | + | Here you may configure the connection information for each server that + | is used by your application. A default configuration has been added + | for each back-end shipped with Laravel. You are free to add more. + | + */ - 'connections' => array( + 'connections' => [ - 'sync' => array( - 'driver' => 'sync', - ), + 'sync' => [ + 'driver' => 'sync', + ], - 'beanstalkd' => array( - 'driver' => 'beanstalkd', - 'host' => 'localhost', - 'queue' => 'default', - 'ttr' => 60, - ), + 'beanstalkd' => [ + 'driver' => 'beanstalkd', + 'host' => 'localhost', + 'queue' => 'default', + 'ttr' => 60, + ], - 'sqs' => array( - 'driver' => 'sqs', - 'key' => 'your-public-key', - 'secret' => 'your-secret-key', - 'queue' => 'your-queue-url', - 'region' => 'us-east-1', - ), + 'sqs' => [ + 'driver' => 'sqs', + 'key' => 'your-public-key', + 'secret' => 'your-secret-key', + 'queue' => 'your-queue-url', + 'region' => 'us-east-1', + ], - 'iron' => array( - 'driver' => 'iron', - 'host' => 'mq-aws-us-east-1.iron.io', - 'token' => 'your-token', - 'project' => 'your-project-id', - 'queue' => 'your-queue-name', - 'encrypt' => true, - ), + 'iron' => [ + 'driver' => 'iron', + 'host' => 'mq-aws-us-east-1.iron.io', + 'token' => 'your-token', + 'project' => 'your-project-id', + 'queue' => 'your-queue-name', + 'encrypt' => true, + ], - 'redis' => array( - 'driver' => 'redis', - 'queue' => 'default', - ), + 'redis' => [ + 'driver' => 'redis', + 'queue' => 'default', + ], - ), + ], - /* - |-------------------------------------------------------------------------- - | Failed Queue Jobs - |-------------------------------------------------------------------------- - | - | These options configure the behavior of failed queue job logging so you - | can control which database and table are used to store the jobs that - | have failed. You may change them to any database / table you wish. - | - */ + /* + |-------------------------------------------------------------------------- + | Failed Queue Jobs + |-------------------------------------------------------------------------- + | + | These options configure the behavior of failed queue job logging so you + | can control which database and table are used to store the jobs that + | have failed. You may change them to any database / table you wish. + | + */ - 'failed' => array( + 'failed' => [ - 'database' => 'mysql', 'table' => 'failed_jobs', + 'database' => 'mysql', 'table' => 'failed_jobs', - ), + ], -); +]; diff --git a/app/config/remote.php b/app/config/remote.php index 2169c434b..9e6cc270e 100644 --- a/app/config/remote.php +++ b/app/config/remote.php @@ -1,59 +1,59 @@ 'production', + 'default' => 'production', - /* - |-------------------------------------------------------------------------- - | Remote Server Connections - |-------------------------------------------------------------------------- - | - | These are the servers that will be accessible via the SSH task runner - | facilities of Laravel. This feature radically simplifies executing - | tasks on your servers, such as deploying out these applications. - | - */ + /* + |-------------------------------------------------------------------------- + | Remote Server Connections + |-------------------------------------------------------------------------- + | + | These are the servers that will be accessible via the SSH task runner + | facilities of Laravel. This feature radically simplifies executing + | tasks on your servers, such as deploying out these applications. + | + */ - 'connections' => array( + 'connections' => [ - 'production' => array( - 'host' => '', - 'username' => '', - 'password' => '', - 'key' => '', - 'keyphrase' => '', - 'root' => '/var/www', - ), + 'production' => [ + 'host' => '', + 'username' => '', + 'password' => '', + 'key' => '', + 'keyphrase' => '', + 'root' => '/var/www', + ], - ), + ], - /* - |-------------------------------------------------------------------------- - | Remote Server Groups - |-------------------------------------------------------------------------- - | - | Here you may list connections under a single group name, which allows - | you to easily access all of the servers at once using a short name - | that is extremely easy to remember, such as "web" or "database". - | - */ + /* + |-------------------------------------------------------------------------- + | Remote Server Groups + |-------------------------------------------------------------------------- + | + | Here you may list connections under a single group name, which allows + | you to easily access all of the servers at once using a short name + | that is extremely easy to remember, such as "web" or "database". + | + */ - 'groups' => array( + 'groups' => [ - 'web' => array('production') + 'web' => ['production'], - ), + ], -); +]; diff --git a/app/config/services.php b/app/config/services.php index c8aba2a6d..55dd4e03c 100644 --- a/app/config/services.php +++ b/app/config/services.php @@ -1,31 +1,31 @@ array( - 'domain' => '', - 'secret' => '', - ), + 'mailgun' => [ + 'domain' => '', + 'secret' => '', + ], - 'mandrill' => array( - 'secret' => '', - ), + 'mandrill' => [ + 'secret' => '', + ], - 'stripe' => array( - 'model' => 'User', - 'secret' => '', - ), + 'stripe' => [ + 'model' => 'User', + 'secret' => '', + ], -); +]; diff --git a/app/config/session.php b/app/config/session.php index ff69e4b09..4d14da35f 100644 --- a/app/config/session.php +++ b/app/config/session.php @@ -1,140 +1,140 @@ 'database', + 'driver' => 'database', - /* - |-------------------------------------------------------------------------- - | Session Lifetime - |-------------------------------------------------------------------------- - | - | Here you may specify the number of minutes that you wish the session - | to be allowed to remain idle before it expires. If you want them - | to immediately expire on the browser closing, set that option. - | - */ + /* + |-------------------------------------------------------------------------- + | Session Lifetime + |-------------------------------------------------------------------------- + | + | Here you may specify the number of minutes that you wish the session + | to be allowed to remain idle before it expires. If you want them + | to immediately expire on the browser closing, set that option. + | + */ - 'lifetime' => 120, + 'lifetime' => 120, - 'expire_on_close' => false, + 'expire_on_close' => false, - /* - |-------------------------------------------------------------------------- - | Session File Location - |-------------------------------------------------------------------------- - | - | When using the native session driver, we need a location where session - | files may be stored. A default has been set for you but a different - | location may be specified. This is only needed for file sessions. - | - */ + /* + |-------------------------------------------------------------------------- + | Session File Location + |-------------------------------------------------------------------------- + | + | When using the native session driver, we need a location where session + | files may be stored. A default has been set for you but a different + | location may be specified. This is only needed for file sessions. + | + */ - 'files' => storage_path().'/sessions', + 'files' => storage_path().'/sessions', - /* - |-------------------------------------------------------------------------- - | Session Database Connection - |-------------------------------------------------------------------------- - | - | When using the "database" or "redis" session drivers, you may specify a - | connection that should be used to manage these sessions. This should - | correspond to a connection in your database configuration options. - | - */ + /* + |-------------------------------------------------------------------------- + | Session Database Connection + |-------------------------------------------------------------------------- + | + | When using the "database" or "redis" session drivers, you may specify a + | connection that should be used to manage these sessions. This should + | correspond to a connection in your database configuration options. + | + */ - 'connection' => null, + 'connection' => null, - /* - |-------------------------------------------------------------------------- - | Session Database Table - |-------------------------------------------------------------------------- - | - | When using the "database" session driver, you may specify the table we - | should use to manage the sessions. Of course, a sensible default is - | provided for you; however, you are free to change this as needed. - | - */ + /* + |-------------------------------------------------------------------------- + | Session Database Table + |-------------------------------------------------------------------------- + | + | When using the "database" session driver, you may specify the table we + | should use to manage the sessions. Of course, a sensible default is + | provided for you; however, you are free to change this as needed. + | + */ - 'table' => 'sessions', + 'table' => 'sessions', - /* - |-------------------------------------------------------------------------- - | Session Sweeping Lottery - |-------------------------------------------------------------------------- - | - | Some session drivers must manually sweep their storage location to get - | rid of old sessions from storage. Here are the chances that it will - | happen on a given request. By default, the odds are 2 out of 100. - | - */ + /* + |-------------------------------------------------------------------------- + | Session Sweeping Lottery + |-------------------------------------------------------------------------- + | + | Some session drivers must manually sweep their storage location to get + | rid of old sessions from storage. Here are the chances that it will + | happen on a given request. By default, the odds are 2 out of 100. + | + */ - 'lottery' => array(2, 100), + 'lottery' => [2, 100], - /* - |-------------------------------------------------------------------------- - | Session Cookie Name - |-------------------------------------------------------------------------- - | - | Here you may change the name of the cookie used to identify a session - | instance by ID. The name specified here will get used every time a - | new session cookie is created by the framework for every driver. - | - */ + /* + |-------------------------------------------------------------------------- + | Session Cookie Name + |-------------------------------------------------------------------------- + | + | Here you may change the name of the cookie used to identify a session + | instance by ID. The name specified here will get used every time a + | new session cookie is created by the framework for every driver. + | + */ - 'cookie' => 'laravel_session', + 'cookie' => 'laravel_session', - /* - |-------------------------------------------------------------------------- - | Session Cookie Path - |-------------------------------------------------------------------------- - | - | The session cookie path determines the path for which the cookie will - | be regarded as available. Typically, this will be the root path of - | your application but you are free to change this when necessary. - | - */ + /* + |-------------------------------------------------------------------------- + | Session Cookie Path + |-------------------------------------------------------------------------- + | + | The session cookie path determines the path for which the cookie will + | be regarded as available. Typically, this will be the root path of + | your application but you are free to change this when necessary. + | + */ - 'path' => '/', + 'path' => '/', - /* - |-------------------------------------------------------------------------- - | Session Cookie Domain - |-------------------------------------------------------------------------- - | - | Here you may change the domain of the cookie used to identify a session - | in your application. This will determine which domains the cookie is - | available to in your application. A sensible default has been set. - | - */ + /* + |-------------------------------------------------------------------------- + | Session Cookie Domain + |-------------------------------------------------------------------------- + | + | Here you may change the domain of the cookie used to identify a session + | in your application. This will determine which domains the cookie is + | available to in your application. A sensible default has been set. + | + */ - 'domain' => null, + 'domain' => null, - /* - |-------------------------------------------------------------------------- - | HTTPS Only Cookies - |-------------------------------------------------------------------------- - | - | By setting this option to true, session cookies will only be sent back - | to the server if the browser has a HTTPS connection. This will keep - | the cookie from being sent to you if it can not be done securely. - | - */ + /* + |-------------------------------------------------------------------------- + | HTTPS Only Cookies + |-------------------------------------------------------------------------- + | + | By setting this option to true, session cookies will only be sent back + | to the server if the browser has a HTTPS connection. This will keep + | the cookie from being sent to you if it can not be done securely. + | + */ - 'secure' => false, + 'secure' => false, -); +]; diff --git a/app/config/testing/cache.php b/app/config/testing/cache.php index 66a8a39a8..9f436e276 100644 --- a/app/config/testing/cache.php +++ b/app/config/testing/cache.php @@ -1,20 +1,20 @@ 'array', + 'driver' => 'array', -); +]; diff --git a/app/config/testing/session.php b/app/config/testing/session.php index 0364b63dc..17de80957 100644 --- a/app/config/testing/session.php +++ b/app/config/testing/session.php @@ -1,21 +1,21 @@ 'array', + 'driver' => 'array', -); +]; diff --git a/app/config/view.php b/app/config/view.php index 34b8f3873..0cc2ffb1c 100644 --- a/app/config/view.php +++ b/app/config/view.php @@ -1,31 +1,31 @@ array(__DIR__.'/../views'), + 'paths' => [__DIR__.'/../views'], - /* - |-------------------------------------------------------------------------- - | Pagination View - |-------------------------------------------------------------------------- - | - | This view will be used to render the pagination link output, and can - | be easily customized here to show any view you like. A clean view - | compatible with Twitter's Bootstrap is given to you by default. - | - */ + /* + |-------------------------------------------------------------------------- + | Pagination View + |-------------------------------------------------------------------------- + | + | This view will be used to render the pagination link output, and can + | be easily customized here to show any view you like. A clean view + | compatible with Twitter's Bootstrap is given to you by default. + | + */ - 'pagination' => 'pagination::slider-3', + 'pagination' => 'pagination::slider-3', -); +]; diff --git a/app/config/workbench.php b/app/config/workbench.php index 87c5e3879..735a79492 100644 --- a/app/config/workbench.php +++ b/app/config/workbench.php @@ -1,31 +1,31 @@ '', + 'name' => '', - /* - |-------------------------------------------------------------------------- - | Workbench Author E-Mail Address - |-------------------------------------------------------------------------- - | - | Like the option above, your e-mail address is used when generating new - | workbench packages. The e-mail is placed in your composer.json file - | automatically after the package is created by the workbench tool. - | - */ + /* + |-------------------------------------------------------------------------- + | Workbench Author E-Mail Address + |-------------------------------------------------------------------------- + | + | Like the option above, your e-mail address is used when generating new + | workbench packages. The e-mail is placed in your composer.json file + | automatically after the package is created by the workbench tool. + | + */ - 'email' => '', + 'email' => '', -); +]; diff --git a/app/controllers/AuthController.php b/app/controllers/AuthController.php index 7f579643b..900536a87 100644 --- a/app/controllers/AuthController.php +++ b/app/controllers/AuthController.php @@ -3,12 +3,14 @@ /** * Logs users into their account */ -class AuthController extends Controller { +class AuthController extends Controller +{ /** * Shows the login view. * @return \Illuminate\View\View */ - public function showLogin() { + public function showLogin() + { return View::make('auth.login'); } @@ -16,7 +18,8 @@ class AuthController extends Controller { * Logs the user in. * @return \Illuminate\Http\RedirectResponse */ - public function postLogin() { + public function postLogin() + { if (Auth::attempt(Input::only(['email', 'password']))) { return Redirect::intended('dashboard'); } else { @@ -30,8 +33,10 @@ class AuthController extends Controller { * Logs the user out, deleting their session etc. * @return \Illuminate\Http\RedirectResponse */ - public function logoutAction() { + public function logoutAction() + { Auth::logout(); + return Redirect::to('/'); } } diff --git a/app/controllers/DashComponentController.php b/app/controllers/DashComponentController.php index 851009da5..157113df5 100644 --- a/app/controllers/DashComponentController.php +++ b/app/controllers/DashComponentController.php @@ -1,71 +1,78 @@ with([ - 'pageTitle' => 'Components - Dashboard', - 'components' => $components - ]); - } + return View::make('dashboard.components')->with([ + 'pageTitle' => 'Components - Dashboard', + 'components' => $components, + ]); + } - /** - * Shows the edit component view. - * @param Component $component - * @return \Illuminate\View\View - */ - public function showEditComponent(Component $component) { + /** + * Shows the edit component view. + * @param Component $component + * @return \Illuminate\View\View + */ + public function showEditComponent(Component $component) + { + return View::make('dashboard.component-edit')->with([ + 'pageTitle' => 'Editing "'.$component->name.'" Component - Dashboard', + 'component' => $component, + ]); + } - return View::make('dashboard.component-edit')->with([ - 'pageTitle' => 'Editing "' . $component->name . '" Component - Dashboard', - 'component' => $component - ]); - } + /** + * Updates a component. + * @return \Illuminate\Http\RedirectResponse + */ + public function updateComponentAction(Component $component) + { + $_component = Input::get('component'); + $component->update($_component); - /** - * Updates a component. - * @return \Illuminate\Http\RedirectResponse - */ - public function updateComponentAction(Component $component) { - $_component = Input::get('component'); - $component->update($_component); + return Redirect::back()->with('savedComponent', $component); + } - return Redirect::back()->with('savedComponent', $component); - } + /** + * Shows the add component view. + * @return \Illuminate\View\View + */ + public function showAddComponent() + { + return View::make('dashboard.component-add')->with([ + 'pageTitle' => 'Add Component - Dashboard', + ]); + } - /** - * Shows the add component view. - * @return \Illuminate\View\View - */ - public function showAddComponent() { - return View::make('dashboard.component-add')->with([ - 'pageTitle' => 'Add Component - Dashboard', - ]); - } + /** + * Creates a new component. + * @return \Illuminate\Http\RedirectResponse + */ + public function createComponentAction() + { + $_component = Input::get('component'); + $component = Component::create($_component); - /** - * Creates a new component. - * @return \Illuminate\Http\RedirectResponse - */ - public function createComponentAction() { - $_component = Input::get('component'); - $component = Component::create($_component); + return Redirect::back()->with('component', $component); + } - return Redirect::back()->with('component', $component); - } + /** + * Deletes a given component. + * @param Component $component + * @return \Illuminate\Http\RedirectResponse + */ + public function deleteComponentAction(Component $component) + { + $component->delete(); - /** - * Deletes a given component. - * @param Component $component - * @return \Illuminate\Http\RedirectResponse - */ - public function deleteComponentAction(Component $component) { - $component->delete(); - return Redirect::back(); - } + return Redirect::back(); + } } diff --git a/app/controllers/DashIncidentController.php b/app/controllers/DashIncidentController.php index d42c62cb9..3e5cca2fe 100644 --- a/app/controllers/DashIncidentController.php +++ b/app/controllers/DashIncidentController.php @@ -1,58 +1,64 @@ with([ - 'pageTitle' => 'Incidents - Dashboard', - 'incidents' => $incidents - ]); - } + return View::make('dashboard.incidents')->with([ + 'pageTitle' => 'Incidents - Dashboard', + 'incidents' => $incidents, + ]); + } - /** - * Shows the add incident view. - * @return \Illuminate\View\View - */ - public function showAddIncident() { - return View::make('dashboard.incident-add')->with([ - 'pageTitle' => 'Add Incident - Dashboard', - ]); - } + /** + * Shows the add incident view. + * @return \Illuminate\View\View + */ + public function showAddIncident() + { + return View::make('dashboard.incident-add')->with([ + 'pageTitle' => 'Add Incident - Dashboard', + ]); + } - /** - * Shows the add incident template view. - * @return \Illuminate\View\View - */ - public function showAddIncidentTemplate() { - return View::make('dashboard.incident-template')->with([ - 'pageTitle' => 'Add Incident Template - Dashboard', - ]); - } + /** + * Shows the add incident template view. + * @return \Illuminate\View\View + */ + public function showAddIncidentTemplate() + { + return View::make('dashboard.incident-template')->with([ + 'pageTitle' => 'Add Incident Template - Dashboard', + ]); + } - /** - * Creates a new incident template. - * @return \Illuminate\Http\RedirectResponse - */ - public function createIncidentTemplateAction() { - $_template = Input::get('template'); - $template = IncidentTemplate::create($_template); + /** + * Creates a new incident template. + * @return \Illuminate\Http\RedirectResponse + */ + public function createIncidentTemplateAction() + { + $_template = Input::get('template'); + $template = IncidentTemplate::create($_template); - return Redirect::back()->with('template', $template); - } + return Redirect::back()->with('template', $template); + } - /** - * Creates a new incident. - * @return \Illuminate\Http\RedirectResponse - */ - public function createIncidentAction() { - $_incident = Input::get('incident'); - $incident = Incident::create($_incident); + /** + * Creates a new incident. + * @return \Illuminate\Http\RedirectResponse + */ + public function createIncidentAction() + { + $_incident = Input::get('incident'); + $incident = Incident::create($_incident); - return Redirect::back()->with('incident', $incident); - } + return Redirect::back()->with('incident', $incident); + } } diff --git a/app/controllers/DashSettingsController.php b/app/controllers/DashSettingsController.php index b71c9049e..fe71a54f0 100644 --- a/app/controllers/DashSettingsController.php +++ b/app/controllers/DashSettingsController.php @@ -1,40 +1,43 @@ -with([ - 'pageTitle' => 'Settings - Dashboard' - ]); - } +class DashSettingsController extends Controller +{ + /** + * Shows the settings view. + * @return \Illuminate\View\View + */ + public function showSettings() + { + return View::make('dashboard.settings')->with([ + 'pageTitle' => 'Settings - Dashboard', + ]); + } - /** - * Updates the statsu page settings. - * @return \Illuminate\View\View - */ - public function postSettings() { - $settings = Input::all(); + /** + * Updates the statsu page settings. + * @return \Illuminate\View\View + */ + public function postSettings() + { + $settings = Input::all(); - foreach ($settings as $settingName => $settingValue) { - // Don't save empty settings. Kinda useless... - if (!$settingValue) { - continue; - } + foreach ($settings as $settingName => $settingValue) { + // Don't save empty settings. Kinda useless... + if (!$settingValue) { + continue; + } - if (strstr($settingName, 'style_')) { - $settingValue = str_replace('#', '', $settingValue); - } + if (strstr($settingName, 'style_')) { + $settingValue = str_replace('#', '', $settingValue); + } - $setting = Setting::firstOrCreate([ - 'name' => $settingName, - ])->update([ - 'value' => $settingValue - ]); - } + $setting = Setting::firstOrCreate([ + 'name' => $settingName, + ])->update([ + 'value' => $settingValue, + ]); + } - return Redirect::back(); - } + return Redirect::back(); + } } diff --git a/app/controllers/DashboardController.php b/app/controllers/DashboardController.php index 5a192a242..94d8a9a30 100644 --- a/app/controllers/DashboardController.php +++ b/app/controllers/DashboardController.php @@ -1,11 +1,13 @@ with([ - 'pageTitle' => 'Metrics - Dashboard' + 'pageTitle' => 'Metrics - Dashboard', ]); } @@ -23,9 +26,10 @@ class DashboardController extends Controller { * Shows the notifications view. * @return \Illuminate\View\View */ - public function showNotifications() { + public function showNotifications() + { return View::make('dashboard.notifications')->with([ - 'pageTitle' => 'Notifications - Dashboard' + 'pageTitle' => 'Notifications - Dashboard', ]); } } diff --git a/app/controllers/HomeController.php b/app/controllers/HomeController.php index 2d5de1889..53ad9064a 100644 --- a/app/controllers/HomeController.php +++ b/app/controllers/HomeController.php @@ -1,12 +1,14 @@ component = $component; } @@ -14,7 +16,8 @@ class HomeController extends Controller { * Returns the rendered Blade templates. * @return \Illuminate\View\View */ - public function showIndex() { + public function showIndex() + { return View::make('index', ['components' => $this->component->all()]); } } diff --git a/app/controllers/RSSController.php b/app/controllers/RSSController.php index 727fc2f28..53c4fe412 100644 --- a/app/controllers/RSSController.php +++ b/app/controllers/RSSController.php @@ -1,11 +1,13 @@ channel([ 'title' => Setting::get('app_name'), @@ -13,7 +15,7 @@ class RSSController extends Controller { 'link' => Setting::get('app_domain'), ]); - Incident::get()->map(function($incident) use ($feed) { + Incident::get()->map(function ($incident) use ($feed) { $componentName = null; $component = $incident->component; if ($component) { @@ -26,7 +28,7 @@ class RSSController extends Controller { 'component' => $componentName, 'status' => $incident->humanStatus, 'created_at' => $incident->created_at, - 'updated_at' => $incident->updated_at + 'updated_at' => $incident->updated_at, ]); }); diff --git a/app/controllers/SetupController.php b/app/controllers/SetupController.php index c8e02cda8..4d33825d3 100644 --- a/app/controllers/SetupController.php +++ b/app/controllers/SetupController.php @@ -1,7 +1,9 @@ beforeFilter('csrf', ['only' => ['postCachet']]); } @@ -9,9 +11,10 @@ class SetupController extends Controller { * Returns the setup page. * @return \Illuminate\View\View */ - public function getIndex() { + public function getIndex() + { return View::make('setup')->with([ - 'pageTitle' => 'Setup' + 'pageTitle' => 'Setup', ]); } @@ -19,7 +22,8 @@ class SetupController extends Controller { * Handles the actual app setup. * @return \Illuminate\Http\RedirectResponse */ - public function postIndex() { + public function postIndex() + { $postData = Input::get(); $v = Validator::make($postData, [ @@ -38,7 +42,7 @@ class SetupController extends Controller { // TODO: Do we want to just use Eloquent::unguard() here? $user = User::create([ 'username' => $userDetails['username'], - 'email' => $userDetails['email'], + 'email' => $userDetails['email'], 'password' => $userDetails['password'], ]); @@ -47,7 +51,7 @@ class SetupController extends Controller { $settings = array_get($postData, 'settings'); foreach ($settings as $settingName => $settingValue) { - $setting = new Setting; + $setting = new Setting(); $setting->name = $settingName; $setting->value = $settingValue; $setting->save(); diff --git a/app/database/migrations/2014_11_16_224719_CreateIncidentsTable.php b/app/database/migrations/2014_11_16_224719_CreateIncidentsTable.php index 31b9e9989..f30a42c37 100644 --- a/app/database/migrations/2014_11_16_224719_CreateIncidentsTable.php +++ b/app/database/migrations/2014_11_16_224719_CreateIncidentsTable.php @@ -1,40 +1,39 @@ increments('id'); - $table->tinyInteger('component')->default(1); - $table->string('name'); - $table->tinyInteger('status')->default(1); - $table->longText('message'); - $table->timestamps(); - $table->softDeletes(); + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('incidents', function (Blueprint $table) { + $table->increments('id'); + $table->tinyInteger('component')->default(1); + $table->string('name'); + $table->tinyInteger('status')->default(1); + $table->longText('message'); + $table->timestamps(); + $table->softDeletes(); - $table->index('component'); - $table->index('status'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('incidents'); - } + $table->index('component'); + $table->index('status'); + }); + } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('incidents'); + } } diff --git a/app/database/migrations/2014_11_16_224937_CreateComponentsTable.php b/app/database/migrations/2014_11_16_224937_CreateComponentsTable.php index c8d6a7adc..70d80c314 100644 --- a/app/database/migrations/2014_11_16_224937_CreateComponentsTable.php +++ b/app/database/migrations/2014_11_16_224937_CreateComponentsTable.php @@ -1,37 +1,36 @@ increments('id'); - $table->string('name'); - $table->string('description')->nullable()->default(null); - $table->tinyInteger('status')->default(1); - $table->timestamps(); + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('components', function (Blueprint $table) { + $table->increments('id'); + $table->string('name'); + $table->string('description')->nullable()->default(null); + $table->tinyInteger('status')->default(1); + $table->timestamps(); - $table->index('status'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('components'); - } + $table->index('status'); + }); + } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('components'); + } } diff --git a/app/database/migrations/2014_11_17_144232_CreateSettingsTable.php b/app/database/migrations/2014_11_17_144232_CreateSettingsTable.php index a9aa6bb59..16adc9941 100644 --- a/app/database/migrations/2014_11_17_144232_CreateSettingsTable.php +++ b/app/database/migrations/2014_11_17_144232_CreateSettingsTable.php @@ -1,34 +1,33 @@ increments('id'); - $table->string('name'); - $table->text('value')->nullable()->default(null); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('settings'); - } + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('settings', function (Blueprint $table) { + $table->increments('id'); + $table->string('name'); + $table->text('value')->nullable()->default(null); + $table->timestamps(); + }); + } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('settings'); + } } diff --git a/app/database/migrations/2014_11_22_134023_CreateWebHooksTable.php b/app/database/migrations/2014_11_22_134023_CreateWebHooksTable.php index 860a27017..557cb37ab 100644 --- a/app/database/migrations/2014_11_22_134023_CreateWebHooksTable.php +++ b/app/database/migrations/2014_11_22_134023_CreateWebHooksTable.php @@ -1,41 +1,40 @@ increments('id'); - $table->string('name')->nullable(FALSE); - $table->string('endpoint')->nullable(FALSE); - $table->tinyInteger('hook_type')->default(0); // When should this web hook be called? - $table->tinyInteger('request_type')->default(0); // ENUM: GET, POST, PUT, DELETE etc - $table->boolean('active')->default(0); - $table->timestamps(); - $table->softDeletes(); + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('web_hooks', function (Blueprint $table) { + $table->increments('id'); + $table->string('name')->nullable(false); + $table->string('endpoint')->nullable(false); + $table->tinyInteger('hook_type')->default(0); // When should this web hook be called? + $table->tinyInteger('request_type')->default(0); // ENUM: GET, POST, PUT, DELETE etc + $table->boolean('active')->default(0); + $table->timestamps(); + $table->softDeletes(); - // Indexes - $table->index('active'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('web_hooks'); - } + // Indexes + $table->index('active'); + }); + } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('web_hooks'); + } } diff --git a/app/database/migrations/2014_11_22_134136_CreateWebHookResponsesTable.php b/app/database/migrations/2014_11_22_134136_CreateWebHookResponsesTable.php index bbec71e2f..3b2aee62e 100644 --- a/app/database/migrations/2014_11_22_134136_CreateWebHookResponsesTable.php +++ b/app/database/migrations/2014_11_22_134136_CreateWebHookResponsesTable.php @@ -1,42 +1,41 @@ increments('id'); - $table->integer('hook_id')->unsigned(); - $table->tinyInteger('response_code')->nullable(FALSE); // This should return something like 200, 301 etc. - $table->string('response_type'); // application/json etc. - $table->text('sent_headers'); - $table->longText('sent_body'); // What we sent the web hook - $table->text('recv_headers'); - $table->longText('recv_body'); // Potentially a big response will be returned - $table->float('time_taken')->default(0); // How long did the request take, in seconds. - $table->timestamps(); + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('web_hook_response', function (Blueprint $table) { + $table->increments('id'); + $table->integer('hook_id')->unsigned(); + $table->tinyInteger('response_code')->nullable(false); // This should return something like 200, 301 etc. + $table->string('response_type'); // application/json etc. + $table->text('sent_headers'); + $table->longText('sent_body'); // What we sent the web hook + $table->text('recv_headers'); + $table->longText('recv_body'); // Potentially a big response will be returned + $table->float('time_taken')->default(0); // How long did the request take, in seconds. + $table->timestamps(); - $table->index('hook_id'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('web_hook_response'); - } + $table->index('hook_id'); + }); + } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('web_hook_response'); + } } diff --git a/app/database/migrations/2014_11_24_153408_CreateUsersTable.php b/app/database/migrations/2014_11_24_153408_CreateUsersTable.php index 38d3b8142..ce4aa2f40 100644 --- a/app/database/migrations/2014_11_24_153408_CreateUsersTable.php +++ b/app/database/migrations/2014_11_24_153408_CreateUsersTable.php @@ -1,41 +1,40 @@ increments('id'); - $table->string('username', 200)->nullable(false); - $table->string('password')->nullable(false); - $table->rememberToken(); - $table->string('email')->nullable()->default(null); - $table->boolean('active')->default(1); - $table->tinyInteger('level')->default(2); - $table->timestamps(); + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('users', function (Blueprint $table) { + $table->increments('id'); + $table->string('username', 200)->nullable(false); + $table->string('password')->nullable(false); + $table->rememberToken(); + $table->string('email')->nullable()->default(null); + $table->boolean('active')->default(1); + $table->tinyInteger('level')->default(2); + $table->timestamps(); - $table->index('remember_token'); - $table->index('active'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('users'); - } + $table->index('remember_token'); + $table->index('active'); + }); + } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('users'); + } } diff --git a/app/database/migrations/2014_11_24_164650_CreateIncidentTemplatesTable.php b/app/database/migrations/2014_11_24_164650_CreateIncidentTemplatesTable.php index fd429d198..90f72dbe7 100644 --- a/app/database/migrations/2014_11_24_164650_CreateIncidentTemplatesTable.php +++ b/app/database/migrations/2014_11_24_164650_CreateIncidentTemplatesTable.php @@ -1,38 +1,37 @@ increments('id'); - $table->string('name')->nullable(false); - $table->string('slug', 50)->nullable(false); - $table->longText('template')->nullable(false); + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('incident_templates', function (Blueprint $table) { + $table->increments('id'); + $table->string('name')->nullable(false); + $table->string('slug', 50)->nullable(false); + $table->longText('template')->nullable(false); - $table->timestamps(); + $table->timestamps(); - $table->index('slug'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('incident_templates'); - } + $table->index('slug'); + }); + } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('incident_templates'); + } } diff --git a/app/database/migrations/2014_11_25_111315_CreateMetricsTable.php b/app/database/migrations/2014_11_25_111315_CreateMetricsTable.php index fa3dc6eb0..0e1d229a6 100644 --- a/app/database/migrations/2014_11_25_111315_CreateMetricsTable.php +++ b/app/database/migrations/2014_11_25_111315_CreateMetricsTable.php @@ -1,36 +1,35 @@ increments('id'); - $table->string('name')->nullable(false); - $table->string('suffix')->nullable(false); - $table->string('description')->nullable(false); - $table->boolean('display_chart')->default(false); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('metrics'); - } + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('metrics', function (Blueprint $table) { + $table->increments('id'); + $table->string('name')->nullable(false); + $table->string('suffix')->nullable(false); + $table->string('description')->nullable(false); + $table->boolean('display_chart')->default(false); + $table->timestamps(); + }); + } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('metrics'); + } } diff --git a/app/database/migrations/2014_11_25_111609_CreateMetricPointsTable.php b/app/database/migrations/2014_11_25_111609_CreateMetricPointsTable.php index 284626cf5..ae285e190 100644 --- a/app/database/migrations/2014_11_25_111609_CreateMetricPointsTable.php +++ b/app/database/migrations/2014_11_25_111609_CreateMetricPointsTable.php @@ -1,36 +1,35 @@ increments('id'); - $table->integer('metric_id')->unsigned(); - $table->integer('value')->unsigned(); - $table->timestamps(); + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('metric_points', function (Blueprint $table) { + $table->increments('id'); + $table->integer('metric_id')->unsigned(); + $table->integer('value')->unsigned(); + $table->timestamps(); - $table->foreign('metric_id')->references('id')->on('metrics'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('metric_points'); - } + $table->foreign('metric_id')->references('id')->on('metrics'); + }); + } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('metric_points'); + } } diff --git a/app/database/migrations/2014_11_25_114040_UserIdColumnForComponents.php b/app/database/migrations/2014_11_25_114040_UserIdColumnForComponents.php index 7f676f337..0a0749990 100644 --- a/app/database/migrations/2014_11_25_114040_UserIdColumnForComponents.php +++ b/app/database/migrations/2014_11_25_114040_UserIdColumnForComponents.php @@ -1,36 +1,34 @@ unsignedInteger('user_id')->nullable(); + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::table('components', function (Blueprint $table) { + $table->unsignedInteger('user_id')->nullable(); - $table->foreign('user_id')->references('id')->on('users')->onDelete('SET NULL')->onUpdate('NO ACTION'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('components', function(Blueprint $table) - { - $table->dropColumn('user_id'); - }); - } + $table->foreign('user_id')->references('id')->on('users')->onDelete('SET NULL')->onUpdate('NO ACTION'); + }); + } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('components', function (Blueprint $table) { + $table->dropColumn('user_id'); + }); + } } diff --git a/app/database/migrations/2014_11_25_114101_UserIdColumnForIncidents.php b/app/database/migrations/2014_11_25_114101_UserIdColumnForIncidents.php index 1fa032be2..a067cde33 100644 --- a/app/database/migrations/2014_11_25_114101_UserIdColumnForIncidents.php +++ b/app/database/migrations/2014_11_25_114101_UserIdColumnForIncidents.php @@ -1,36 +1,34 @@ unsignedInteger('user_id')->nullable(); + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::table('incidents', function (Blueprint $table) { + $table->unsignedInteger('user_id')->nullable(); - $table->foreign('user_id')->references('id')->on('users')->onDelete('SET NULL')->onUpdate('NO ACTION'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('incidents', function(Blueprint $table) - { - $table->dropColumn('user_id'); - }); - } + $table->foreign('user_id')->references('id')->on('users')->onDelete('SET NULL')->onUpdate('NO ACTION'); + }); + } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('incidents', function (Blueprint $table) { + $table->dropColumn('user_id'); + }); + } } diff --git a/app/database/migrations/2014_11_25_160545_CreateSubscribersTable.php b/app/database/migrations/2014_11_25_160545_CreateSubscribersTable.php index f36a3c407..fce8422d6 100644 --- a/app/database/migrations/2014_11_25_160545_CreateSubscribersTable.php +++ b/app/database/migrations/2014_11_25_160545_CreateSubscribersTable.php @@ -1,34 +1,33 @@ increments('id'); - $table->string('email')->nullable(false); - $table->timestamps(); - $table->softDeletes(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('subscribers'); - } + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('subscribers', function (Blueprint $table) { + $table->increments('id'); + $table->string('email')->nullable(false); + $table->timestamps(); + $table->softDeletes(); + }); + } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('subscribers'); + } } diff --git a/app/database/migrations/2014_11_26_164111_CreateServicesTable.php b/app/database/migrations/2014_11_26_164111_CreateServicesTable.php index b0d7ad7fb..a2b60dc60 100644 --- a/app/database/migrations/2014_11_26_164111_CreateServicesTable.php +++ b/app/database/migrations/2014_11_26_164111_CreateServicesTable.php @@ -1,37 +1,36 @@ increments('id'); + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('services', function (Blueprint $table) { + $table->increments('id'); - $table->string('type')->nullable(false); - $table->boolean('active')->default(0); // Inactive by default - $table->text('properties')->nullable(true); + $table->string('type')->nullable(false); + $table->boolean('active')->default(0); // Inactive by default + $table->text('properties')->nullable(true); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('services'); - } + $table->timestamps(); + }); + } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('services'); + } } diff --git a/app/database/migrations/2014_12_01_121947_AlterTableIncidentsRenameComponentColumn.php b/app/database/migrations/2014_12_01_121947_AlterTableIncidentsRenameComponentColumn.php index 22a1975c6..1383dbbbe 100644 --- a/app/database/migrations/2014_12_01_121947_AlterTableIncidentsRenameComponentColumn.php +++ b/app/database/migrations/2014_12_01_121947_AlterTableIncidentsRenameComponentColumn.php @@ -1,34 +1,32 @@ string('id')->unique(); - $t->text('payload'); - $t->integer('last_activity'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('sessions'); - } + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('sessions', function ($t) { + $t->string('id')->unique(); + $t->text('payload'); + $t->integer('last_activity'); + }); + } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('sessions'); + } } diff --git a/app/database/migrations/2014_12_13_135117_AlterTableComponentsAddDeletedAt.php b/app/database/migrations/2014_12_13_135117_AlterTableComponentsAddDeletedAt.php index b340b8dd1..0a59397e2 100644 --- a/app/database/migrations/2014_12_13_135117_AlterTableComponentsAddDeletedAt.php +++ b/app/database/migrations/2014_12_13_135117_AlterTableComponentsAddDeletedAt.php @@ -1,28 +1,29 @@ softDeletes(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - } + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::table('components', function (Blueprint $table) { + $table->softDeletes(); + }); + } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + } } diff --git a/app/database/seeds/ComponentTableSeeder.php b/app/database/seeds/ComponentTableSeeder.php index 767376c36..11d1428bb 100644 --- a/app/database/seeds/ComponentTableSeeder.php +++ b/app/database/seeds/ComponentTableSeeder.php @@ -1,38 +1,39 @@ "API", - "description" => "Used by third-parties to connect to us", - "status" => 1, - "user_id" => 1 - ], [ - "name" => "Payments", - "description" => "Backed by Stripe", - "status" => 1, - "user_id" => 1 - ], [ - "name" => "Website", - "status" => 1, - "user_id" => 1 - ] - ]; + $defaultComponents = [ + [ + "name" => "API", + "description" => "Used by third-parties to connect to us", + "status" => 1, + "user_id" => 1, + ], [ + "name" => "Payments", + "description" => "Backed by Stripe", + "status" => 1, + "user_id" => 1 + ], [ + "name" => "Website", + "status" => 1, + "user_id" => 1 + ], + ]; - Component::truncate(); + Component::truncate(); - foreach($defaultComponents as $component) { - Component::create($component); - } - } + foreach ($defaultComponents as $component) { + Component::create($component); + } + } } diff --git a/app/database/seeds/DatabaseSeeder.php b/app/database/seeds/DatabaseSeeder.php index a19ed1c8a..ff21448b1 100644 --- a/app/database/seeds/DatabaseSeeder.php +++ b/app/database/seeds/DatabaseSeeder.php @@ -1,19 +1,19 @@ call('SettingsTableSeeder'); - $this->call('IncidentTableSeeder'); - $this->call('ComponentTableSeeder'); - } + /** + * Run the database seeds. + * + * @return void + */ + public function run() + { + Eloquent::unguard(); + $this->call('SettingsTableSeeder'); + $this->call('IncidentTableSeeder'); + $this->call('ComponentTableSeeder'); + } } diff --git a/app/database/seeds/IncidentTableSeeder.php b/app/database/seeds/IncidentTableSeeder.php index 36515635c..49ea0ca64 100644 --- a/app/database/seeds/IncidentTableSeeder.php +++ b/app/database/seeds/IncidentTableSeeder.php @@ -1,50 +1,51 @@ "Test Incident", - "message" => "Something went wrong, oh noes.", - "component_id" => 1, - "user_id" => 1, - ], - [ - "name" => "Update", - "message" => "We've found the problem, so we're looking at it.", - "status" => 2, - "component_id" => 1, - "user_id" => 1, - ], - [ - "name" => "Monitoring the fix", - "message" => "We're checking that our fix will first work.", - "status" => 3, - "component_id" => 1, - "user_id" => 1, - ], - [ - "name" => "Awesome", - "message" => "We totally nailed the fix.", - "status" => 4, - "component_id" => 2, - "user_id" => 1, - ] - ]; + $defaultIncidents = [ + [ + "name" => "Test Incident", + "message" => "Something went wrong, oh noes.", + "component_id" => 1, + "user_id" => 1, + ], + [ + "name" => "Update", + "message" => "We've found the problem, so we're looking at it.", + "status" => 2, + "component_id" => 1, + "user_id" => 1, + ], + [ + "name" => "Monitoring the fix", + "message" => "We're checking that our fix will first work.", + "status" => 3, + "component_id" => 1, + "user_id" => 1, + ], + [ + "name" => "Awesome", + "message" => "We totally nailed the fix.", + "status" => 4, + "component_id" => 2, + "user_id" => 1, + ], + ]; - Incident::truncate(); + Incident::truncate(); - foreach($defaultIncidents as $incident) { - Incident::create($incident); - } - } + foreach ($defaultIncidents as $incident) { + Incident::create($incident); + } + } } diff --git a/app/database/seeds/SettingsTableSeeder.php b/app/database/seeds/SettingsTableSeeder.php index 3c383f136..15179b259 100644 --- a/app/database/seeds/SettingsTableSeeder.php +++ b/app/database/seeds/SettingsTableSeeder.php @@ -1,27 +1,28 @@ "site_name", - "value" => "Test" - ] - ]; + $defaultSettings = [ + [ + "name" => "site_name", + "value" => "Test", + ], + ]; - Setting::truncate(); + Setting::truncate(); - foreach($defaultSettings as $setting) { - Setting::create($setting); - } - } + foreach ($defaultSettings as $setting) { + Setting::create($setting); + } + } } diff --git a/app/filters.php b/app/filters.php index 9c93c05db..e864343fd 100644 --- a/app/filters.php +++ b/app/filters.php @@ -16,7 +16,7 @@ Route::filter('allowed_domains', 'AllowedDomainsFilter'); | */ -Route::filter('auth', function() { +Route::filter('auth', function () { if (Auth::guest()) { if (Request::ajax()) { return Response::make('Unauthorized', 401); @@ -26,8 +26,7 @@ Route::filter('auth', function() { } }); - -Route::filter('auth.basic', function() { +Route::filter('auth.basic', function () { return Auth::basic(); }); @@ -42,7 +41,7 @@ Route::filter('auth.basic', function() { | */ -Route::filter('guest', function() { +Route::filter('guest', function () { if (Auth::check()) { return Redirect::to('/'); } @@ -59,8 +58,8 @@ Route::filter('guest', function() { | */ -Route::filter('csrf', function() { +Route::filter('csrf', function () { if (Session::token() !== Input::get('_token')) { - throw new Illuminate\Session\TokenMismatchException; + throw new Illuminate\Session\TokenMismatchException(); } }); diff --git a/app/filters/AllowedDomainsFilter.php b/app/filters/AllowedDomainsFilter.php index feedbe4cc..ec0aab741 100644 --- a/app/filters/AllowedDomainsFilter.php +++ b/app/filters/AllowedDomainsFilter.php @@ -1,18 +1,20 @@ headers->set('Access-Control-Allow-Origin', $ourDomain); // Should we allow anyone else? - if ($setting = Setting::get('allowed_domains')) { - $domains = explode(',', $setting); - foreach ($domains as $domain) { - $response->headers->set('Access-Control-Allow-Origin', $domain); - } - } + if ($setting = Setting::get('allowed_domains')) { + $domains = explode(',', $setting); + foreach ($domains as $domain) { + $response->headers->set('Access-Control-Allow-Origin', $domain); + } + } return $response; } diff --git a/app/filters/CORSFilter.php b/app/filters/CORSFilter.php index 50f4bd079..3d44b4672 100644 --- a/app/filters/CORSFilter.php +++ b/app/filters/CORSFilter.php @@ -1,8 +1,11 @@ headers->set('Access-Control-Allow-Origin', '*'); + return $response; } } diff --git a/app/filters/HasSettingFilter.php b/app/filters/HasSettingFilter.php index fb6b6a8db..8a5eb4de4 100644 --- a/app/filters/HasSettingFilter.php +++ b/app/filters/HasSettingFilter.php @@ -1,7 +1,9 @@ first(); if (!$setting->value) { diff --git a/app/filters/IsSetupFilter.php b/app/filters/IsSetupFilter.php index a1517297f..b25a5e35c 100644 --- a/app/filters/IsSetupFilter.php +++ b/app/filters/IsSetupFilter.php @@ -1,7 +1,9 @@ first(); if ($setting->value) { diff --git a/app/helpers.php b/app/helpers.php index 0d1dda04a..7b354ccd3 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -1,28 +1,24 @@ array( - 'status' => array( + 'component' => [ + 'status' => [ 1 => 'Operational', 2 => 'Performance Issues', 3 => 'Partial Outage', - 4 => 'Major Outage' - ) - ), + 4 => 'Major Outage', + ], + ], // Incidents - 'incident' => array( - 'status' => array( + 'incident' => [ + 'status' => [ 1 => 'Investigating', 2 => 'Identified', 3 => 'Watching', - 4 => 'Fixed' - ) - ), + 4 => 'Fixed', + ], + ], // Service Status - 'service' => array( + 'service' => [ 'good' => 'All systems are functional.', - 'bad' => 'Some systems are experiencing issues.', - ), + 'bad' => 'Some systems are experiencing issues.', + ], // Other 'powered_by' => ':app Status Page is powered by Cachet.', - 'logout' => 'Logout', - 'logged_in' => 'You\'re logged in.', - 'setup' => 'Setup Cachet', - 'dashboard' => array( - 'dashboard' => 'Dashboard', - 'components' => 'Components', - 'component-add' => 'Add Component', - 'incidents' => 'Incidents', - 'incident-add' => 'Add Incident', + 'logout' => 'Logout', + 'logged_in' => 'You\'re logged in.', + 'setup' => 'Setup Cachet', + 'dashboard' => [ + 'dashboard' => 'Dashboard', + 'components' => 'Components', + 'component-add' => 'Add Component', + 'incidents' => 'Incidents', + 'incident-add' => 'Add Incident', 'incident-create-template' => 'Create Template', - 'metrics' => 'Metrics', - 'metrics-add' => 'Add Metric Point', - 'status_page' => 'Status Page', - 'settings' => 'Settings', - 'notifications' => 'Notifications', - 'toggle_navigation' => 'Toggle Navigation', - 'search' => 'Search...', - ), -); + 'metrics' => 'Metrics', + 'metrics-add' => 'Add Metric Point', + 'status_page' => 'Status Page', + 'settings' => 'Settings', + 'notifications' => 'Notifications', + 'toggle_navigation' => 'Toggle Navigation', + 'search' => 'Search...', + ], +]; diff --git a/app/lang/en/pagination.php b/app/lang/en/pagination.php index 6b99ef5fd..b9940a133 100644 --- a/app/lang/en/pagination.php +++ b/app/lang/en/pagination.php @@ -1,20 +1,20 @@ '« Previous', + 'previous' => '« Previous', - 'next' => 'Next »', + 'next' => 'Next »', -); +]; diff --git a/app/lang/en/reminders.php b/app/lang/en/reminders.php index e2e24e5d5..70f703d7e 100644 --- a/app/lang/en/reminders.php +++ b/app/lang/en/reminders.php @@ -1,26 +1,26 @@ "Passwords must be at least six characters and match the confirmation.", + "password" => "Passwords must be at least six characters and match the confirmation.", - "user" => "We can't find a user with that e-mail address.", + "user" => "We can't find a user with that e-mail address.", - "token" => "This password reset token is invalid.", + "token" => "This password reset token is invalid.", - "sent" => "Password reminder sent!", + "sent" => "Password reminder sent!", - "reset" => "Password has been reset!", + "reset" => "Password has been reset!", -); +]; diff --git a/app/lang/en/validation.php b/app/lang/en/validation.php index 648516e79..05a8b50a6 100644 --- a/app/lang/en/validation.php +++ b/app/lang/en/validation.php @@ -1,106 +1,106 @@ "The :attribute must be accepted.", - "active_url" => "The :attribute is not a valid URL.", - "after" => "The :attribute must be a date after :date.", - "alpha" => "The :attribute may only contain letters.", - "alpha_dash" => "The :attribute may only contain letters, numbers, and dashes.", - "alpha_num" => "The :attribute may only contain letters and numbers.", - "array" => "The :attribute must be an array.", - "before" => "The :attribute must be a date before :date.", - "between" => array( - "numeric" => "The :attribute must be between :min and :max.", - "file" => "The :attribute must be between :min and :max kilobytes.", - "string" => "The :attribute must be between :min and :max characters.", - "array" => "The :attribute must have between :min and :max items.", - ), - "boolean" => "The :attribute field must be true or false.", - "confirmed" => "The :attribute confirmation does not match.", - "date" => "The :attribute is not a valid date.", - "date_format" => "The :attribute does not match the format :format.", - "different" => "The :attribute and :other must be different.", - "digits" => "The :attribute must be :digits digits.", - "digits_between" => "The :attribute must be between :min and :max digits.", - "email" => "The :attribute must be a valid email address.", - "exists" => "The selected :attribute is invalid.", - "image" => "The :attribute must be an image.", - "in" => "The selected :attribute is invalid.", - "integer" => "The :attribute must be an integer.", - "ip" => "The :attribute must be a valid IP address.", - "max" => array( - "numeric" => "The :attribute may not be greater than :max.", - "file" => "The :attribute may not be greater than :max kilobytes.", - "string" => "The :attribute may not be greater than :max characters.", - "array" => "The :attribute may not have more than :max items.", - ), - "mimes" => "The :attribute must be a file of type: :values.", - "min" => array( - "numeric" => "The :attribute must be at least :min.", - "file" => "The :attribute must be at least :min kilobytes.", - "string" => "The :attribute must be at least :min characters.", - "array" => "The :attribute must have at least :min items.", - ), - "not_in" => "The selected :attribute is invalid.", - "numeric" => "The :attribute must be a number.", - "regex" => "The :attribute format is invalid.", - "required" => "The :attribute field is required.", - "required_if" => "The :attribute field is required when :other is :value.", - "required_with" => "The :attribute field is required when :values is present.", - "required_with_all" => "The :attribute field is required when :values is present.", - "required_without" => "The :attribute field is required when :values is not present.", - "required_without_all" => "The :attribute field is required when none of :values are present.", - "same" => "The :attribute and :other must match.", - "size" => array( - "numeric" => "The :attribute must be :size.", - "file" => "The :attribute must be :size kilobytes.", - "string" => "The :attribute must be :size characters.", - "array" => "The :attribute must contain :size items.", - ), - "unique" => "The :attribute has already been taken.", - "url" => "The :attribute format is invalid.", - "timezone" => "The :attribute must be a valid zone.", + "accepted" => "The :attribute must be accepted.", + "active_url" => "The :attribute is not a valid URL.", + "after" => "The :attribute must be a date after :date.", + "alpha" => "The :attribute may only contain letters.", + "alpha_dash" => "The :attribute may only contain letters, numbers, and dashes.", + "alpha_num" => "The :attribute may only contain letters and numbers.", + "array" => "The :attribute must be an array.", + "before" => "The :attribute must be a date before :date.", + "between" => [ + "numeric" => "The :attribute must be between :min and :max.", + "file" => "The :attribute must be between :min and :max kilobytes.", + "string" => "The :attribute must be between :min and :max characters.", + "array" => "The :attribute must have between :min and :max items.", + ], + "boolean" => "The :attribute field must be true or false.", + "confirmed" => "The :attribute confirmation does not match.", + "date" => "The :attribute is not a valid date.", + "date_format" => "The :attribute does not match the format :format.", + "different" => "The :attribute and :other must be different.", + "digits" => "The :attribute must be :digits digits.", + "digits_between" => "The :attribute must be between :min and :max digits.", + "email" => "The :attribute must be a valid email address.", + "exists" => "The selected :attribute is invalid.", + "image" => "The :attribute must be an image.", + "in" => "The selected :attribute is invalid.", + "integer" => "The :attribute must be an integer.", + "ip" => "The :attribute must be a valid IP address.", + "max" => [ + "numeric" => "The :attribute may not be greater than :max.", + "file" => "The :attribute may not be greater than :max kilobytes.", + "string" => "The :attribute may not be greater than :max characters.", + "array" => "The :attribute may not have more than :max items.", + ], + "mimes" => "The :attribute must be a file of type: :values.", + "min" => [ + "numeric" => "The :attribute must be at least :min.", + "file" => "The :attribute must be at least :min kilobytes.", + "string" => "The :attribute must be at least :min characters.", + "array" => "The :attribute must have at least :min items.", + ], + "not_in" => "The selected :attribute is invalid.", + "numeric" => "The :attribute must be a number.", + "regex" => "The :attribute format is invalid.", + "required" => "The :attribute field is required.", + "required_if" => "The :attribute field is required when :other is :value.", + "required_with" => "The :attribute field is required when :values is present.", + "required_with_all" => "The :attribute field is required when :values is present.", + "required_without" => "The :attribute field is required when :values is not present.", + "required_without_all" => "The :attribute field is required when none of :values are present.", + "same" => "The :attribute and :other must match.", + "size" => [ + "numeric" => "The :attribute must be :size.", + "file" => "The :attribute must be :size kilobytes.", + "string" => "The :attribute must be :size characters.", + "array" => "The :attribute must contain :size items.", + ], + "unique" => "The :attribute has already been taken.", + "url" => "The :attribute format is invalid.", + "timezone" => "The :attribute must be a valid zone.", - /* - |-------------------------------------------------------------------------- - | Custom Validation Language Lines - |-------------------------------------------------------------------------- - | - | Here you may specify custom validation messages for attributes using the - | convention "attribute.rule" to name the lines. This makes it quick to - | specify a specific custom language line for a given attribute rule. - | - */ + /* + |-------------------------------------------------------------------------- + | Custom Validation Language Lines + |-------------------------------------------------------------------------- + | + | Here you may specify custom validation messages for attributes using the + | convention "attribute.rule" to name the lines. This makes it quick to + | specify a specific custom language line for a given attribute rule. + | + */ - 'custom' => array( - 'attribute-name' => array( - 'rule-name' => 'custom-message', - ), - ), + 'custom' => [ + 'attribute-name' => [ + 'rule-name' => 'custom-message', + ], + ], - /* - |-------------------------------------------------------------------------- - | Custom Validation Attributes - |-------------------------------------------------------------------------- - | - | The following language lines are used to swap attribute place-holders - | with something more reader friendly such as E-Mail Address instead - | of "email". This simply helps us make messages a little cleaner. - | - */ + /* + |-------------------------------------------------------------------------- + | Custom Validation Attributes + |-------------------------------------------------------------------------- + | + | The following language lines are used to swap attribute place-holders + | with something more reader friendly such as E-Mail Address instead + | of "email". This simply helps us make messages a little cleaner. + | + */ - 'attributes' => array(), + 'attributes' => [], -); +]; diff --git a/app/models/Component.php b/app/models/Component.php index aeb61da99..12a15678b 100644 --- a/app/models/Component.php +++ b/app/models/Component.php @@ -2,14 +2,15 @@ use Watson\Validating\ValidatingTrait; -class Component extends Eloquent implements \Dingo\Api\Transformer\TransformableInterface { +class Component extends Eloquent implements \Dingo\Api\Transformer\TransformableInterface +{ use ValidatingTrait; use Illuminate\Database\Eloquent\SoftDeletingTrait; protected $rules = [ 'user_id' => 'integer|required', 'name' => 'required', - 'status' => 'integer' + 'status' => 'integer', ]; protected $fillable = ['name', 'description', 'status', 'user_id']; @@ -18,7 +19,8 @@ class Component extends Eloquent implements \Dingo\Api\Transformer\Transformable * Lookup all of the incidents reported on the component. * @return Illuminate\Database\Eloquent\Relations */ - public function incidents() { + public function incidents() + { return $this->hasMany('Incident', 'component_id', 'id'); } @@ -26,15 +28,17 @@ class Component extends Eloquent implements \Dingo\Api\Transformer\Transformable * Looks up the human readable version of the status. * @return string */ - public function getHumanStatusAttribute() { - return Lang::get('cachet.component.status.' . $this->status); + public function getHumanStatusAttribute() + { + return Lang::get('cachet.component.status.'.$this->status); } /** * Get the transformer instance. * @return ComponentTransformer */ - public function getTransformer() { + public function getTransformer() + { return new CachetHQ\Cachet\Transformers\ComponentTransformer(); } } diff --git a/app/models/Incident.php b/app/models/Incident.php index 9085e36d2..88a1872a0 100644 --- a/app/models/Incident.php +++ b/app/models/Incident.php @@ -2,7 +2,8 @@ use Watson\Validating\ValidatingTrait; -class Incident extends Eloquent implements \Dingo\Api\Transformer\TransformableInterface { +class Incident extends Eloquent implements \Dingo\Api\Transformer\TransformableInterface +{ use ValidatingTrait; use Illuminate\Database\Eloquent\SoftDeletingTrait; @@ -22,7 +23,8 @@ class Incident extends Eloquent implements \Dingo\Api\Transformer\TransformableI * An incident belongs to a component. * @return Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function component() { + public function component() + { return $this->belongsTo('Component', 'component_id', 'id'); } @@ -30,8 +32,10 @@ class Incident extends Eloquent implements \Dingo\Api\Transformer\TransformableI * Returns a human readable version of the status. * @return string */ - public function getHumanStatusAttribute() { + public function getHumanStatusAttribute() + { $statuses = Lang::get('cachet.incident.status'); + return $statuses[$this->status]; } @@ -39,7 +43,8 @@ class Incident extends Eloquent implements \Dingo\Api\Transformer\TransformableI * Finds the icon to use for each status. * @return string */ - public function getIconAttribute() { + public function getIconAttribute() + { switch ($this->status) { case 1: return 'fa fa-flag'; case 2: return 'fa fa-warning'; @@ -52,7 +57,8 @@ class Incident extends Eloquent implements \Dingo\Api\Transformer\TransformableI * Get the transformer instance. * @return CachetHQ\Cachet\Transformers\IncidentTransformer */ - public function getTransformer() { + public function getTransformer() + { return new CachetHQ\Cachet\Transformers\IncidentTransformer(); } } diff --git a/app/models/IncidentTemplate.php b/app/models/IncidentTemplate.php index 82b7dc934..2514305e3 100644 --- a/app/models/IncidentTemplate.php +++ b/app/models/IncidentTemplate.php @@ -2,7 +2,8 @@ use Watson\Validating\ValidatingTrait; -class IncidentTemplate extends Eloquent { +class IncidentTemplate extends Eloquent +{ use ValidatingTrait; protected $rules = [ @@ -19,10 +20,11 @@ class IncidentTemplate extends Eloquent { * Overrides the models boot method. * @return void */ - public static function boot() { + public static function boot() + { parent::boot(); - self::saving(function($template) { + self::saving(function ($template) { $template->slug = Str::slug($template->name); }); } diff --git a/app/models/Metric.php b/app/models/Metric.php index 22e658c8b..7ff668bed 100644 --- a/app/models/Metric.php +++ b/app/models/Metric.php @@ -2,7 +2,8 @@ use Watson\Validating\ValidatingTrait; -class Metric extends Eloquent implements \Dingo\Api\Transformer\TransformableInterface { +class Metric extends Eloquent implements \Dingo\Api\Transformer\TransformableInterface +{ use ValidatingTrait; protected $rules = [ @@ -17,7 +18,8 @@ class Metric extends Eloquent implements \Dingo\Api\Transformer\TransformableInt * Metrics contain many metric points. * @return Illuminate\Database\Eloquent\Builder */ - public function points() { + public function points() + { return $this->hasMany('MetricPoint', 'metric_id', 'id'); } @@ -25,7 +27,8 @@ class Metric extends Eloquent implements \Dingo\Api\Transformer\TransformableInt * Determines whether a chart should be shown. * @return bool */ - public function getShouldDisplayAttribute() { + public function getShouldDisplayAttribute() + { return $this->display_chart === 1; } @@ -33,7 +36,8 @@ class Metric extends Eloquent implements \Dingo\Api\Transformer\TransformableInt * Get the transformer instance. * @return CachetHQ\Cachet\Transformers\MetricTransformer */ - public function getTransformer() { + public function getTransformer() + { return new CachetHQ\Cachet\Transformers\MetricTransformer(); } } diff --git a/app/models/MetricPoint.php b/app/models/MetricPoint.php index 73c7f6886..3647e3ce7 100644 --- a/app/models/MetricPoint.php +++ b/app/models/MetricPoint.php @@ -1,11 +1,13 @@ belongsTo('Metric', 'id', 'metric_id'); } } diff --git a/app/models/Service.php b/app/models/Service.php index ad057b96b..8a08ce007 100644 --- a/app/models/Service.php +++ b/app/models/Service.php @@ -2,13 +2,14 @@ use Watson\Validating\ValidatingTrait; -class Service extends Eloquent { +class Service extends Eloquent +{ use ValidatingTrait; protected $rules = [ 'type' => 'alpha_dash|required', 'active' => 'required|in:0,1', - 'properties' => '' + 'properties' => '', ]; /** @@ -16,7 +17,8 @@ class Service extends Eloquent { * @param string $properties * @return object */ - public function getPropertiesAttribute($properties) { + public function getPropertiesAttribute($properties) + { return json_decode($properties); } @@ -24,7 +26,8 @@ class Service extends Eloquent { * Sets the properties attribute which auto encodes to a JSON string. * @param mixed $properties */ - public function setPropertiesAttribute($properties) { + public function setPropertiesAttribute($properties) + { $this->attributes['properties'] = json_encode($properties); } } diff --git a/app/models/Setting.php b/app/models/Setting.php index 9049d4e93..ccbd95dba 100644 --- a/app/models/Setting.php +++ b/app/models/Setting.php @@ -1,15 +1,17 @@ 'required|email' + 'email' => 'required|email', ]; protected $fillable = ['email']; diff --git a/app/models/User.php b/app/models/User.php index 596a384cb..842fa2566 100644 --- a/app/models/User.php +++ b/app/models/User.php @@ -1,11 +1,12 @@ attributes['password'] = Hash::make($password); } @@ -41,12 +43,12 @@ class User extends Eloquent implements UserInterface, RemindableInterface { * @param integer $size * @return string */ - public function getGravatarAttribute($size = 200) { + public function getGravatarAttribute($size = 200) + { return sprintf( 'https://www.gravatar.com/avatar/%s?size=%d', md5($this->email), $size ); } - } diff --git a/app/models/WebHook.php b/app/models/WebHook.php index 557c755fc..a0054a4f7 100644 --- a/app/models/WebHook.php +++ b/app/models/WebHook.php @@ -1,6 +1,7 @@ hasMany('WebHookContent', 'hook_id', 'id'); } @@ -22,7 +24,8 @@ class WebHook extends Eloquent { * @param Illuminate\Database\Eloquent\Builder $query * @return Illuminate\Database\Eloquent\Builder */ - public function scopeActive($query) { + public function scopeActive($query) + { return $query->where('active', 1); } @@ -30,17 +33,19 @@ class WebHook extends Eloquent { * Setups a Ping event that is fired upon a web hook. * @return array result of the ping */ - public function ping() { + public function ping() + { return $this->fire('ping', 'Coming live to you from Cachet.'); } /** * Fires the actual web hook event. - * @param string $eventType the event to send X-Cachet-Event - * @param mixed $data Data to send to the Web Hook + * @param string $eventType the event to send X-Cachet-Event + * @param mixed $data Data to send to the Web Hook * @return object */ - public function fire($eventType, $data = null) { + public function fire($eventType, $data = null) + { $startTime = microtime(true); $client = new \GuzzleHttp\Client(); @@ -58,10 +63,10 @@ class WebHook extends Eloquent { $response = $e->getResponse(); } - $timeTaken = microtime(TRUE) - $startTime; + $timeTaken = microtime(true) - $startTime; // Store the request - $hookResponse = new WebHookResponse; + $hookResponse = new WebHookResponse(); $hookResponse->web_hook_id = $this->id; $hookResponse->response_code = $response->getStatusCode(); $hookResponse->sent_headers = json_encode($request->getHeaders()); @@ -77,10 +82,11 @@ class WebHook extends Eloquent { /** * Returns a human readable request type name. * @throws Exception - * @return string HEAD, GET, POST, DELETE, PATCH, PUT etc + * @return string HEAD, GET, POST, DELETE, PATCH, PUT etc */ - public function getRequestMethodAttribute() { - $requestMethod = NULL; + public function getRequestMethodAttribute() + { + $requestMethod = null; switch ($this->request_type) { case self::HEAD: @@ -103,7 +109,7 @@ class WebHook extends Eloquent { break; default: - throw new Exception('Unknown request type value: ' . $this->request_type); + throw new Exception('Unknown request type value: '.$this->request_type); break; } diff --git a/app/models/WebHookResponse.php b/app/models/WebHookResponse.php index db7b7e703..55378e954 100644 --- a/app/models/WebHookResponse.php +++ b/app/models/WebHookResponse.php @@ -1,11 +1,13 @@ belongsTo('WebHook', 'id', 'hook_id'); } } diff --git a/app/routes/api.php b/app/routes/api.php index d3fac4d1c..c2c7b2727 100644 --- a/app/routes/api.php +++ b/app/routes/api.php @@ -3,8 +3,8 @@ Route::api([ 'version' => 'v1', 'namespace' => 'CachetHQ\Cachet\Controllers\Api', - 'after' => 'allowed_domains' -], function() { + 'after' => 'allowed_domains', +], function () { Route::get('components', 'ComponentController@getComponents'); Route::get('components/{id}', 'ComponentController@getComponent'); Route::get('components/{id}/incidents', 'ComponentController@getComponentIncidents'); @@ -14,7 +14,7 @@ Route::api([ Route::get('metrics/{id}', 'MetricController@getMetric'); Route::get('metrics/points/{id}', 'MetricPointController@getMetricPoint'); - Route::group(['protected' => true], function() { + Route::group(['protected' => true], function () { Route::post('components', 'ComponentController@postComponents'); Route::post('incidents', 'IncidentController@postIncidents'); Route::post('metrics', 'MetricController@postMetrics'); diff --git a/app/routes/app.php b/app/routes/app.php index 282a36196..943edb1eb 100644 --- a/app/routes/app.php +++ b/app/routes/app.php @@ -1,13 +1,13 @@ 'has_setting:app_name'], function() { +Route::group(['before' => 'has_setting:app_name'], function () { Route::get('/', ['as' => 'status-page', 'uses' => 'HomeController@showIndex']); Route::get('/incident/{incident}', 'HomeController@showIncident'); }); // Setup route. -Route::group(['before' => 'is_setup'], function() { +Route::group(['before' => 'is_setup'], function () { Route::controller('/setup', 'SetupController'); }); diff --git a/app/routes/auth.php b/app/routes/auth.php index 8959fa52a..8b495a2c4 100644 --- a/app/routes/auth.php +++ b/app/routes/auth.php @@ -1,8 +1,8 @@ 'has_setting:app_name'], function() { +Route::group(['before' => 'has_setting:app_name'], function () { Route::get('/auth/login', ['before' => 'guest', 'as' => 'login', 'uses' => 'AuthController@showLogin']); Route::post('/auth/login', ['before' => 'guest|csrf', 'as' => 'logout', 'uses' => 'AuthController@postLogin']); }); -Route::get('/auth/logout', ['before' => 'auth', 'as' => 'logout', 'uses' => 'AuthController@logoutAction']); \ No newline at end of file +Route::get('/auth/logout', ['before' => 'auth', 'as' => 'logout', 'uses' => 'AuthController@logoutAction']); diff --git a/app/routes/dashboard.php b/app/routes/dashboard.php index 3e6baff3f..f77025c44 100644 --- a/app/routes/dashboard.php +++ b/app/routes/dashboard.php @@ -1,6 +1,6 @@ 'auth', 'prefix' => 'dashboard'], function() { +Route::group(['before' => 'auth', 'prefix' => 'dashboard'], function () { // Dashboard Route::get('/', ['as' => 'dashboard', 'uses' => 'DashboardController@showDashboard']); diff --git a/app/start/artisan.php b/app/start/artisan.php index 1df850bc9..409e9adb6 100644 --- a/app/start/artisan.php +++ b/app/start/artisan.php @@ -10,4 +10,3 @@ | the console gets access to each of the command object instances. | */ - diff --git a/app/start/global.php b/app/start/global.php index 970e517dc..96e838bd6 100644 --- a/app/start/global.php +++ b/app/start/global.php @@ -11,16 +11,16 @@ | */ -ClassLoader::addDirectories(array( +ClassLoader::addDirectories([ - app_path().'/commands', - app_path().'/controllers', - app_path().'/models', - app_path().'/transformers', - app_path().'/database/seeds', - app_path().'/filters', + app_path().'/commands', + app_path().'/controllers', + app_path().'/models', + app_path().'/transformers', + app_path().'/database/seeds', + app_path().'/filters', -)); +]); /* |-------------------------------------------------------------------------- @@ -48,17 +48,16 @@ Log::useFiles(storage_path().'/logs/laravel.log'); | */ -App::error(function(Exception $exception, $code) -{ - Log::error($exception); +App::error(function (Exception $exception, $code) { + Log::error($exception); }); API::error(function (\Illuminate\Database\Eloquent\ModelNotFoundException $exception) { - return Response::make(['error' => $exception->getMessage()], 404); + return Response::make(['error' => $exception->getMessage()], 404); }); -App::missing(function($exception) { - return Response::view('errors.404', array(), 404); +App::missing(function ($exception) { + return Response::view('errors.404', [], 404); }); /* @@ -72,9 +71,8 @@ App::missing(function($exception) { | */ -App::down(function() -{ - return Response::make("Be right back!", 503); +App::down(function () { + return Response::make("Be right back!", 503); }); /* diff --git a/app/start/local.php b/app/start/local.php index 3d1485091..3d9949b80 100644 --- a/app/start/local.php +++ b/app/start/local.php @@ -1,3 +1,3 @@ repo = Mockery::mock('CachetHQ\Cachet\Repositories\Component\ComponentRepository'); - $this->dingo = Mockery::mock('Dingo\Api\Auth\Shield'); - } + public function setUp() + { + $this->repo = Mockery::mock('CachetHQ\Cachet\Repositories\Component\ComponentRepository'); + $this->dingo = Mockery::mock('Dingo\Api\Auth\Shield'); + } - public function tearDown() { - Mockery::close(); - } + public function tearDown() + { + Mockery::close(); + } - public function test_get_components_method() { - $this->repo->shouldReceive('all')->once()->andReturn('foo'); + public function test_get_components_method() + { + $this->repo->shouldReceive('all')->once()->andReturn('foo'); - $controller = new CachetHQ\Cachet\Controllers\Api\ComponentController($this->repo); - $response = $controller->getComponents(); + $controller = new CachetHQ\Cachet\Controllers\Api\ComponentController($this->repo); + $response = $controller->getComponents(); - $this->assertEquals('foo', $response); - } + $this->assertEquals('foo', $response); + } - public function test_get_component_method() { - $this->repo->shouldReceive('findOrFail')->with(1)->once()->andReturn('foo'); + public function test_get_component_method() + { + $this->repo->shouldReceive('findOrFail')->with(1)->once()->andReturn('foo'); - $controller = new CachetHQ\Cachet\Controllers\Api\ComponentController($this->repo); - $response = $controller->getComponent(1); + $controller = new CachetHQ\Cachet\Controllers\Api\ComponentController($this->repo); + $response = $controller->getComponent(1); - $this->assertEquals('foo', $response); - } - + $this->assertEquals('foo', $response); + } } diff --git a/app/tests/TestCase.php b/app/tests/TestCase.php index 64b3ad51b..e21b85b03 100644 --- a/app/tests/TestCase.php +++ b/app/tests/TestCase.php @@ -1,18 +1,19 @@ groupBy('status') ->orderBy('status', 'desc'); @@ -19,6 +19,6 @@ View::composer('index', function($view) { $view->with([ 'systemStatus' => $status, - 'systemMessage' => $message + 'systemMessage' => $message, ]); }); diff --git a/bootstrap/autoload.php b/bootstrap/autoload.php index 6b329312a..96712ce4b 100644 --- a/bootstrap/autoload.php +++ b/bootstrap/autoload.php @@ -27,9 +27,8 @@ require __DIR__.'/../vendor/autoload.php'; | */ -if (file_exists($compiled = __DIR__.'/compiled.php')) -{ - require $compiled; +if (file_exists($compiled = __DIR__.'/compiled.php')) { + require $compiled; } /* @@ -69,7 +68,6 @@ Illuminate\Support\ClassLoader::register(); | */ -if (is_dir($workbench = __DIR__.'/../workbench')) -{ - Illuminate\Workbench\Starter::start($workbench); +if (is_dir($workbench = __DIR__.'/../workbench')) { + Illuminate\Workbench\Starter::start($workbench); } diff --git a/bootstrap/paths.php b/bootstrap/paths.php index 5a1f640ba..0f52811e1 100644 --- a/bootstrap/paths.php +++ b/bootstrap/paths.php @@ -1,57 +1,57 @@ __DIR__.'/../app', + 'app' => __DIR__.'/../app', - /* - |-------------------------------------------------------------------------- - | Public Path - |-------------------------------------------------------------------------- - | - | The public path contains the assets for your web application, such as - | your JavaScript and CSS files, and also contains the primary entry - | point for web requests into these applications from the outside. - | - */ + /* + |-------------------------------------------------------------------------- + | Public Path + |-------------------------------------------------------------------------- + | + | The public path contains the assets for your web application, such as + | your JavaScript and CSS files, and also contains the primary entry + | point for web requests into these applications from the outside. + | + */ - 'public' => __DIR__.'/../public', + 'public' => __DIR__.'/../public', - /* - |-------------------------------------------------------------------------- - | Base Path - |-------------------------------------------------------------------------- - | - | The base path is the root of the Laravel installation. Most likely you - | will not need to change this value. But, if for some wild reason it - | is necessary you will do so here, just proceed with some caution. - | - */ + /* + |-------------------------------------------------------------------------- + | Base Path + |-------------------------------------------------------------------------- + | + | The base path is the root of the Laravel installation. Most likely you + | will not need to change this value. But, if for some wild reason it + | is necessary you will do so here, just proceed with some caution. + | + */ - 'base' => __DIR__.'/..', + 'base' => __DIR__.'/..', - /* - |-------------------------------------------------------------------------- - | Storage Path - |-------------------------------------------------------------------------- - | - | The storage path is used by Laravel to store cached Blade views, logs - | and other pieces of information. You may modify the path here when - | you want to change the location of this directory for your apps. - | - */ + /* + |-------------------------------------------------------------------------- + | Storage Path + |-------------------------------------------------------------------------- + | + | The storage path is used by Laravel to store cached Blade views, logs + | and other pieces of information. You may modify the path here when + | you want to change the location of this directory for your apps. + | + */ - 'storage' => __DIR__.'/../app/storage', + 'storage' => __DIR__.'/../app/storage', -); +]; diff --git a/bootstrap/start.php b/bootstrap/start.php index 2d5554f62..465e5228b 100644 --- a/bootstrap/start.php +++ b/bootstrap/start.php @@ -11,7 +11,7 @@ | */ -$app = new Illuminate\Foundation\Application; +$app = new Illuminate\Foundation\Application(); /* |-------------------------------------------------------------------------- @@ -24,10 +24,10 @@ $app = new Illuminate\Foundation\Application; | */ -$env = $app->detectEnvironment(function() { +$env = $app->detectEnvironment(function () { - // Set the environment if set, otherwise it's local - return getenv('ENV') ?: 'local'; + // Set the environment if set, otherwise it's local + return getenv('ENV') ?: 'local'; }); /* diff --git a/server.php b/server.php index 5f187f344..9b94ed3e6 100644 --- a/server.php +++ b/server.php @@ -11,9 +11,8 @@ $requested = $paths['public'].$uri; // This file allows us to emulate Apache's "mod_rewrite" functionality from the // built-in PHP web server. This provides a convenient way to test a Laravel // application without having installed a "real" web server software here. -if ($uri !== '/' and file_exists($requested)) -{ - return false; +if ($uri !== '/' and file_exists($requested)) { + return false; } require_once $paths['public'].'/index.php';