Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.

Commit 864a314

Browse files
committed
Merge branch 'master' into 0.1
2 parents f074b90 + 055e42b commit 864a314

19 files changed

+57
-49
lines changed

.styleci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
preset: laravel
2+
3+
disabled:
4+
- concat_without_spaces
5+
6+
enabled:
7+
- concat_with_spaces

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/f61e9357-250f-4816-b6c0-ae1ec0bcaa42/big.png)](https://insight.sensiolabs.com/projects/f61e9357-250f-4816-b6c0-ae1ec0bcaa42)
44

55
[![StyleCI](https://styleci.io/repos/59981815/shield?style=flat)](https://styleci.io/repos/59981815)
6+
[![Dependency Status](https://dependencyci.com/github/findbrok/laravel-tradeoff-analytics/badge)](https://dependencyci.com/github/findbrok/laravel-tradeoff-analytics)
67
[![Build Status](https://travis-ci.org/findbrok/laravel-tradeoff-analytics.svg?branch=master)](https://travis-ci.org/findbrok/laravel-tradeoff-analytics)
78
[![Latest Stable Version](https://poser.pugx.org/findbrok/laravel-tradeoff-analytics/v/stable)](https://packagist.org/packages/findbrok/laravel-tradeoff-analytics)
89
[![Total Downloads](https://poser.pugx.org/findbrok/laravel-tradeoff-analytics/downloads)](https://packagist.org/packages/findbrok/laravel-tradeoff-analytics)

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"require": {
1313
"php": ">=5.5.0",
1414
"findbrok/php-watson-api-bridge": "1.0.*",
15-
"laravel/framework": "5.0.*|5.1.*|5.2.*",
15+
"laravel/framework": "5.0 - 5.3",
1616
"nesbot/carbon": "1.21.*"
1717
},
1818
"require-dev": {

src/AbstractEngine.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ public function getCredentialName()
122122
public function getCredentials()
123123
{
124124
return [
125-
'username' => config('tradeoff-analytics.credentials.'.$this->getCredentialName().'.username'),
126-
'password' => config('tradeoff-analytics.credentials.'.$this->getCredentialName().'.password'),
127-
'url' => config('tradeoff-analytics.credentials.'.$this->getCredentialName().'.url'),
125+
'username' => config('tradeoff-analytics.credentials.' . $this->getCredentialName() . '.username'),
126+
'password' => config('tradeoff-analytics.credentials.' . $this->getCredentialName() . '.password'),
127+
'url' => config('tradeoff-analytics.credentials.' . $this->getCredentialName() . '.url'),
128128
];
129129
}
130130

src/Engine.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function getDilemma(Problem $problem, $generateVisualization = true)
2424
{
2525
//Get Response from Watson
2626
$response = $this->makeBridge()->post(
27-
'v1/dilemmas?generate_visualization='.var_export($generateVisualization, true),
27+
'v1/dilemmas?generate_visualization=' . var_export($generateVisualization, true),
2828
$problem->statement()
2929
);
3030
//Get Response content

src/Support/DataCollection/BaseCollector.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct($items = [])
2727
*/
2828
public function hasSupportedFields()
2929
{
30-
return property_exists($this, 'supportedFields') && !empty($this->supportedFields);
30+
return property_exists($this, 'supportedFields') && ! empty($this->supportedFields);
3131
}
3232

3333
/**
@@ -52,7 +52,7 @@ public function isFieldSupported($field)
5252
public function filterOutUnsupported($items = [])
5353
{
5454
return collect($items)->reject(function ($item, $key) {
55-
return $this->hasSupportedFields() && !in_array($key, $this->supportedFields);
55+
return $this->hasSupportedFields() && ! in_array($key, $this->supportedFields);
5656
})->all();
5757
}
5858

@@ -69,7 +69,7 @@ public function filterOutUnsupported($items = [])
6969
public function put($key, $value)
7070
{
7171
//Field not supported
72-
if (!$this->isFieldSupported($key)) {
72+
if (! $this->isFieldSupported($key)) {
7373
throw new DataCollectionUnsupportedFieldException($key, get_class($this));
7474
}
7575
//Parent Put
@@ -99,7 +99,7 @@ public function merge($items)
9999
public function add($items = [])
100100
{
101101
//Column not empty
102-
if (!$this->isEmpty()) {
102+
if (! $this->isEmpty()) {
103103
$this->items = $this->merge($items)->all();
104104

105105
return $this;

src/Support/DataCollection/BaseCollectorRange.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class BaseCollectorRange extends BaseCollector
1515
public function __construct($items = [])
1616
{
1717
//We have range
18-
if (!empty($items)) {
18+
if (! empty($items)) {
1919
$this->defineRange($this->filterOutUnsupported($items));
2020
}
2121
}

src/Support/DataCollection/Dilemma.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Dilemma extends Collection
1616
*/
1717
public function hasProblem()
1818
{
19-
return $this->has('problem') && !collect($this->get('problem'))->isEmpty();
19+
return $this->has('problem') && ! collect($this->get('problem'))->isEmpty();
2020
}
2121

2222
/**
@@ -40,7 +40,7 @@ public function getProblem()
4040
*/
4141
public function hasResolution()
4242
{
43-
return $this->has('resolution') && !collect($this->get('resolution'))->isEmpty();
43+
return $this->has('resolution') && ! collect($this->get('resolution'))->isEmpty();
4444
}
4545

4646
/**

src/Support/DataCollection/Problem.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class Problem extends BaseCollector
6666
*/
6767
protected function validateColumnField($item)
6868
{
69-
if (!$item instanceof ProblemColumn) {
69+
if (! $item instanceof ProblemColumn) {
7070
throw new DataCollectionFieldMissMatchTypeException('columns', 'Problem', 'ProblemColumn');
7171
}
7272
}
@@ -82,7 +82,7 @@ protected function validateColumnField($item)
8282
*/
8383
protected function validateOptionField($item)
8484
{
85-
if (!$item instanceof ProblemOption) {
85+
if (! $item instanceof ProblemOption) {
8686
throw new DataCollectionFieldMissMatchTypeException('options', 'Problem', 'ProblemOption');
8787
}
8888
}
@@ -164,15 +164,15 @@ public function objectifyColumns()
164164
{
165165
//Objectify each column
166166
$columns = collect($this->get('columns'))->transform(function ($item) {
167-
if (!$item instanceof ProblemColumn) {
167+
if (! $item instanceof ProblemColumn) {
168168
return make_tradeoff_problem_column($item);
169169
}
170170

171171
return $item;
172172
});
173173

174174
//Put in field if we have items
175-
if (!$columns->isEmpty()) {
175+
if (! $columns->isEmpty()) {
176176
$this->put('columns', $columns->all());
177177
}
178178

@@ -188,15 +188,15 @@ public function objectifyOptions()
188188
{
189189
//Objectify each column options
190190
$options = collect($this->get('options'))->transform(function ($item) {
191-
if (!$item instanceof ProblemOption) {
191+
if (! $item instanceof ProblemOption) {
192192
return make_tradeoff_problem_option($item);
193193
}
194194

195195
return $item;
196196
});
197197

198198
//Put in field if we have items
199-
if (!$options->isEmpty()) {
199+
if (! $options->isEmpty()) {
200200
$this->put('options', $options->all());
201201
}
202202

src/Support/DataCollection/ProblemColumnDateRange.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ public function defineRange($range = [])
5656
//Collect range
5757
$range = collect($range);
5858
//Validate Range
59-
if (!$range->has('high') && !$range->has('low')) {
59+
if (! $range->has('high') && ! $range->has('low')) {
6060
throw new Exception('Missing {high} or {low} field in {ProblemColumnDateRange} object', 422);
6161
}
6262
//Transform to toIso8601String
6363
$this->items = $range->transform(function ($item, $key) {
64-
if (!$item instanceof Carbon) {
64+
if (! $item instanceof Carbon) {
6565
throw new DataCollectionFieldMissMatchTypeException($key, 'ProblemColumnCategoricalRange', 'Carbon\Carbon');
6666
}
6767

0 commit comments

Comments
 (0)