Skip to content

Commit 5220f21

Browse files
committed
linter fixes for language
1 parent 60c381c commit 5220f21

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

language/api/language.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@
1414
$application->add(new AnalyzeSentimentCommand());
1515
$application->add(new AnalyzeSyntaxCommand());
1616
$application->run();
17-

language/api/src/functions/print_annotation.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,38 +19,38 @@
1919

2020
use Google\Cloud\NaturalLanguage\Annotation;
2121

22-
function print_annotation(Annotation $annotation) {
22+
function print_annotation(Annotation $annotation)
23+
{
2324
$info = $annotation->info();
2425
if (isset($info['language'])) {
2526
print "language: " . $info['language'] . "\n";
2627
}
2728

28-
if (isset($info['documentSentiment']))
29-
{
29+
if (isset($info['documentSentiment'])) {
3030
$magnitude = $info['documentSentiment']['magnitude'];
3131
$polarity = $info['documentSentiment']['polarity'];
32-
if ($polarity < 0)
32+
if ($polarity < 0) {
3333
$magnitude = -$magnitude;
34+
}
3435
print "sentiment: " . $magnitude . "\n";
3536
}
3637

37-
if (isset($info['sentences']))
38-
{
38+
if (isset($info['sentences'])) {
3939
print "sentences:\n";
4040
foreach ($info['sentences'] as $sentence) {
4141
print " " . $sentence['text']['beginOffset'] . ": " .
4242
$sentence['text']['content'] . "\n";
4343
}
4444
}
4545

46-
if (isset($info['entities']))
47-
{
46+
if (isset($info['entities'])) {
4847
print "entities:\n";
4948
foreach ($info['entities'] as $entity) {
5049
print " " . $entity['name'];
51-
if (isset($entity['metadata']['wikipedia_url']))
50+
if (isset($entity['metadata']['wikipedia_url'])) {
5251
print ": " . $entity['metadata']['wikipedia_url'];
52+
}
5353
print "\n";
5454
}
5555
}
56-
}
56+
}

0 commit comments

Comments
 (0)