Command/NotifyCommand.php
protected function getGauges($config)
    {
        if (null === $this->gauges) {
            $this->gauges = array();

            foreach ($config as $path => $details) {
                $className = $details['class'];
                if (class_exists($className)) {
                    $reflection = new \ReflectionClass($className);

                    if ($reflection->getConstructor()) {
                        $this->gauges[$path] = $reflection->newInstanceArgs(
                            $details['arguments'] ? $details['arguments'] : array());
                    }
                    else {
                        $this->gauges[$path] = $reflection->newInstance();
                    }
                }
                else {
                    throw new \RuntimeException(sprintf(
                        'Class does not exists %s'
                    ), $className);
                }
            }

            if (empty($this->gauges)) {
                throw new \RuntimeException(
                    sprintf('No gauges found for provided string %s', $input->getArgument('gauges-class'))
                );
            }
        }

        return $this->gauges;
    }
protected function getGauges($config)
    {
        if (null === $this->gauges) {
            $this->gauges = array();

            foreach ($config as $path => $details) {
                $className = $details['class'];
                if (class_exists($className)) {
                    $reflection = new \ReflectionClass($className);

                    if ($reflection->getConstructor()) {
                        $this->gauges[$path] = $reflection->newInstanceArgs(
                            $details['arguments'] ? $details['arguments'] : array());
                    }
                    else {
                        $this->gauges[$path] = $reflection->newInstance();
                    }
                }
                else {
                    throw new \RuntimeException(sprintf(
                        'Class does not exists %s'
                    ), $className);
                }
            }

            if (empty($this->gauges)) {
                throw new \RuntimeException(
                    sprintf('No gauges found for provided string %s', $input->getArgument('gauges-class'))
                );
            }
        }

        return $this->gauges;
    }
protected function getGauges ( $ config ) { if ( null === $ this -> gauges ) { $ this -> gauges = array ( ) ; foreach ( $ config as $ path => $ details ) { $ className = $ details [ 'class' ] ; if ( class_exists ( $ className ) ) { $ reflection = new \ ReflectionClass ( $ className ) ; if ( $ reflection -> getConstructor ( ) ) { $ this -> gauges [ $ path ] = $ reflection -> newInstanceArgs ( $ details [ 'arguments' ] ? $ details [ 'arguments' ] : array ( ) ) ; } else { $ this -> gauges [ $ path ] = $ reflection -> newInstance ( ) ; } } else { throw new \ RuntimeException ( sprintf ( 'Class does not exists %s' ) , $ className ) ; } } if ( empty ( $ this -> gauges ) ) { throw new \ RuntimeException ( sprintf ( 'No gauges found for provided string %s' , $ input -> getArgument ( 'gauges-class' ) ) ) ; } } return $ this -> gauges ; }
Instantiate selected gauges

@param array $config
@return GaugeInterface[] array
Instantiate selected gauges