Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ return PhpCsFixer\Config::create()
'concat_space' => ['spacing' => 'one'],
'no_unused_imports' => true,
'method_argument_space' => false,
'whitespace_after_comma_in_array' => true,
'method_argument_space' => [
'keep_multiple_spaces_after_comma' => true
],
])
->setFinder(
PhpCsFixer\Finder::create()
Expand Down
2 changes: 1 addition & 1 deletion dialogflow/test/sessionEntityTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static function setUpBeforeClass()

public function testCreateSessionEntityType()
{
$response = $this->runCommand('entity-type-create',[
$response = $this->runCommand('entity-type-create', [
'display-name' => self::$entityTypeDisplayName
]);
$this->runCommand('session-entity-type-create', [
Expand Down
4 changes: 2 additions & 2 deletions spanner/src/read_write_transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function read_write_transaction($instanceId, $databaseId)
$transferAmount = 200000;

// Read the second album's budget.
$secondAlbumKey = [2,2];
$secondAlbumKey = [2, 2];
$secondAlbumKeySet = $spanner->keySet(['keys' => [$secondAlbumKey]]);
$secondAlbumResult = $t->read(
'Albums',
Expand All @@ -74,7 +74,7 @@ function read_write_transaction($instanceId, $databaseId)
);
}

$firstAlbumKey = [1,1];
$firstAlbumKey = [1, 1];
$firstAlbumKeySet = $spanner->keySet(['keys' => [$firstAlbumKey]]);
$firstAlbumResult = $t->read(
'Albums',
Expand Down
4 changes: 2 additions & 2 deletions speech/test/speechTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ public function testTranscribeModel()
[$path, 'video']
);
// $this->assertContains('the weather outside is sunny',$output);
$this->assertContains('how old is the Brooklyn Bridge',$output);
$this->assertContains('how old is the Brooklyn Bridge', $output);
}

public function testTranscribePunctuation()
{
$path = __DIR__ . '/data/audio32KHz.raw';
$output = $this->runSnippet('transcribe_auto_punctuation', [$path]);
$this->assertContains('How old is the Brooklyn Bridge',$output);
$this->assertContains('How old is the Brooklyn Bridge', $output);
}

/** @dataProvider provideTranscribe */
Expand Down
12 changes: 6 additions & 6 deletions texttospeech/test/textToSpeechTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function testSynthesizeSsml()
['<speak>Hello there.</speak>']
);
$this->assertContains('Audio content written to', $output);
$this->assertGreaterThan(0,filesize('output.mp3'));
$this->assertGreaterThan(0, filesize('output.mp3'));
unlink('output.mp3');
}

Expand All @@ -49,7 +49,7 @@ public function testSynthesizeText()
$output = $this->runSnippet('synthesize_text', ['hello there']);

$this->assertContains('Audio content written to', $output);
$this->assertGreaterThan(0,filesize('output.mp3'));
$this->assertGreaterThan(0, filesize('output.mp3'));
unlink('output.mp3');
}

Expand All @@ -60,7 +60,7 @@ public function testSynthesizeTextEffectsProfile()
['hello there', 'telephony-class-application']
);
$this->assertContains('Audio content written to', $output);
$this->assertGreaterThan(0,filesize('output.mp3'));
$this->assertGreaterThan(0, filesize('output.mp3'));
unlink('output.mp3');
}

Expand All @@ -70,7 +70,7 @@ public function testSynthesizeSsmlFile()
$output = $this->runSnippet('synthesize_ssml_file', [$path]);

$this->assertContains('Audio content written to', $output);
$this->assertGreaterThan(0,filesize('output.mp3'));
$this->assertGreaterThan(0, filesize('output.mp3'));
unlink('output.mp3');
}

Expand All @@ -80,7 +80,7 @@ public function testSynthesizeTextFile()
$output = $this->runSnippet('synthesize_text_file', [$path]);

$this->assertContains('Audio content written to', $output);
$this->assertGreaterThan(0,filesize('output.mp3'));
$this->assertGreaterThan(0, filesize('output.mp3'));
unlink('output.mp3');
}

Expand All @@ -92,7 +92,7 @@ public function testSynthesizeTextEffectsProfileFile()
[$path, 'telephony-class-application']
);
$this->assertContains('Audio content written to', $output);
$this->assertGreaterThan(0,filesize('output.mp3'));
$this->assertGreaterThan(0, filesize('output.mp3'));
unlink('output.mp3');
}
}
2 changes: 1 addition & 1 deletion vision/src/detect_crop_hints.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function detect_crop_hints($path)
$bounds[] = sprintf('(%d,%d)', $vertex->getX(),
$vertex->getY());
}
print('Bounds: ' . join(', ',$bounds) . PHP_EOL);
print('Bounds: ' . join(', ', $bounds) . PHP_EOL);
}
} else {
print('No crop hints' . PHP_EOL);
Expand Down
2 changes: 1 addition & 1 deletion vision/src/detect_crop_hints_gcs.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function detect_crop_hints_gcs($path)
$bounds[] = sprintf('(%d,%d)', $vertex->getX(),
$vertex->getY());
}
print('Bounds: ' . join(', ',$bounds) . PHP_EOL);
print('Bounds: ' . join(', ', $bounds) . PHP_EOL);
}
} else {
print('No crop hints' . PHP_EOL);
Expand Down
2 changes: 1 addition & 1 deletion vision/src/detect_document_text.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function detect_document_text($path)
$bounds[] = sprintf('(%d,%d)', $vertex->getX(),
$vertex->getY());
}
print('Bounds: ' . join(', ',$bounds) . PHP_EOL);
print('Bounds: ' . join(', ', $bounds) . PHP_EOL);
print(PHP_EOL);
}
}
Expand Down
2 changes: 1 addition & 1 deletion vision/src/detect_document_text_gcs.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function detect_document_text_gcs($path)
$bounds[] = sprintf('(%d,%d)', $vertex->getX(),
$vertex->getY());
}
print('Bounds: ' . join(', ',$bounds) . PHP_EOL);
print('Bounds: ' . join(', ', $bounds) . PHP_EOL);

