@@ -25,9 +25,9 @@ final class Arrays
2525 *
2626 * @throws \InvalidArgumentException if $minCount was not an int
2727 * @throws \InvalidArgumentException if $maxCount was not an int
28- * @throws \ Exception if $value is not an array
29- * @throws \ Exception if $value count is less than $minCount
30- * @throws \ Exception if $value count is greater than $maxCount
28+ * @throws Exception if $value is not an array
29+ * @throws Exception if $value count is less than $minCount
30+ * @throws Exception if $value count is greater than $maxCount
3131 */
3232 public static function filter ($ value , $ minCount = 1 , $ maxCount = PHP_INT_MAX )
3333 {
@@ -40,22 +40,22 @@ public static function filter($value, $minCount = 1, $maxCount = PHP_INT_MAX)
4040 }
4141
4242 if (!is_array ($ value )) {
43- throw new \ Exception ("Value ' " . trim (var_export ($ value , true ), "' " ) . "' is not an array " );
43+ throw new Exception ("Value ' " . trim (var_export ($ value , true ), "' " ) . "' is not an array " );
4444 }
4545
4646 //optimization for default case
4747 if ($ minCount === 1 && empty ($ value )) {
48- throw new \ Exception ('$value count of 0 is less than 1 ' );
48+ throw new Exception ('$value count of 0 is less than 1 ' );
4949 }
5050
5151 $ count = count ($ value );
5252
5353 if ($ count < $ minCount ) {
54- throw new \ Exception ("\$value count of {$ count } is less than {$ minCount }" );
54+ throw new Exception ("\$value count of {$ count } is less than {$ minCount }" );
5555 }
5656
5757 if ($ count > $ maxCount ) {
58- throw new \ Exception ("\$value count of {$ count } is greater than {$ maxCount }" );
58+ throw new Exception ("\$value count of {$ count } is greater than {$ maxCount }" );
5959 }
6060
6161 return $ value ;
@@ -74,7 +74,7 @@ public static function filter($value, $minCount = 1, $maxCount = PHP_INT_MAX)
7474 *
7575 * @see in_array()
7676 * @throws \InvalidArgumentException if $strict was not a bool
77- * @throws \ Exception if $value is not in array $haystack
77+ * @throws Exception if $value is not in array $haystack
7878 */
7979 public static function in ($ value , array $ haystack , $ strict = true )
8080 {
@@ -83,7 +83,7 @@ public static function in($value, array $haystack, $strict = true)
8383 }
8484
8585 if (!in_array ($ value , $ haystack , $ strict )) {
86- throw new \ Exception (
86+ throw new Exception (
8787 "Value ' " . trim (var_export ($ value , true ), "' " ) . "' is not in array " . var_export ($ haystack , true )
8888 );
8989 }
@@ -101,7 +101,7 @@ public static function in($value, array $haystack, $strict = true)
101101 *
102102 * @return array the filtered $values
103103 *
104- * @throws \ Exception if any member of $values fails filtering
104+ * @throws Exception if any member of $values fails filtering
105105 */
106106 public static function ofScalars (array $ values , array $ filters )
107107 {
@@ -112,7 +112,7 @@ public static function ofScalars(array $values, array $filters)
112112
113113 list ($ status , $ result , $ error ) = Filterer::filter ($ wrappedFilters , $ values );
114114 if (!$ status ) {
115- throw new \ Exception ($ error );
115+ throw new Exception ($ error );
116116 }
117117
118118 return $ result ;
@@ -128,7 +128,7 @@ public static function ofScalars(array $values, array $filters)
128128 *
129129 * @return array the filtered $values
130130 *
131- * @throws \ Exception if any member of $values fails filtering
131+ * @throws Exception if any member of $values fails filtering
132132 */
133133 public static function ofArrays (array $ values , array $ spec )
134134 {
@@ -150,7 +150,7 @@ public static function ofArrays(array $values, array $spec)
150150 }
151151
152152 if (!empty ($ errors )) {
153- throw new \ Exception (implode ("\n" , $ errors ));
153+ throw new Exception (implode ("\n" , $ errors ));
154154 }
155155
156156 return $ results ;
@@ -166,13 +166,13 @@ public static function ofArrays(array $values, array $spec)
166166 *
167167 * @return array the filtered $value
168168 *
169- * @throws \ Exception if $value fails filtering
169+ * @throws Exception if $value fails filtering
170170 */
171171 public static function ofArray (array $ value , array $ spec )
172172 {
173173 list ($ status , $ result , $ error ) = Filterer::filter ($ spec , $ value );
174174 if (!$ status ) {
175- throw new \ Exception ($ error );
175+ throw new Exception ($ error );
176176 }
177177
178178 return $ result ;
0 commit comments