<commit_before><?php

namespace Brick\Form\Element\Select;

use Brick\Form\Element\Select;

/**
 * Represents a single choice select element.
 */
class SingleSelect extends Select
{
    /**
     * @param string $value
     *
     * @return static
     */
    public function setValue($value)
    {
        $oneSelected = false;

        foreach ($this->getOptions() as $option) {
            $thisSelected = ! $oneSelected && $option->getValue() === $value;
            $oneSelected = $oneSelected || $thisSelected;
            $option->setSelected($thisSelected);
        }

        return $this;
    }
<commit_msg>Fixed a potential bug when comparing values in SingleSelect.<commit_after><?php

namespace Brick\Form\Element\Select;

use Brick\Form\Element\Select;

/**
 * Represents a single choice select element.
 */
class SingleSelect extends Select
{
    /**
     * @param string $value
     *
     * @return static
     */
    public function setValue($value)
    {
        $oneSelected = false;

        foreach ($this->getOptions() as $option) {
            $thisSelected = ! $oneSelected && $option->getValue() == $value;
            $oneSelected = $oneSelected || $thisSelected;
            $option->setSelected($thisSelected);
        }

        return $this;
    }

{'fraction_non_alphanumeric': 0.12832550860719874, 'fraction_numerical': 0.0, 'mean_word_length': 2.3835978835978837, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '4432830', 'n_tokens_mistral': 356, 'n_tokens_neox': 353, 'n_words': 86}