Code Duplication    Length = 11-12 lines in 2 locations

src/QRCode.php 2 locations

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