<commit_before><?php

/**
 * This file is part of the DmishhSettingsBundle package.
 *
 * (c) 2013 <NAME> <http://dmishh.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Dmishh\Bundle\SettingsBundle\Exception;

class WrongScopeException extends SettingsException
{
    public function __construct($scopeName, $settingName)
    {
        parent::__construct(sprintf('Wrong scope "%s" for setting "%s". Check your configuration and make sure that user is authenticated.', $scopeName, $settingName));
    }
}<commit_msg>Improved the error message for WronScopeException<commit_after><?php

/**
 * This file is part of the DmishhSettingsBundle package.
 *
 * (c) 2013 <NAME> <http://dmishh.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Dmishh\Bundle\SettingsBundle\Exception;

use Dmishh\Bundle\SettingsBundle\Manager\SettingsManagerInterface;

class WrongScopeException extends SettingsException
{
    public function __construct($scope, $settingName)
    {
        if ($scope === SettingsManagerInterface::SCOPE_GLOBAL) {
            $message = sprintf('You tried to access setting "%s" but it is in the "%s" scope which means you must not use a SettingOwnerInterface object with this option.', $settingName, $scope);
        } elseif ($scope === SettingsManagerInterface::SCOPE_USER) {
            $message = sprintf('You tried to access setting "%s" but it is in the "%s" scope which means you have to pass a SettingOwnerInterface object with this option.', $settingName, $scope);
        } else {
            $message = sprintf('Wrong scope "%s" for setting "%s". Check your configuration.', $scope, $settingName);
        }

        parent::__construct($message);
    }
}
{'fraction_non_alphanumeric': 0.1027689030883919, 'fraction_numerical': 0.004259850905218318, 'mean_word_length': 3.9577836411609497, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '4251218', 'n_tokens_mistral': 504, 'n_tokens_neox': 495, 'n_words': 185}