mirror of
https://github.com/getgrav/grav.git
synced 2026-03-16 01:21:07 +01:00
Added FormatterInterface::getSupportedFileExtensions() method, deprecated getFileExtension()
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
1. [](#new)
|
||||
* Added `Uri::method()` to get current HTTP method (GET/POST etc)
|
||||
* Added `FormatterInterface::getSupportedFileExtensions()` method, deprecated `getFileExtension()`
|
||||
|
||||
# v1.5.0-rc.1
|
||||
## 07/31/2018
|
||||
|
||||
@@ -11,11 +11,11 @@ namespace Grav\Framework\File\Formatter;
|
||||
interface FormatterInterface
|
||||
{
|
||||
/**
|
||||
* Get file extension with dot.
|
||||
* Get file extensions supported by current formatter (with dot).
|
||||
*
|
||||
* @return string
|
||||
* @return string[]
|
||||
*/
|
||||
public function getFileExtension();
|
||||
public function getSupportedFileExtensions();
|
||||
|
||||
/**
|
||||
* Encode data into a string.
|
||||
|
||||
@@ -25,11 +25,20 @@ class IniFormatter implements FormatterInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* @deprecated
|
||||
* @internal
|
||||
*/
|
||||
public function getFileExtension()
|
||||
{
|
||||
return $this->config['file_extension'];
|
||||
return $this->getSupportedFileExtensions()[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getSupportedFileExtensions()
|
||||
{
|
||||
return (array) $this->config['file_extension'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,11 +23,20 @@ class JsonFormatter implements FormatterInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* @deprecated
|
||||
* @internal
|
||||
*/
|
||||
public function getFileExtension()
|
||||
{
|
||||
return $this->config['file_extension'];
|
||||
return $this->getSupportedFileExtensions()[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getSupportedFileExtensions()
|
||||
{
|
||||
return (array) $this->config['file_extension'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,11 +29,20 @@ class MarkdownFormatter implements FormatterInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* @deprecated
|
||||
* @internal
|
||||
*/
|
||||
public function getFileExtension()
|
||||
{
|
||||
return $this->config['file_extension'];
|
||||
return $this->getSupportedFileExtensions()[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getSupportedFileExtensions()
|
||||
{
|
||||
return (array) $this->config['file_extension'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,11 +25,20 @@ class SerializeFormatter implements FormatterInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* @deprecated
|
||||
* @internal
|
||||
*/
|
||||
public function getFileExtension()
|
||||
{
|
||||
return $this->config['file_extension'];
|
||||
return $this->getSupportedFileExtensions()[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getSupportedFileExtensions()
|
||||
{
|
||||
return (array) $this->config['file_extension'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,11 +30,20 @@ class YamlFormatter implements FormatterInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* @deprecated
|
||||
* @internal
|
||||
*/
|
||||
public function getFileExtension()
|
||||
{
|
||||
return $this->config['file_extension'];
|
||||
return $this->getSupportedFileExtensions()[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getSupportedFileExtensions()
|
||||
{
|
||||
return (array) $this->config['file_extension'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user