Skip to content

Commit 6a3c021

Browse files
authored
Merge pull request #42 from gsteel/deprecations
Deprecate `addPaths` and `getPaths`
2 parents 724407f + 8a3503e commit 6a3c021

File tree

3 files changed

+38
-6
lines changed

3 files changed

+38
-6
lines changed

psalm-baseline.xml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,32 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="5.9.0@8b9ad1eb9e8b7d3101f949291da2b9f7767cd163">
2+
<files psalm-version="6.13.1@1e3b7f0a8ab32b23197b91107adc0a7ed8a05b51">
33
<file src="src/TemplateRendererInterface.php">
4+
<DeprecatedClass>
5+
<code><![CDATA[TemplatePath[]]]></code>
6+
</DeprecatedClass>
47
<PossiblyUnusedMethod>
5-
<code>addDefaultParam</code>
6-
<code>addPath</code>
7-
<code>getPaths</code>
8-
<code>render</code>
8+
<code><![CDATA[addDefaultParam]]></code>
9+
<code><![CDATA[addPath]]></code>
10+
<code><![CDATA[getPaths]]></code>
11+
<code><![CDATA[render]]></code>
912
</PossiblyUnusedMethod>
1013
</file>
14+
<file src="test/TemplatePathAssertionsTrait.php">
15+
<DeprecatedClass>
16+
<code><![CDATA[TemplatePath]]></code>
17+
<code><![CDATA[TemplatePath]]></code>
18+
<code><![CDATA[TemplatePath]]></code>
19+
<code><![CDATA[TemplatePath]]></code>
20+
<code><![CDATA[TemplatePath]]></code>
21+
<code><![CDATA[TemplatePath]]></code>
22+
</DeprecatedClass>
23+
</file>
24+
<file src="test/TemplatePathTest.php">
25+
<DeprecatedClass>
26+
<code><![CDATA[new TemplatePath('/tmp')]]></code>
27+
<code><![CDATA[new TemplatePath('/tmp')]]></code>
28+
<code><![CDATA[new TemplatePath('/tmp', 'test')]]></code>
29+
<code><![CDATA[new TemplatePath('/tmp', 'test')]]></code>
30+
</DeprecatedClass>
31+
</file>
1132
</files>

src/TemplatePath.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66

77
use Stringable;
88

9-
/** @final */
9+
/**
10+
* @deprecated Since 2.12.0. This class will be removed in 3.0.0 when the relevant methods in TemplateRendererInterface
11+
* are removed.
12+
*
13+
* @final
14+
*/
1015
class TemplatePath implements Stringable
1116
{
1217
public function __construct(protected string $path, protected ?string $namespace = null)

src/TemplateRendererInterface.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,18 @@ public function render(string $name, $params = []): string;
2929
*
3030
* Adds a template path, with optional namespace the templates in that path
3131
* provide.
32+
*
33+
* @deprecated Since 2.12.0. Template file paths are not the concern of a template renderer in this context. The
34+
* method will be removed in 3.0.0
3235
*/
3336
public function addPath(string $path, ?string $namespace = null): void;
3437

3538
/**
3639
* Retrieve configured paths from the engine.
3740
*
41+
* @deprecated Since 2.12.0. Template file paths are not the concern of a template renderer in this context. The
42+
* method will be removed in 3.0.0
43+
*
3844
* @return TemplatePath[]
3945
*/
4046
public function getPaths(): array;

0 commit comments

Comments
 (0)