print(PHP_EOL);
}
Expand Down
4 changes: 2 additions & 2 deletions vision/src/detect_face.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function detect_face($path, $outFile = null)

# names of likelihood from google.cloud.vision.enums
$likelihoodName = ['UNKNOWN', 'VERY_UNLIKELY', 'UNLIKELY',
'POSSIBLE','LIKELY', 'VERY_LIKELY'];
'POSSIBLE', 'LIKELY', 'VERY_LIKELY'];

printf("%d faces found:" . PHP_EOL, count($faces));
foreach ($faces as $face) {
Expand All @@ -57,7 +57,7 @@ function detect_face($path, $outFile = null)
foreach ($vertices as $vertex) {
$bounds[] = sprintf('(%d,%d)', $vertex->getX(), $vertex->getY());
}
print('Bounds: ' . join(', ',$bounds) . PHP_EOL);
print('Bounds: ' . join(', ', $bounds) . PHP_EOL);
print(PHP_EOL);
}
// [END vision_face_detection]
Expand Down
4 changes: 2 additions & 2 deletions vision/src/detect_face_gcs.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function detect_face_gcs($path)

# names of likelihood from google.cloud.vision.enums
$likelihoodName = ['UNKNOWN', 'VERY_UNLIKELY', 'UNLIKELY',
'POSSIBLE','LIKELY', 'VERY_LIKELY'];
'POSSIBLE', 'LIKELY', 'VERY_LIKELY'];

printf("%d faces found:" . PHP_EOL, count($faces));
foreach ($faces as $face) {
Expand All @@ -51,7 +51,7 @@ function detect_face_gcs($path)
foreach ($vertices as $vertex) {
$bounds[] = sprintf('(%d,%d)', $vertex->getX(), $vertex->getY());
}
print('Bounds: ' . join(', ',$bounds) . PHP_EOL);
print('Bounds: ' . join(', ', $bounds) . PHP_EOL);
print(PHP_EOL);
}

Expand Down
2 changes: 1 addition & 1 deletion vision/src/detect_safe_search.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function detect_safe_search($path)

# names of likelihood from google.cloud.vision.enums
$likelihoodName = ['UNKNOWN', 'VERY_UNLIKELY', 'UNLIKELY',
'POSSIBLE','LIKELY', 'VERY_LIKELY'];
'POSSIBLE', 'LIKELY', 'VERY_LIKELY'];

printf("Adult: %s" . PHP_EOL, $likelihoodName[$adult]);
printf("Medical: %s" . PHP_EOL, $likelihoodName[$medical]);
Expand Down
2 changes: 1 addition & 1 deletion vision/src/detect_safe_search_gcs.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function detect_safe_search_gcs($path)

# names of likelihood from google.cloud.vision.enums
$likelihoodName = ['UNKNOWN', 'VERY_UNLIKELY', 'UNLIKELY',
'POSSIBLE','LIKELY', 'VERY_LIKELY'];
'POSSIBLE', 'LIKELY', 'VERY_LIKELY'];

printf("Adult: %s" . PHP_EOL, $likelihoodName[$adult]);
printf("Medical: %s" . PHP_EOL, $likelihoodName[$medical]);
Expand Down
2 changes: 1 addition & 1 deletion vision/src/detect_text.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function detect_text($path)
foreach ($vertices as $vertex) {
$bounds[] = sprintf('(%d,%d)', $vertex->getX(), $vertex->getY());
}
print('Bounds: ' . join(', ',$bounds) . PHP_EOL);
print('Bounds: ' . join(', ', $bounds) . PHP_EOL);
}

$imageAnnotator->close();
Expand Down
2 changes: 1 addition & 1 deletion vision/src/detect_text_gcs.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function detect_text_gcs($path)
foreach ($vertices as $vertex) {
$bounds[] = sprintf('(%d,%d)', $vertex->getX(), $vertex->getY());
}
print('Bounds: ' . join(', ',$bounds) . PHP_EOL);
print('Bounds: ' . join(', ', $bounds) . PHP_EOL);
}

if ($error = $response->getError()) {
Expand Down
2 changes: 1 addition & 1 deletion vision/vision.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@
->setCode(function ($input, $output) {
$path = $input->getArgument('path');
$output = $input->getArgument('output');
detect_pdf_gcs($path,$output);
detect_pdf_gcs($path, $output);
})
);

Expand Down