protected static function fetch()
    {
        $command = array(
            'LINUX' => new Commands\Linux(),
            'MAC' => new Commands\Mac(),
            'WIN' => new Commands\Windows()
        );

        $instance = 'No valid desktop notifier found.';

        if ($command['WIN']->isAvailable()) {
            $instance = $command['WIN'];
        } elseif($command['LINUX']->isAvailable()) {
            $instance = $command['LINUX'];
        } elseif($command['MAC']->isAvailable()) {
            $instance = $command['MAC'];
        }

        if (is_string($instance)) {
            throw new \RuntimeException($instance);
        }

        return $instance;
    }
protected static function fetch()
    {
        $command = array(
            'LINUX' => new Commands\Linux(),
            'MAC' => new Commands\Mac(),
            'WIN' => new Commands\Windows()
        );

        $instance = 'No valid desktop notifier found.';

        if ($command['WIN']->isAvailable()) {
            $instance = $command['WIN'];
        } elseif($command['LINUX']->isAvailable()) {
            $instance = $command['LINUX'];
        } elseif($command['MAC']->isAvailable()) {
            $instance = $command['MAC'];
        }

        if (is_string($instance)) {
            throw new \RuntimeException($instance);
        }

        return $instance;
    }
protected static function fetch ( ) { $ command = array ( 'LINUX' => new Commands \ Linux ( ) , 'MAC' => new Commands \ Mac ( ) , 'WIN' => new Commands \ Windows ( ) ) ; $ instance = 'No valid desktop notifier found.' ; if ( $ command [ 'WIN' ] -> isAvailable ( ) ) { $ instance = $ command [ 'WIN' ] ; } elseif ( $ command [ 'LINUX' ] -> isAvailable ( ) ) { $ instance = $ command [ 'LINUX' ] ; } elseif ( $ command [ 'MAC' ] -> isAvailable ( ) ) { $ instance = $ command [ 'MAC' ] ; } if ( is_string ( $ instance ) ) { throw new \ RuntimeException ( $ instance ) ; } return $ instance ; }
Fetches an instance by checking for ability.

@return Commands\Linux|Commands\Mac|Commands\Windows

@throws \RuntimeException
Fetches an instance by checking for ability .