From c841819ce76a22bb73836858df7b288d5179f064 Mon Sep 17 00:00:00 2001 From: Jake Hotson Date: Tue, 24 Jun 2025 22:08:24 +0100 Subject: [PATCH] [TASK] Remove `getColNo()` Note that the removed tests are in `UnitDeprecated`. Equivalent tests already exist for the replacement `getColumnNumber()`. Part of #974 --- CHANGELOG.md | 1 + src/Position/Position.php | 8 ----- src/Position/Positionable.php | 7 ---- .../UnitDeprecated/Position/PositionTest.php | 32 ------------------- 4 files changed, 1 insertion(+), 47 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f69624e7..e317a1e2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -80,6 +80,7 @@ Please also have a look at our ### Removed +- Remove `Rule::getColNo()` (use `getColumnNumber()` instead) (#1287) - Passing a string as the first argument to `getAllValues()` is no longer supported and will not work; the search pattern should now be passed as the second argument (#1243) diff --git a/src/Position/Position.php b/src/Position/Position.php index 0771453b4..0729b05e2 100644 --- a/src/Position/Position.php +++ b/src/Position/Position.php @@ -47,14 +47,6 @@ public function getColumnNumber(): ?int return $this->columnNumber; } - /** - * @return int<0, max> - */ - public function getColNo(): int - { - return $this->getColumnNumber() ?? 0; - } - /** * @param int<0, max>|null $lineNumber * @param int<0, max>|null $columnNumber diff --git a/src/Position/Positionable.php b/src/Position/Positionable.php index 675fb55fb..65ba40fbb 100644 --- a/src/Position/Positionable.php +++ b/src/Position/Positionable.php @@ -28,13 +28,6 @@ public function getLineNo(): int; */ public function getColumnNumber(): ?int; - /** - * @return int<0, max> - * - * @deprecated in version 8.9.0, will be removed in v9.0. Use `getColumnNumber()` instead. - */ - public function getColNo(): int; - /** * @param int<0, max>|null $lineNumber * Providing zero for this parameter is deprecated in version 8.9.0, and will not be supported from v9.0. diff --git a/tests/UnitDeprecated/Position/PositionTest.php b/tests/UnitDeprecated/Position/PositionTest.php index 2e06cc6d8..ef77d4435 100644 --- a/tests/UnitDeprecated/Position/PositionTest.php +++ b/tests/UnitDeprecated/Position/PositionTest.php @@ -77,38 +77,6 @@ public function getLineNoReturnsZeroAfterLineNumberCleared(): void self::assertSame(0, $this->subject->getLineNo()); } - /** - * @test - */ - public function getColNoInitiallyReturnsZero(): void - { - self::assertSame(0, $this->subject->getColNo()); - } - - /** - * @test - * - * @dataProvider provideColumnNumber - */ - public function getColNoReturnsColumnNumberSet(int $columnNumber): void - { - $this->subject->setPosition(1, $columnNumber); - - self::assertSame($columnNumber, $this->subject->getColNo()); - } - - /** - * @test - */ - public function getColNoReturnsZeroAfterColumnNumberCleared(): void - { - $this->subject->setPosition(1, 99); - - $this->subject->setPosition(2); - - self::assertSame(0, $this->subject->getColNo()); - } - /** * @test */