src/BitwiseEnum.php
public static function fromInt($int){
		
		if(!\is_int($int)){
			throw new \InvalidArgumentException('$int must be an integer');
		}
		
		$flags = new static();
		
		foreach(static::getEnumValues() as $const){			
			if(($int & $const) === $const){
				$flags->addFlag($const);
			}
		}

		return $flags;
		
	}
public static function fromInt($int){
		
		if(!\is_int($int)){
			throw new \InvalidArgumentException('$int must be an integer');
		}
		
		$flags = new static();
		
		foreach(static::getEnumValues() as $const){			
			if(($int & $const) === $const){
				$flags->addFlag($const);
			}
		}

		return $flags;
		
	}
public static function fromInt ( $ int ) { if ( ! \ is_int ( $ int ) ) { throw new \ InvalidArgumentException ( '$int must be an integer' ) ; } $ flags = new static ( ) ; foreach ( static :: getEnumValues ( ) as $ const ) { if ( ( $ int & $ const ) === $ const ) { $ flags -> addFlag ( $ const ) ; } } return $ flags ; }
Converts an integer value to an enum of this type
@param int $int
@return \static
@throws \InvalidArgumentException
Converts an integer value to an enum of this type