Skip to content

Commit 505ab39

Browse files
committed
revert: rename FilePathType to PathType
1 parent 84998a3 commit 505ab39

File tree

7 files changed

+30
-30
lines changed

7 files changed

+30
-30
lines changed

src/Analysis/Problem/Fabric/FabricDuplicateModProblem.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Aternos\Codex\Minecraft\Analysis\Problem\Fabric;
44

55
use Aternos\Codex\Minecraft\Analysis\Solution\File\FileDeleteSolution;
6-
use Aternos\Codex\Minecraft\Analysis\Solution\File\PathType;
6+
use Aternos\Codex\Minecraft\Analysis\Solution\File\FilePathType;
77
use Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\VanillaServerLog;
88
use Aternos\Codex\Minecraft\Translator\Translator;
99

@@ -33,6 +33,6 @@ public static function getPatterns(): array
3333
public function setMatches(array $matches, mixed $patternKey): void
3434
{
3535
$this->setModName($matches[3]);
36-
$this->addSolution(new FileDeleteSolution($matches[4], PathType::ABSOLUTE));
36+
$this->addSolution(new FileDeleteSolution($matches[4], FilePathType::ABSOLUTE));
3737
}
3838
}

src/Analysis/Problem/Forge/ModDuplicateProblem.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Aternos\Codex\Analysis\InsightInterface;
66
use Aternos\Codex\Minecraft\Analysis\Solution\File\FileDeleteSolution;
7-
use Aternos\Codex\Minecraft\Analysis\Solution\File\PathType;
7+
use Aternos\Codex\Minecraft\Analysis\Solution\File\FilePathType;
88
use Aternos\Codex\Minecraft\Translator\Translator;
99

1010
class ModDuplicateProblem extends ModProblem
@@ -50,8 +50,8 @@ public function setMatches(array $matches, mixed $patternKey): void
5050
$this->firstModPath = $matches[2];
5151
$this->secondModPath = $matches[3];
5252

53-
$this->addSolution(new FileDeleteSolution($this->getFirstModPath(), PathType::ABSOLUTE));
54-
$this->addSolution(new FileDeleteSolution($this->getSecondModPath(), PathType::ABSOLUTE));
53+
$this->addSolution(new FileDeleteSolution($this->getFirstModPath(), FilePathType::ABSOLUTE));
54+
$this->addSolution(new FileDeleteSolution($this->getSecondModPath(), FilePathType::ABSOLUTE));
5555
}
5656

5757
/**

src/Analysis/Solution/Bukkit/Plugin/AuthMeShutdownSolution.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
namespace Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\Plugin;
44

55
use Aternos\Codex\Minecraft\Analysis\Solution\File\FileEditSolution;
6-
use Aternos\Codex\Minecraft\Analysis\Solution\File\PathType;
6+
use Aternos\Codex\Minecraft\Analysis\Solution\File\FilePathType;
77
use Aternos\Codex\Minecraft\Translator\Translator;
88

99
class AuthMeShutdownSolution extends FileEditSolution
1010
{
1111
public function __construct(
12-
string $path = 'plugins/AuthMe/config.yml',
13-
PathType $type = PathType::RELATIVE,
14-
string $pattern = '/^(\s+)stopServer\: true$/',
15-
string $replacement = '$1stopServer: false'
12+
string $path = 'plugins/AuthMe/config.yml',
13+
FilePathType $type = FilePathType::RELATIVE,
14+
string $pattern = '/^(\s+)stopServer\: true$/',
15+
string $replacement = '$1stopServer: false'
1616
)
1717
{
1818
parent::__construct($path, $type, $pattern, $replacement);

src/Analysis/Solution/File/FileEditSolution.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ class FileEditSolution extends FileSolution implements AutomatableSolutionInterf
1111
/**
1212
* @param string $path The relative path (without a starting slash) or absolute path to the file.
1313
* If the path is relative, it will be treated as relative to the Minecraft server root directory.
14-
* @param PathType $type Is the path relative or absolute?
14+
* @param FilePathType $type Is the path relative or absolute?
1515
* @param string $pattern The regex pattern to search for in the file content.
1616
* @param string $replacement The replacement string for the matched pattern.
1717
*/
1818
public function __construct(
1919
string $path,
20-
PathType $type = PathType::RELATIVE,
20+
FilePathType $type = FilePathType::RELATIVE,
2121
protected string $pattern,
2222
protected string $replacement
2323
)

src/Analysis/Solution/File/PathType.php renamed to src/Analysis/Solution/File/FilePathType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Aternos\Codex\Minecraft\Analysis\Solution\File;
44

