canonical() === $phone->canonical() ) { return true; } } return '' !== $ip && in_array( $ip, self::listed( 'test_ips' ), true ); } /** * One of the allow-lists, split on commas, spaces and new lines. * * @param string $key Setting key. * * @return list */ private static function listed( string $key ): array { $raw = (string) Settings::get( OtpAuthModule::SLUG . '.' . $key, '' ); return array_values( array_filter( array_map( 'trim', preg_split( '/[\s,،]+/u', $raw ) ?: [] ) ) ); } }