<commit_before><?php

namespace App\Validation\Rules;

use App\Models\User;
use Albert221\Validation\Rule\RuleInterface;
use Albert221\Validation\Rule\RuleTrait as RuleTrait;

class PasswordValid implements RuleInterface
{
    use RuleTrait;

    protected $email;

    public function __construct($email)
    {
        $this->message = 'Podane hasło jest nieprawidłowe';
        $this->email = $email;
    }

    public function test($value)
    {
        $user = User::where('email', $this->email)->first();
        
        if (!$user)
        {
            $this->message = 'Wypełnij poprawnie adres email';
            return false;
        }
        
        if (password_verify($value, $user->password)) {
                    return true;
        }<commit_msg>Update PasswordValid.php<commit_after><?php

namespace App\Validation\Rules;

use App\Models\User;
use Albert221\Validation\Rule\RuleInterface;
use Albert221\Validation\Rule\RuleTrait as RuleTrait;

class PasswordValid implements RuleInterface
{
    use RuleTrait;

    protected $email;

    public function __construct($email)
    {
        $this->message = 'Podane hasło jest nieprawidłowe';
        $this->email = $email;
    }

    public function test($value)
    {
        $user = User::where('email', $this->email)->first();
        
        if (!$user)
        {
            $this->message = 'Wypełnij poprawnie adres email';
            return false;
        }
        
        if (password_verify($value, $user->password)) {
            return true;
        }
{'fraction_non_alphanumeric': 0.11515940143135979, 'fraction_numerical': 0.007807417046193884, 'mean_word_length': 2.2933618843683083, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4137692', 'n_tokens_mistral': 459, 'n_tokens_neox': 445, 'n_words': 99}