<commit_before><?php

namespace Shoptet\Spayd\Utilities;

use Shoptet\Spayd\Exceptions;

class IbanUtilities {
	
	public static function computeIBANFromCzechBankAccount(\Shoptet\Spayd\Model\CzechAccount $czechAccount) {
		if ($czechAccount->isValid()) {
			$prefix = sprintf('%06d', $czechAccount->getPrefix());
			$accountNumber = sprintf('%010d', $czechAccount->getAccountNumber());
			$bankCode = sprintf('%04d', $czechAccount->getBankCode());
		}
		
		$accountBuffer = $bankCode . $prefix . $accountNumber . $czechAccount->getNumericLanguageCode();
		$checksum = sprintf('%02d', (98 - bcmod($accountBuffer, 97)));
		
		// build the IBAN number
		return 'CZ' . $checksum . $bankCode . $prefix . $accountNumber;
	}
}<commit_msg>Return FALSE when account is not valid<commit_after><?php

namespace Shoptet\Spayd\Utilities;

use Shoptet\Spayd\Exceptions;

class IbanUtilities {
	
	public static function computeIBANFromCzechBankAccount(\Shoptet\Spayd\Model\CzechAccount $czechAccount) {
		if ($czechAccount->isValid()) {
			$prefix = sprintf('%06d', $czechAccount->getPrefix());
			$accountNumber = sprintf('%010d', $czechAccount->getAccountNumber());
			$bankCode = sprintf('%04d', $czechAccount->getBankCode());
			
			$accountBuffer = $bankCode . $prefix . $accountNumber . $czechAccount->getNumericLanguageCode();
			$checksum = sprintf('%02d', (98 - bcmod($accountBuffer, 97)));

			// build the IBAN number
			return 'CZ' . $checksum . $bankCode . $prefix . $accountNumber;
		} else {
			return FALSE;
		}
	}
}
{'fraction_non_alphanumeric': 0.1550131926121372, 'fraction_numerical': 0.017150395778364115, 'mean_word_length': 4.87984496124031, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3824212', 'n_tokens_mistral': 557, 'n_tokens_neox': 508, 'n_words': 95}