From 20bede658777f560d7841bfbcf680a2e09669920 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Wed, 12 Dec 2018 11:12:38 -0600 Subject: [PATCH] Minor consistency fixes for #69 - Modifies `$options` declaration to use `array` for the type. - No parens needed around ternary statements as argument values. - Add space after casting operators. --- src/StringPrefix.php | 9 ++++----- src/StringSuffix.php | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/StringPrefix.php b/src/StringPrefix.php index 31981c44..8b445585 100644 --- a/src/StringPrefix.php +++ b/src/StringPrefix.php @@ -12,7 +12,7 @@ class StringPrefix extends AbstractFilter { /** - * @var string[] + * @var array */ protected $options = [ 'prefix' => null, @@ -31,8 +31,7 @@ public function __construct($options = null) /** * Set the prefix string * - * @param string $prefix - * + * @param string $prefix * @return self * @throws Exception\InvalidArgumentException */ @@ -42,7 +41,7 @@ public function setPrefix($prefix) throw new Exception\InvalidArgumentException(sprintf( '%s expects "prefix" to be string; received "%s"', __METHOD__, - (is_object($prefix) ? get_class($prefix) : gettype($prefix)) + is_object($prefix) ? get_class($prefix) : gettype($prefix) )); } @@ -77,7 +76,7 @@ public function filter($value) return $value; } - $value = (string)$value; + $value = (string) $value; return $this->getPrefix() . $value; } diff --git a/src/StringSuffix.php b/src/StringSuffix.php index 5142b567..c0170c2f 100644 --- a/src/StringSuffix.php +++ b/src/StringSuffix.php @@ -12,7 +12,7 @@ class StringSuffix extends AbstractFilter { /** - * @var string[] + * @var array */ protected $options = [ 'suffix' => null, @@ -42,7 +42,7 @@ public function setSuffix($suffix) throw new Exception\InvalidArgumentException(sprintf( '%s expects "suffix" to be string; received "%s"', __METHOD__, - (is_object($suffix) ? get_class($suffix) : gettype($suffix)) + is_object($suffix) ? get_class($suffix) : gettype($suffix) )); } @@ -78,7 +78,7 @@ public function filter($value) return $value; } - $value = (string)$value; + $value = (string) $value; return $value . $this->getSuffix(); }