Code Duplication    Length = 11-12 lines in 2 locations

src/QRCode.php 2 locations

@@ 271-282 (lines=12) @@
268
	 *
269
	 * @return bool
270
	 */
271
	public function isNumber(string $string):bool {
272
		$len = strlen($string);
273
		$map = str_split('0123456789');
274
275
		for($i = 0; $i < $len; $i++){
276
			if(!in_array($string[$i], $map, true)){
277
				return false;
278
			}
279
		}
280
281
		return true;
282
	}
283
284
	/**
285
	 * checks if a string qualifies as alphanumeric
@@ 291-301 (lines=11) @@
288
	 *
289
	 * @return bool
290
	 */
291
	public function isAlphaNum(string $string):bool {
292
		$len = strlen($string);
293
294
		for($i = 0; $i < $len; $i++){
295
			if(!in_array($string[$i], AlphaNum::CHAR_MAP, true)){
296
				return false;
297
			}
298
		}
299
300
		return true;
301
	}
302
303
	/**
304
	 * checks if a string qualifies as Kanji