<commit_before><?php

use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableInterface;
use Illuminate\Database\Eloquent\SoftDeletingTrait;

use Laravel\Cashier\BillableTrait;
use Laravel\Cashier\BillableInterface;


class User extends Eloquent implements UserInterface, RemindableInterface, BillableInterface
{
    use SoftDeletingTrait;
    use BillableTrait;
    use \Illuminate\Auth\Reminders\RemindableTrait;
    use Sailr\Vip\VipTrait;

    protected $dates = ['created_at', 'updated_at', 'trial_ends_at', 'subscription_ends_at'];
    protected $softDelete = true;

    /**
     * The database table used by the model.
     *
     * @var string
     */
    protected $table = 'users';

    /**
     * The attributes excluded from the model's JSON form.
     *
     * @var array
     */
    public $hidden = array('password', 'created_at', 'updated_at', 'deleted_at', 'email', 'remember_token', 'stripe_id', 'stripe_subscription', 'last4', 'trial_ends_at');

    public $guarded = array('id', 'created_at', 'updated_at', 'terms_of_service', 'deleted_at', 'remember_token', 'stripe_id', 'stripe_subscription', 'last4', 'trial_ends_at');
    //protected $appends = ['counts'];

    public static $rules = array(
        'terms_of_service' => 'accepted',
        'name' => 'required|min:2|max:99',
        'email' => 'required|email|max:99|unique:users,email',
        'username' => 'required|alpha_dash|max:99|unique:users,username',
        'password' => '<PASSWORD>',
        'bio' => 'sometimes|max:240'
    );

    public static $updateRules = array(
        'name' => 'sometimes|min:2|max:99',
        'email' => 'sometimes|email|max:99|unique:users,email',
        'username' => 'sometimes|alpha_num|max:99|unique:users,username',
        'password' => '<PASSWORD>',
        'bio' => 'sometimes|max:240'
    );

    protected static $stripePublishableKey = '';
    public static function setStripePublishableKey($key) {
        self::$stripePublishableKey = $key;
    }

    public static function getStripePublishableKey() {
        return self::$stripePublishableKey;<commit_msg>Changes user rules so update is alpha dash and you can't have a username with 'sailr' in it.<commit_after><?php

use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableInterface;
use Illuminate\Database\Eloquent\SoftDeletingTrait;

use Laravel\Cashier\BillableTrait;
use Laravel\Cashier\BillableInterface;


class User extends Eloquent implements UserInterface, RemindableInterface, BillableInterface
{
    use SoftDeletingTrait;
    use BillableTrait;
    use \Illuminate\Auth\Reminders\RemindableTrait;
    use Sailr\Vip\VipTrait;

    protected $dates = ['created_at', 'updated_at', 'trial_ends_at', 'subscription_ends_at'];
    protected $softDelete = true;

    /**
     * The database table used by the model.
     *
     * @var string
     */
    protected $table = 'users';

    /**
     * The attributes excluded from the model's JSON form.
     *
     * @var array
     */
    public $hidden = array('password', 'created_at', 'updated_at', 'deleted_at', 'email', 'remember_token', 'stripe_id', 'stripe_subscription', 'last4', 'trial_ends_at');

    public $guarded = array('id', 'created_at', 'updated_at', 'terms_of_service', 'deleted_at', 'remember_token', 'stripe_id', 'stripe_subscription', 'last4', 'trial_ends_at');
    //protected $appends = ['counts'];

    public static $rules = array(
        'terms_of_service' => 'accepted',
        'name' => 'required|min:2|max:99',
        'email' => 'required|email|max:99|unique:users,email',
        'username' => 'required|alpha_dash|max:99|regex:^((?!sailr).)*$|unique:users,username',
        'password' => '<PASSWORD>',
        'bio' => 'sometimes|max:240'
    );

    public static $updateRules = array(
        'name' => 'sometimes|min:2|max:99',
        'email' => 'sometimes|email|max:99|unique:users,email',
        'username' => 'sometimes|alpha_dash|max:99|regex:^((?!sailr).)*$|unique:users,username',
        'password' => '<PASSWORD>',
        'bio' => 'sometimes|max:240'

    );

    protected static $stripePublishableKey = '';
    public static function setStripePublishableKey($key) {
        self::$stripePublishableKey = $key;
    }

    public static function getStripePublishableKey() {
        return self::$stripePublishableKey;
{'fraction_non_alphanumeric': 0.1468354430379747, 'fraction_numerical': 0.010126582278481013, 'mean_word_length': 3.9386363636363635, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 29, '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': '765033', 'n_tokens_mistral': 1445, 'n_tokens_neox': 1413, 'n_words': 276}