<?php

namespace AuthStack\Driver\SOAP\BPS\Lib;


class AuthStatus
{
    const STATUS_OK            = 1;
    const STATUS_BAD_PASSWORD  = 2;
    const STATUS_LOCKED_OUT    = 3;
    const STATUS_NOT_ACTIVATED = 4;
    const STATUS_INVALID_USER  = 5;
    const STATUS_UNKNOWN       = 99;

    protected static $arr_text = [
        'BAD PASSWORD'          => self::STATUS_BAD_PASSWORD,
        'LOCKED OUT'            => self::STATUS_LOCKED_OUT,
        'ACCOUNT NOT ACTIVATED' => self::STATUS_NOT_ACTIVATED,
        'NO SUCH USER'          => self::STATUS_INVALID_USER
    ];

    public static function fromString( $string )
    {
        $string = trim(strtoupper($string));
        return array_key_exists( $string, self::$arr_text )
            ? self::$arr_text[$string]
            :  self::STATUS_UNKNOWN;
    }
}