Skip to content

Commit 66b8924

Browse files
committed
Fix directory path resolution
1 parent bf726c7 commit 66b8924

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/Phug/Split/Command/Analyze.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Analyze extends CommandBase
1616
*
1717
* Root project directory.
1818
*
19-
* @var truthy-string|false
19+
* @var string
2020
*/
2121
public $directory = '.';
2222

@@ -51,12 +51,15 @@ public function run(SimpleCli $cli): bool
5151

5252
protected function calculatePackagesTree(Split $cli): bool
5353
{
54-
$this->directory = realpath($this->directory);
54+
/** @psalm-var truthy-string|false $directory */
55+
$directory = realpath($this->directory);
5556

56-
if (!$this->directory) {
57+
if (!$directory) {
5758
return $cli->error('Input directory not found.');
5859
}
5960

61+
$this->directory = $directory;
62+
6063
$cli->chdir($this->directory);
6164

6265
if (!file_exists($this->composerFile)) {

src/Phug/Split/Command/CommandBase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected function gitEscape(string $value): string
5353
*
5454
* @return string
5555
*
56-
* @psalm-suppress UndefinedThisPropertyFetch
56+
* @psalm-suppress UndefinedThisPropertyFetch RiskyTruthyFalsyComparison
5757
*/
5858
protected function getGitCommand(string $command, array $options = [], string $redirect = null): string
5959
{

0 commit comments

Comments
 (0)