<commit_before><?php
/**
 * Laravel 4 Core
 *
 * @author   <NAME> <<EMAIL>>
 * @license  http://opensource.org/licenses/MIT
 * @package  l4-core
 */

namespace anlutro\Core\Auth\Laravel;

use Illuminate\Auth\UserInterface;

use anlutro\Core\Auth\AuthenticationException;

class EloquentUserProvider extends \Illuminate\Auth\EloquentUserProvider
{
	public function retrieveById($id)
	{
		if ($user = parent::retrieveById($id)) {
			return $user;
		}
		
		throw new AuthenticationException("No user with identifier [$id] found");
	}

	public function retrieveByToken($id, $token)
	{
		if ($user = parent::retrieveByToken($id, $token)) {
			return $user;
		}
		
		throw new AuthenticationException("No user with identifier [$id] and token [$token] found");
	}

	public function retrieveByCredentials(array $credentials)
	{
		if ($user = parent::retrieveByCredentials($credentials)) {
			return $user;
		}

		$credStr = $this->getCredentialsString($credentials);

		throw new AuthenticationException("No user with these credentials found - $credStr");
	}

	protected function getCredentialsString(array $credentials)
	{
		$credStr = '';

		foreach ($credentials as $key => $value) {
			if (strpos($key, 'password') !== false) continue;
			$credStr .= "`$key` => \"$value\" - ";
		}

		return rtrim($credStr, ' -');
	}

	public function validateCredentials(UserInterface $user, array $credentials)
	{
		if (parent::validateCredentials($user, $credentials)) {
			return true;
		}

		throw new AuthenticationException("Incorrect password");
	}
}<commit_msg>don't overwrite retrieveByToken<commit_after><?php
/**
 * Laravel 4 Core
 *
 * @author   <NAME> <<EMAIL>>
 * @license  http://opensource.org/licenses/MIT
 * @package  l4-core
 */

namespace anlutro\Core\Auth\Laravel;

use Illuminate\Auth\UserInterface;

use anlutro\Core\Auth\AuthenticationException;

class EloquentUserProvider extends \Illuminate\Auth\EloquentUserProvider
{
	public function retrieveById($id)
	{
		if ($user = parent::retrieveById($id)) {
			return $user;
		}
		
		throw new AuthenticationException("No user with identifier [$id] found");
	}

	public function retrieveByCredentials(array $credentials)
	{
		if ($user = parent::retrieveByCredentials($credentials)) {
			return $user;
		}

		$credStr = $this->getCredentialsString($credentials);

		throw new AuthenticationException("No user with these credentials found - $credStr");
	}

	protected function getCredentialsString(array $credentials)
	{
		$credStr = '';

		foreach ($credentials as $key => $value) {
			if (strpos($key, 'password') !== false) continue;
			$credStr .= "`$key` => \"$value\" - ";
		}

		return rtrim($credStr, ' -');
	}

	public function validateCredentials(UserInterface $user, array $credentials)
	{
		if (parent::validateCredentials($user, $credentials)) {
			return true;
		}

		throw new AuthenticationException("Incorrect password");
	}
}
{'fraction_non_alphanumeric': 0.14107883817427386, 'fraction_numerical': 0.0013831258644536654, 'mean_word_length': 4.595744680851064, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, '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': '239797', 'n_tokens_mistral': 978, 'n_tokens_neox': 901, 'n_words': 207}