Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
[ci skip] [skip ci]
  • Loading branch information
JayBizzle authored and StyleCIBot committed Oct 12, 2020
1 parent f990698 commit 329e683
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Doc.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public function __construct(string $binPath = null)
$this->binPath = $binPath ?? '/usr/bin/antiword';
}

public function setDoc(string $doc) : self
public function setDoc(string $doc): self
{
if (! is_readable($doc)) {
if (!is_readable($doc)) {
throw new DocNotFound(sprintf('could not find or read doc `%s`', $doc));
}

Expand All @@ -30,9 +30,9 @@ public function setDoc(string $doc) : self
return $this;
}

public function setOptions(array $options) : self
public function setOptions(array $options): self
{
$mapper = function (string $content) : array {
$mapper = function (string $content): array {
$content = trim($content);
if ('-' !== ($content[0] ?? '')) {
$content = '-'.$content;
Expand All @@ -41,7 +41,7 @@ public function setOptions(array $options) : self
return explode(' ', $content, 2);
};

$reducer = function (array $carry, array $option) : array {
$reducer = function (array $carry, array $option): array {
return array_merge($carry, $option);
};

Expand All @@ -50,18 +50,18 @@ public function setOptions(array $options) : self
return $this;
}

public function text() : string
public function text(): string
{
$process = new Process(array_merge([$this->binPath], $this->options, [$this->doc]));
$process->run();
if (! $process->isSuccessful()) {
if (!$process->isSuccessful()) {
throw new CouldNotExtractText($process);
}

return trim($process->getOutput(), " \t\n\r\0\x0B\x0C");
}

public static function getText(string $doc, string $binPath = null, array $options = []) : string
public static function getText(string $doc, string $binPath = null, array $options = []): string
{
return (new static($binPath))
->setOptions($options)
Expand Down

0 comments on commit 329e683

Please sign in to comment.