Skip to content

Commit 059ddc5

Browse files
Remove deprecated functionality
1 parent f34ddd0 commit 059ddc5

File tree

8 files changed

+4
-110
lines changed

8 files changed

+4
-110
lines changed

.psalm/baseline.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="5.11.0@c9b192ab8400fdaf04b2b13d110575adc879aa90">
2+
<files psalm-version="5.18.0@b113f3ed0259fd6e212d87c3df80eec95a6abf19">
33
<file src="src/Chunk.php">
44
<LessSpecificReturnStatement>
55
<code><![CDATA[$this->lines]]></code>
6-
<code><![CDATA[$this->lines]]></code>
76
</LessSpecificReturnStatement>
87
<MoreSpecificReturnType>
98
<code><![CDATA[list<Line>]]></code>
10-
<code><![CDATA[list<Line>]]></code>
119
</MoreSpecificReturnType>
1210
</file>
1311
<file src="src/Differ.php">

ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt
66

77
### Removed
88

9+
* `SebastianBergmann\Diff\Chunk::getStart()`, `SebastianBergmann\Diff\Chunk::getStartRange()`, `SebastianBergmann\Diff\Chunk::getEnd()`, `SebastianBergmann\Diff\Chunk::getEndRange()`, and `SebastianBergmann\Diff\Chunk::getLines()`
10+
* `SebastianBergmann\Diff\Diff::getFrom()`, `SebastianBergmann\Diff\Diff::getTo()`, and `SebastianBergmann\Diff\Diff::getChunks()`
11+
* `SebastianBergmann\Diff\Line::getContent()` and `SebastianBergmann\Diff\Diff::getType()`
912
* Removed support for PHP 8.1
1013

1114
## [5.1.0] - 2023-12-22

src/Chunk.php

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -75,48 +75,6 @@ public function setLines(array $lines): void
7575
$this->lines = $lines;
7676
}
7777

78-
/**
79-
* @deprecated Use start() instead
80-
*/
81-
public function getStart(): int
82-
{
83-
return $this->start;
84-
}
85-
86-
/**
87-
* @deprecated Use startRange() instead
88-
*/
89-
public function getStartRange(): int
90-
{
91-
return $this->startRange;
92-
}
93-
94-
/**
95-
* @deprecated Use end() instead
96-
*/
97-
public function getEnd(): int
98-
{
99-
return $this->end;
100-
}
101-
102-
/**
103-
* @deprecated Use endRange() instead
104-
*/
105-
public function getEndRange(): int
106-
{
107-
return $this->endRange;
108-
}
109-
110-
/**
111-
* @psalm-return list<Line>
112-
*
113-
* @deprecated Use lines() instead
114-
*/
115-
public function getLines(): array
116-
{
117-
return $this->lines;
118-
}
119-
12078
public function getIterator(): Traversable
12179
{
12280
return new ArrayIterator($this->lines);

src/Diff.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -77,36 +77,6 @@ public function setChunks(array $chunks): void
7777
$this->chunks = $chunks;
7878
}
7979

80-
/**
81-
* @psalm-return non-empty-string
82-
*
83-
* @deprecated
84-
*/
85-
public function getFrom(): string
86-
{
87-
return $this->from;
88-
}
89-
90-
/**
91-
* @psalm-return non-empty-string
92-
*
93-
* @deprecated
94-
*/
95-
public function getTo(): string
96-
{
97-
return $this->to;
98-
}
99-
100-
/**
101-
* @psalm-return list<Chunk>
102-
*
103-
* @deprecated
104-
*/
105-
public function getChunks(): array
106-
{
107-
return $this->chunks;
108-
}
109-
11080
public function getIterator(): Traversable
11181
{
11282
return new ArrayIterator($this->chunks);

src/Line.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,4 @@ public function isUnchanged(): bool
4747
{
4848
return $this->type === self::UNCHANGED;
4949
}
50-
51-
/**
52-
* @deprecated
53-
*/
54-
public function getContent(): string
55-
{
56-
return $this->content;
57-
}
58-
59-
/**
60-
* @deprecated
61-
*/
62-
public function getType(): int
63-
{
64-
return $this->type;
65-
}
6650
}

tests/ChunkTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,26 @@ final class ChunkTest extends TestCase
2222
public function testHasLines(): void
2323
{
2424
$this->assertEquals([$this->line()], $this->chunk()->lines());
25-
$this->assertEquals([$this->line()], $this->chunk()->getLines());
2625
}
2726

