src/DateTime.php
public function setFormatOption($name, callable $handler)
    {
        if (in_array($name, static::$formatOptionsNames)) {
            return $this;
        }
        static::$formatOptionsNames[] = $name;
        static::$formatOptionsPlaceholders[] = '~' . count(static::$formatOptionsPlaceholders) . '~';
        static::$formatOptionsHandlers[] = $handler;
        return $this;
    }
public function setFormatOption($name, callable $handler)
    {
        if (in_array($name, static::$formatOptionsNames)) {
            return $this;
        }
        static::$formatOptionsNames[] = $name;
        static::$formatOptionsPlaceholders[] = '~' . count(static::$formatOptionsPlaceholders) . '~';
        static::$formatOptionsHandlers[] = $handler;
        return $this;
    }
public function setFormatOption ( $ name , callable $ handler ) { if ( in_array ( $ name , static :: $ formatOptionsNames ) ) { return $ this ; } static :: $ formatOptionsNames [ ] = $ name ; static :: $ formatOptionsPlaceholders [ ] = '~' . count ( static :: $ formatOptionsPlaceholders ) . '~' ; static :: $ formatOptionsHandlers [ ] = $ handler ; return $ this ; }
Adds a format option.
@param string $name name of option.
@param callable $handler
@return $this
@throws DateException
Adds a format option .