5-
enum PathType
5+
enum FilePathType
66
{
77
case RELATIVE;
88
case ABSOLUTE;

src/Analysis/Solution/File/FileSolution.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ abstract class FileSolution extends MinecraftSolution
99
/**
1010
* @param string $path The relative path (without a starting slash) or absolute path to the file.
1111
* If the path is relative, it will be treated as relative to the Minecraft server root directory.
12-
* @param PathType $type Is the path relative or absolute?
12+
* @param FilePathType $type Is the path relative or absolute?
1313
*/
1414
public function __construct(
1515
protected string $path,
16-
protected PathType $type = PathType::RELATIVE
16+
protected FilePathType $type = FilePathType::RELATIVE
1717
)
1818
{
1919
}
@@ -28,7 +28,7 @@ public function __construct(
2828
public function setRelativePath(string $path): static
2929
{
3030
$this->path = $path;
31-
$this->type = PathType::RELATIVE;
31+
$this->type = FilePathType::RELATIVE;
3232
return $this;
3333
}
3434

@@ -41,7 +41,7 @@ public function setRelativePath(string $path): static
4141
public function setAbsolutePath(string $path): static
4242
{
4343
$this->path = $path;
44-
$this->type = PathType::ABSOLUTE;
44+
$this->type = FilePathType::ABSOLUTE;
4545
return $this;
4646
}
4747

@@ -59,9 +59,9 @@ public function getPath(): string
5959
/**
6060
* Get the type of the path (absolute or relative)
6161
*
62-
* @return PathType
62+
* @return FilePathType
6363
*/
64-
public function getType(): PathType
64+
public function getType(): FilePathType
6565
{
6666
return $this->type;
6767
}
@@ -74,7 +74,7 @@ public function getType(): PathType
7474
*/
7575
public function isRelative(): bool
7676
{
77-
return $this->getType() === PathType::RELATIVE;
77+
return $this->getType() === FilePathType::RELATIVE;
7878
}
7979

8080
/**
@@ -84,6 +84,6 @@ public function isRelative(): bool
8484
*/
8585
public function isAbsolutePath(): bool
8686
{
87-
return $this->getType() === PathType::ABSOLUTE;
87+
return $this->getType() === FilePathType::ABSOLUTE;
8888
}
8989
}

src/Analysis/Solution/Folder/FolderSolution.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
namespace Aternos\Codex\Minecraft\Analysis\Solution\Folder;
44

5-
use Aternos\Codex\Minecraft\Analysis\Solution\File\PathType;
5+
use Aternos\Codex\Minecraft\Analysis\Solution\File\FilePathType;
66
use Aternos\Codex\Minecraft\Analysis\Solution\MinecraftSolution;
77

88
abstract class FolderSolution extends MinecraftSolution
99
{
1010
/**
1111
* @param string $path The relative path (without a starting slash) or absolute path to the folder.
1212
* If the path is relative, it will be treated as relative to the Minecraft server root directory.
13-
* @param PathType $type Is the path relative or absolute?
13+
* @param FilePathType $type Is the path relative or absolute?
1414
*/
1515
public function __construct(
1616
protected string $path,
17-
protected PathType $type = PathType::RELATIVE
17+
protected FilePathType $type = FilePathType::RELATIVE
1818
)
1919
{
2020
}
@@ -29,7 +29,7 @@ public function __construct(
2929
public function setRelativePath(string $path): static
3030
{
3131
$this->path = $path;
32-
$this->type = PathType::RELATIVE;
32+
$this->type = FilePathType::RELATIVE;
3333
return $this;
3434
}
3535

@@ -42,7 +42,7 @@ public function setRelativePath(string $path): static
4242
public function setAbsolutePath(string $path): static
4343
{
4444
$this->path = $path;
45-
$this->type = PathType::ABSOLUTE;
45+
$this->type = FilePathType::ABSOLUTE;
4646
return $this;
4747
}
4848

@@ -60,9 +60,9 @@ public function getPath(): string
6060
/**
6161
* Get the type of the path (absolute or relative)
6262
*
63-
* @return PathType
63+
* @return FilePathType
6464
*/
65-
public function getType(): PathType
65+
public function getType(): FilePathType
6666
{
6767
return $this->type;
6868
}
@@ -75,7 +75,7 @@ public function getType(): PathType
7575
*/
7676
public function isRelative(): bool
7777
{
78-
return $this->getType() === PathType::RELATIVE;
78+
return $this->getType() === FilePathType::RELATIVE;
7979
}
8080

8181
/**
@@ -85,6 +85,6 @@ public function isRelative(): bool
8585
*/
8686
public function isAbsolutePath(): bool
8787
{
88-
return $this->getType() === PathType::ABSOLUTE;
88+
return $this->getType() === FilePathType::ABSOLUTE;
8989
}
9090
}

0 commit comments

Comments
 (0)