protected function inflectSegment($command, int $segment): string
    {
        $className = \get_class($command);

        // Get the given segment from a given class handler.
        if (isset($this->mappings[$className])) {
            return \explode('@', $this->mappings[$className])[$segment];
        }

        // Get the given segment from a given class handler using the custom mapper.
        if (\is_callable($this->mapper)) {
            return \explode('@', \call_user_func($this->mapper, [$command]))[$segment];
        }

        throw new InvalidArgumentException(\sprintf('No handler registered for command [%s].', $className));
    }
protected function inflectSegment($command, int $segment): string
    {
        $className = \get_class($command);

        // Get the given segment from a given class handler.
        if (isset($this->mappings[$className])) {
            return \explode('@', $this->mappings[$className])[$segment];
        }

        // Get the given segment from a given class handler using the custom mapper.
        if (\is_callable($this->mapper)) {
            return \explode('@', \call_user_func($this->mapper, [$command]))[$segment];
        }

        throw new InvalidArgumentException(\sprintf('No handler registered for command [%s].', $className));
    }
protected function inflectSegment ( $ command , int $ segment ) : string { $ className = \ get_class ( $ command ) ; // Get the given segment from a given class handler. if ( isset ( $ this -> mappings [ $ className ] ) ) { return \ explode ( '@' , $ this -> mappings [ $ className ] ) [ $ segment ] ; } // Get the given segment from a given class handler using the custom mapper. if ( \ is_callable ( $ this -> mapper ) ) { return \ explode ( '@' , \ call_user_func ( $ this -> mapper , [ $ command ] ) ) [ $ segment ] ; } throw new InvalidArgumentException ( \ sprintf ( 'No handler registered for command [%s].' , $ className ) ) ; }
Get the given handler segment for the given command.

@param mixed $command
@param int   $segment

@throws \InvalidArgumentException

@return string
Get the given handler segment for the given command .