2827
public function testHasStart(): void
2928
{
3029
$this->assertSame(1, $this->chunk()->start());
31-
$this->assertSame(1, $this->chunk()->getStart());
3230
}
3331

3432
public function testHasStartRange(): void
3533
{
3634
$this->assertSame(2, $this->chunk()->startRange());
37-
$this->assertSame(2, $this->chunk()->getStartRange());
3835
}
3936

4037
public function testHasEnd(): void
4138
{
4239
$this->assertSame(3, $this->chunk()->end());
43-
$this->assertSame(3, $this->chunk()->getEnd());
4440
}
4541

4642
public function testHasEndRange(): void
4743
{
4844
$this->assertSame(4, $this->chunk()->endRange());
49-
$this->assertSame(4, $this->chunk()->getEndRange());
5045
}
5146

5247
public function testLinesCanBeSet(): void

tests/DiffTest.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ public function testGettersAfterConstructionWithDefault(): void
2828
$this->assertSame($from, $diff->from());
2929
$this->assertSame($to, $diff->to());
3030
$this->assertSame([], $diff->chunks(), 'Expect chunks to be default value "array()".');
31-
32-
$this->assertSame($from, $diff->getFrom());
33-
$this->assertSame($to, $diff->getTo());
34-
$this->assertSame([], $diff->getChunks(), 'Expect chunks to be default value "array()".');
3531
}
3632

3733
public function testGettersAfterConstructionWithChunks(): void
@@ -45,24 +41,18 @@ public function testGettersAfterConstructionWithChunks(): void
4541
$this->assertSame($from, $diff->from());
4642
$this->assertSame($to, $diff->to());
4743
$this->assertSame($chunks, $diff->chunks(), 'Expect chunks to be passed value.');
48-
49-
$this->assertSame($from, $diff->getFrom());
50-
$this->assertSame($to, $diff->getTo());
51-
$this->assertSame($chunks, $diff->getChunks(), 'Expect chunks to be passed value.');
5244
}
5345

5446
public function testSetChunksAfterConstruction(): void
5547
{
5648
$diff = new Diff('line1c', 'line2c');
5749

5850
$this->assertSame([], $diff->chunks(), 'Expect chunks to be default value "array()".');
59-
$this->assertSame([], $diff->getChunks(), 'Expect chunks to be default value "array()".');
6051

6152
$chunks = [new Chunk, new Chunk(2, 3)];
6253
$diff->setChunks($chunks);
6354

6455
$this->assertSame($chunks, $diff->chunks(), 'Expect chunks to be passed value.');
65-
$this->assertSame($chunks, $diff->getChunks(), 'Expect chunks to be passed value.');
6656
}
6757

6858
public function testCanBeIterated(): void

tests/LineTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ final class LineTest extends TestCase
2020
public function testCanBeOfTypeAdded(): void
2121
{
2222
$this->assertSame(Line::ADDED, $this->added()->type());
23-
$this->assertSame(Line::ADDED, $this->added()->getType());
2423

2524
$this->assertTrue($this->added()->isAdded());
2625
$this->assertFalse($this->added()->isRemoved());
@@ -30,7 +29,6 @@ public function testCanBeOfTypeAdded(): void
3029
public function testCanBeOfTypeRemoved(): void
3130
{
3231
$this->assertSame(Line::REMOVED, $this->removed()->type());
33-
$this->assertSame(Line::REMOVED, $this->removed()->getType());
3432

3533
$this->assertTrue($this->removed()->isRemoved());
3634
$this->assertFalse($this->removed()->isAdded());
@@ -40,7 +38,6 @@ public function testCanBeOfTypeRemoved(): void
4038
public function testCanBeOfTypeUnchanged(): void
4139
{
4240
$this->assertSame(Line::UNCHANGED, $this->unchanged()->type());
43-
$this->assertSame(Line::UNCHANGED, $this->unchanged()->getType());
4441

4542
$this->assertTrue($this->unchanged()->isUnchanged());
4643
$this->assertFalse($this->unchanged()->isAdded());
@@ -50,7 +47,6 @@ public function testCanBeOfTypeUnchanged(): void
5047
public function testHasContent(): void
5148
{
5249
$this->assertSame('content', $this->added()->content());
53-
$this->assertSame('content', $this->added()->getContent());
5450
}
5551

5652
private function added(): Line

0 commit comments

Comments
 (0)