src/Enum.php
public static function fromName($str){
		
		$strName = \strtoupper(\trim($str));
		
		foreach(static::getConstants() as $name => $value){
			if($strName === \strtoupper($name)){
				return new static($value);
			}
		}
		
		return null;
		
	}
public static function fromName($str){
		
		$strName = \strtoupper(\trim($str));
		
		foreach(static::getConstants() as $name => $value){
			if($strName === \strtoupper($name)){
				return new static($value);
			}
		}
		
		return null;
		
	}
public static function fromName ( $ str ) { $ strName = \ strtoupper ( \ trim ( $ str ) ) ; foreach ( static :: getConstants ( ) as $ name => $ value ) { if ( $ strName === \ strtoupper ( $ name ) ) { return new static ( $ value ) ; } } return null ; }
Creates a new enum from the case-insensitive name of a given
constant
@param string $str
@return \static
Creates a new enum from the case - insensitive name of a given constant