Webmozart\Console\Api\Config\OptionCommandConfig::isShortNamePreferred PHP Method

isShortNamePreferred() public method

If no preference was set, the short name is preferred by default if one is set. If no short name is set, the long name is preferred by default.
public isShortNamePreferred ( ) : boolean
return boolean Returns `true` if the short name should be preferred over the long name.
    public function isShortNamePreferred()
    {
        return !$this->isLongNamePreferred();
    }

Usage Example

コード例 #1
0
 public function testSetShortNameToNullSetsLongNameToBePreferred()
 {
     $this->config->setShortName('d');
     $this->config->setPreferShortName();
     $this->config->setShortName(null);
     $this->assertTrue($this->config->isLongNamePreferred());
     $this->assertFalse($this->config->isShortNamePreferred());
 }