public function transformLabels(callable $fn) : void
    {
        $labels = array_map($fn, $this->labels);

        foreach ($labels as $label) {
            if (!is_string($label) and !is_numeric($label)) {
                throw new RuntimeException('Label must be a string or'
                    . ' numeric type, ' . gettype($label) . ' found.');
            }
        }

        $this->labels = $labels;
    }
public function transformLabels(callable $fn) : void
    {
        $labels = array_map($fn, $this->labels);

        foreach ($labels as $label) {
            if (!is_string($label) and !is_numeric($label)) {
                throw new RuntimeException('Label must be a string or'
                    . ' numeric type, ' . gettype($label) . ' found.');
            }
        }

        $this->labels = $labels;
    }
public function transformLabels ( callable $ fn ) : void { $ labels = array_map ( $ fn , $ this -> labels ) ; foreach ( $ labels as $ label ) { if ( ! is_string ( $ label ) and ! is_numeric ( $ label ) ) { throw new RuntimeException ( 'Label must be a string or' . ' numeric type, ' . gettype ( $ label ) . ' found.' ) ; } } $ this -> labels = $ labels ; }
Map labels to their new values.

@param callable $fn
@throws \RuntimeException
Map labels to their new values .