Skip to content

Commit

Permalink
Fix bug in Command::text()
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierstoval committed Mar 8, 2019
1 parent 11dfa2f commit 143c645
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -597,9 +597,8 @@ public function rawCommand(string $command, bool $append = false): self
*/
public function text(array $options = []): self
{
$mandatoryKeys = ['text', 'geometry', 'textSize'];
foreach ($options as $key => $v) {
if (!isset($mandatoryKeys[$key])) {
foreach (['text', 'geometry', 'textSize'] as $key) {
if (!isset($options[$key])) {
throw new \InvalidArgumentException(\sprintf('Key "%s" is missing for the %s function.', $key, __METHOD__));
}
}
Expand All @@ -624,7 +623,8 @@ public function text(array $options = []): self
$this->stroke('none');

$this->command[] = '-annotate';
$this->command[] = '"'.$this->ref->geometry($geometry).'"'.$text;
$this->command[] = '"'.$this->ref->geometry($geometry).'"';
$this->command[] = \escapeshellarg($text);

return $this;
}
Expand Down

0 comments on commit 143c645

Please sign in to comment.