public function setShortName($shortName)
    {
        if (null !== $shortName) {
            Assert::string($shortName, 'The short command name must be a string or null. Got: %s');
            Assert::notEmpty($shortName, 'The short command name must not be empty.');
            Assert::regex($shortName, '~^[a-zA-Z]$~', 'The short command name must contain a single letter. Got: %s');
        }

        // Reset short name preference when unsetting the short name
        if (null === $shortName && false === $this->longNamePreferred) {
            $this->longNamePreferred = null;
        }

        $this->shortName = $shortName;

        return $this;
    }
public function setShortName($shortName)
    {
        if (null !== $shortName) {
            Assert::string($shortName, 'The short command name must be a string or null. Got: %s');
            Assert::notEmpty($shortName, 'The short command name must not be empty.');
            Assert::regex($shortName, '~^[a-zA-Z]$~', 'The short command name must contain a single letter. Got: %s');
        }

        // Reset short name preference when unsetting the short name
        if (null === $shortName && false === $this->longNamePreferred) {
            $this->longNamePreferred = null;
        }

        $this->shortName = $shortName;

        return $this;
    }
public function setShortName ( $ shortName ) { if ( null !== $ shortName ) { Assert :: string ( $ shortName , 'The short command name must be a string or null. Got: %s' ) ; Assert :: notEmpty ( $ shortName , 'The short command name must not be empty.' ) ; Assert :: regex ( $ shortName , '~^[a-zA-Z]$~' , 'The short command name must contain a single letter. Got: %s' ) ; } // Reset short name preference when unsetting the short name if ( null === $ shortName && false === $ this -> longNamePreferred ) { $ this -> longNamePreferred = null ; } $ this -> shortName = $ shortName ; return $ this ; }
Sets the short option name of the command.

The short name must consist of a single letter. The short name is
preceded by a single dash "-" when calling the command:

```
$ server -d localhost
```

In the example above, "d" is the short name of the "server --delete"
command.

@param string $shortName The short option name.

@return static The current instance.
Sets the short option name of the command .