Skip to content

Commit

Permalink
Merge pull request #1 from darrynten/analysis-XVon1V
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
darrynten authored Feb 12, 2017
2 parents 16c1afb + c191635 commit 1c0abad
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function __construct($config)

/**
* TODO
if (isset($config['authCache']) && !empty($config['authCache'])) {
$this->authCache = (bool)$config['cache'];
}
Expand Down
7 changes: 2 additions & 5 deletions src/GoogleNaturalLanguage.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ private function _checkCheapskate()
*
* @return void
*/
public function setType($type)
public function setType($type)
{
if (Validation::isValidType($type)) {
$this->config->type = $type;
Expand All @@ -195,7 +195,7 @@ public function setType($type)
*
* @return void
*/
public function setEncoding($encoding)
public function setEncoding($encoding)
{
if (Validation::isValidEncoding($encoding)) {
$this->config->encoding = $encoding;
Expand Down Expand Up @@ -240,6 +240,3 @@ public function setCache($value)
$this->config->cache = (bool)$value;
}
}



Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public function testApiException()
], 'xxx');
}

public function testApiJsonException() {
public function testApiJsonException()
{
$this->expectException(CustomException::class);

throw new CustomException(json_encode(
Expand All @@ -32,7 +33,8 @@ public function testApiJsonException() {
));
}

public function testCheapskateTriggerException() {
public function testCheapskateTriggerException()
{
$this->expectException(CustomException::class);

$config = [
Expand All @@ -45,4 +47,3 @@ public function testCheapskateTriggerException() {
$instance->setText(str_repeat('test ', 1000));
}
}

26 changes: 14 additions & 12 deletions tests/GoogleNaturalLanguagePhp/GoogleNaturalLanguageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

use DarrynTen\GoogleNaturalLanguagePhp\GoogleNaturalLanguage;

class GoogleNaturalLanguagePhpTest extends PHPUnit_Framework_TestCase
class GoogleNaturalLanguageTest extends PHPUnit_Framework_TestCase
{
public function testConstruct()
{
Expand All @@ -19,7 +19,8 @@ public function testConstruct()
$this->assertInstanceOf(GoogleNaturalLanguage::class, $instance);
}

public function testSet() {
public function testSet()
{
$config = [
'projectId' => 'project-id',
'cheapskate' => true,
Expand Down Expand Up @@ -59,7 +60,8 @@ public function testSet() {
$instance->setCache(true);
}

public function testGetEntities() {
public function testGetEntities()
{
if (getenv('DO_LIVE_API_TESTS') == "true") {
$config = [
'projectId' => 'project-id',
Expand Down Expand Up @@ -87,9 +89,10 @@ public function testGetEntities() {
}
}

public function testGetSyntax() {
public function testGetSyntax()
{
if (getenv('DO_LIVE_API_TESTS') == "true") {
$config = [
$config = [
'projectId' => 'project-id',
'cheapskate' => true,
'cache' => true,
Expand Down Expand Up @@ -117,9 +120,10 @@ public function testGetSyntax() {
}
}

public function testGetSentiment() {
public function testGetSentiment()
{
if (getenv('DO_LIVE_API_TESTS') == "true") {
$config = [
$config = [
'projectId' => 'project-id',
'cheapskate' => true,
'cache' => true,
Expand All @@ -140,9 +144,10 @@ public function testGetSentiment() {
}
}

public function testGetAll() {
public function testGetAll()
{
if (getenv('DO_LIVE_API_TESTS') == "true") {
$config = [
$config = [
'projectId' => 'project-id',
'cheapskate' => true,
'cache' => true,
Expand Down Expand Up @@ -171,9 +176,6 @@ public function testGetAll() {
$this->assertInternalType('string', $language);

$this->assertEquals('en', $language);

}
}
}


0 comments on commit 1c0abad

Please sign in to comment.