Skip to content

Commit aed9219

Browse files
committed
BC: Remove document doctype deprecated methods
1 parent aee2127 commit aed9219

File tree

2 files changed

+9
-44
lines changed

2 files changed

+9
-44
lines changed

src/Document.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,28 +35,12 @@ public function withVersion(string|float|int $version): self
3535
return $this;
3636
}
3737

38-
/**
39-
* @deprecated 1.4 Use `withVersion` instead.
40-
*/
41-
public function setVersion(string|float|int $version): self
42-
{
43-
return $this->withVersion($version);
44-
}
45-
4638
public function withEncoding(string $encoding): self
4739
{
4840
$this->encoding = $encoding;
4941
return $this;
5042
}
5143

52-
/**
53-
* @deprecated 1.4 Use `withEncoding` instead.
54-
*/
55-
public function setEncoding(string $encoding): self
56-
{
57-
return $this->withEncoding($encoding);
58-
}
59-
6044
public function removeEncoding(): self
6145
{
6246
$this->encoding = '';
@@ -69,14 +53,6 @@ public function withStandalone(bool $standalone): self
6953
return $this;
7054
}
7155

72-
/**
73-
* @deprecated 1.4 Use `withStandalone` instead.
74-
*/
75-
public function setStandalone(bool $standalone = true): self
76-
{
77-
return $this->withStandalone($standalone);
78-
}
79-
8056
public function removeStandalone(): self
8157
{
8258
$this->standalone = '';

tests/DocumentBaselineTest.php

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,38 +35,27 @@ public function document_can_modify_declaration_properties(): void
3535
'<?xml version="1.1" encoding="UTF-16" standalone="no" ?>' . "\n" .
3636
'<root></root>',
3737
(string) Document::create('root')
38-
->setVersion(1.1)
39-
->setEncoding('UTF-16')
40-
->setStandalone(false)
38+
->withVersion(1.1)
39+
->withEncoding('UTF-16')
40+
->withStandalone(false)
4141
);
4242

4343
$this->assertSame(
4444
'<?xml version="1.1" encoding="UTF-16" standalone="no" ?>' . "\n" .
4545
'<root></root>',
4646
(string) Document::create('root')
47-
->setVersion('1.1')
48-
->setEncoding('UTF-16')
49-
->setStandalone(false)
47+
->withVersion('1.1')
48+
->withEncoding('UTF-16')
49+
->withStandalone(false)
5050
);
5151

5252
$this->assertSame(
5353
'<?xml version="1.0" encoding="UTF-16" standalone="no" ?>' . "\n" .
5454
'<root></root>',
5555
(string) Document::create('root')
56-
->setVersion(1)
57-
->setEncoding('UTF-16')
58-
->setStandalone(false)
59-
);
60-
}
61-
62-
/**
63-
*@test
64-
*/
65-
public function document_is_stringable(): void
66-
{
67-
$this->assertSame(
68-
'<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>'."\n".'<root id="6" property="hello"></root>',
69-
(string) Document::create('root')->props('id 6', 'property hello')
56+
->withVersion(1)
57+
->withEncoding('UTF-16')
58+
->withStandalone(false)
7059
);
7160
}
7261

0 commit comments

Comments
 (0)