public static function directory( string $path ): string {
    return ltrim( rtrim( $path, static::DIRECTORY_SEPARATOR ) . static::DIRECTORY_SEPARATOR, static::DIRECTORY_SEPARATOR );
  }
public static function directory( string $path ): string {
    return ltrim( rtrim( $path, static::DIRECTORY_SEPARATOR ) . static::DIRECTORY_SEPARATOR, static::DIRECTORY_SEPARATOR );
  }
public static function directory ( string $ path ) : string { return ltrim ( rtrim ( $ path , static :: DIRECTORY_SEPARATOR ) . static :: DIRECTORY_SEPARATOR , static :: DIRECTORY_SEPARATOR ) ; }
Force path to be a directory

..and ensure the trailing separator (except for root path)

@param string $path

@return string
Force path to be a directory