Skip to content

Commit

Permalink
[TASK] Add deprecation hints to TemplatePaths (#998)
Browse files Browse the repository at this point in the history
Related: #996
  • Loading branch information
s2b authored Aug 30, 2024
1 parent dd6201e commit 0a8ebdb
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
26 changes: 26 additions & 0 deletions Documentation/Changelog/2.x.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 9,32 @@ Changelog 2.x
2.15
----

* Deprecation: First parameter of method :php:`TYPO3Fluid\Fluid\View\TemplatePaths->__construct()`
is deprecated. The Constructor will be removed with Fluid v5.
* Deprecation: Method :php:`TYPO3Fluid\Fluid\View\TemplatePaths->fillFromConfigurationArray()`
has been marked as deprecated. It will log a deprecation level error message when called in
Fluid v4.
* Deprecation: Method :php:`TYPO3Fluid\Fluid\View\TemplatePaths->fillDefaultsByPackageName()`
has been marked as deprecated. It will log a deprecation level error message when called in
Fluid v4.
* Deprecation: Method :php:`TYPO3Fluid\Fluid\View\TemplatePaths->ensureAbsolutePaths()`
has been marked as deprecated. It will log a deprecation level error message when called in
Fluid v4.
* Deprecation: Method :php:`TYPO3Fluid\Fluid\View\TemplatePaths->extractPathArrays()`
has been marked as deprecated. It will log a deprecation level error message when called in
Fluid v4.
* Deprecation: Method :php:`TYPO3Fluid\Fluid\View\TemplatePaths->getPackagePath()`
has been marked as deprecated. It will log a deprecation level error message when called in
Fluid v4.
* Deprecation: Method :php:`TYPO3Fluid\Fluid\View\TemplatePaths->toArray()`
has been marked as deprecated. It will log a deprecation level error message when called in
Fluid v4.
* Deprecation: Constant :php:`TYPO3Fluid\Fluid\View\TemplatePaths::DEFAULT_TEMPLATES_DIRECTORY`
has been marked as deprecated and will be removed in Fluid v5.
* Deprecation: Constant :php:`TYPO3Fluid\Fluid\View\TemplatePaths::DEFAULT_LAYOUTS_DIRECTORY`
has been marked as deprecated and will be removed in Fluid v5.
* Deprecation: Constant :php:`TYPO3Fluid\Fluid\View\TemplatePaths::DEFAULT_PARTIALS_DIRECTORY`
has been marked as deprecated and will be removed in Fluid v5.
* Deprecation: Trait :php:`TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic`
has been marked as deprecated. It will log a deprecation level error message when called in
Fluid v4. It will be removed in Fluid v5.
Expand Down
24 changes: 23 additions & 1 deletion src/View/TemplatePaths.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 39,19 @@
*/
class TemplatePaths
{
public const DEFAULT_FORMAT = 'html';
/**
* @deprecated will be removed with Fluid v5
*/
public const DEFAULT_TEMPLATES_DIRECTORY = 'Resources/Private/Templates/';
/**
* @deprecated will be removed with Fluid v5
*/
public const DEFAULT_LAYOUTS_DIRECTORY = 'Resources/Private/Layouts/';
/**
* @deprecated will be removed with Fluid v5
*/
public const DEFAULT_PARTIALS_DIRECTORY = 'Resources/Private/Partials/';
public const DEFAULT_FORMAT = 'html';
public const CONFIG_TEMPLATEROOTPATHS = 'templateRootPaths';
public const CONFIG_LAYOUTROOTPATHS = 'layoutRootPaths';
public const CONFIG_PARTIALROOTPATHS = 'partialRootPaths';
Expand Down Expand Up @@ -109,6 118,10 @@ class TemplatePaths
protected $format = self::DEFAULT_FORMAT;

/**
* This constructor will be removed with Fluid v5 as the underlying methods are
* deprecated and will be removed with Fluid v5 as well. The appropriate setters
* (like setTemplateRootPaths()) should be called instead.
*
* @param array|string|null $packageNameOrArray
*/
public function __construct($packageNameOrArray = null)
Expand All @@ -122,6 135,8 @@ public function __construct($packageNameOrArray = null)

/**
* @return array
* @deprecated will be removed in Fluid v5; use the individual getters instead. Sanitation is not necessary
* because setters already sanitize input values
*/
public function toArray()
{
Expand Down Expand Up @@ -366,6 381,8 @@ protected function resolveFilesInFolder($folder, $format)
*
* @param array $paths
* @api
* @deprecated will be removed with Fluid v5; appropriate setters (like setTemplateRootPaths())
* should be called instead
*/
public function fillFromConfigurationArray(array $paths)
{
Expand All @@ -385,6 402,8 @@ public function fillFromConfigurationArray(array $paths)
*
* @param string $packageName
* @api
* @deprecated will be removed with Fluid v5; appropriate setters (like setTemplateRootPaths())
* should be called instead
*/
public function fillDefaultsByPackageName($packageName)
{
Expand Down Expand Up @@ -449,6 468,7 @@ protected function ensureAbsolutePath($path)
*
* @param array $reference
* @return array
* @deprecated will be removed with Fluid v5
*/
protected function ensureAbsolutePaths(array $reference)
{
Expand Down Expand Up @@ -477,6 497,7 @@ protected function ensureSuffixedPath($path)
*
* @param array $paths
* @return array
* @deprecated will be removed with Fluid v5
*/
protected function extractPathArrays(array $paths)
{
Expand Down Expand Up @@ -506,6 527,7 @@ protected function extractPathArrays(array $paths)
/**
* @param string $packageName
* @return string
* @deprecated will be removed with Fluid v5
*/
protected function getPackagePath($packageName)
{
Expand Down

0 comments on commit 0a8ebdb

Please sign in to comment.