Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache refactor #452

Open
wants to merge 13 commits into
base: release/10.0.0
Choose a base branch
from
Prev Previous commit
Next Next commit
updating cache and helpers
  • Loading branch information
iruzevic committed Feb 21, 2025
commit 4224cd0917389b31fd3d7e9d5541566801140a80
2 changes: 1 addition & 1 deletion src/ConfigProject/ConfigProjectCli.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function getCommandName(): string
public function getDefaultArgs(): array
{
return [
'path' => Helpers::getProjectPaths('projectRoot'),
'path' => Helpers::getProjectPaths('root'),
];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Db/ExportCli.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function __invoke(array $args, array $assocArgs)

try {
dbExport( // phpcs:ignore
Helpers::getProjectPaths('projectRoot')
Helpers::getProjectPaths('root')
);
} catch (ExitException $e) {
exit("{$e->getCode()}: {$e->getMessage()}"); // phpcs:ignore Eightshift.Security.HelpersEscape.OutputNotEscaped
Expand Down
2 changes: 1 addition & 1 deletion src/Db/ImportCli.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function getDefaultArgs(): array
'from' => '',
'to' => '',
'file_name' => '',
'setup_file' => Helpers::getProjectPaths('projectRoot', 'setup.json'),
'setup_file' => Helpers::getProjectPaths('root', 'setup.json'),
];
}

Expand Down
2 changes: 1 addition & 1 deletion src/GitIgnore/GitIgnoreCli.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function getCommandName(): string
public function getDefaultArgs(): array
{
return [
'path' => Helpers::getProjectPaths('projectRoot'),
'path' => Helpers::getProjectPaths('root'),
];
}

Expand Down
4 changes: 2 additions & 2 deletions src/Helpers/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public static function getProjectPaths(string $type, array|string $suffix = ''):
}

switch ($type) {
case 'projectRoot':
case 'root':
return self::joinPaths([\dirname(__FILE__, 9), ...$suffix]);
case 'src':
return self::joinPaths([$root, 'src', ...$suffix]);
Expand All @@ -270,7 +270,7 @@ public static function getProjectPaths(string $type, array|string $suffix = ''):
case 'wrapper':
return self::joinPaths([$root, 'src', 'Blocks', 'wrapper', ...$suffix]);
default:
return '';
return $root;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Readme/ReadmeCli.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function getCommandName(): string
public function getDefaultArgs(): array
{
return [
'path' => Helpers::getProjectPaths('projectRoot'),
'path' => Helpers::getProjectPaths('root'),
];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Setup/SetupCli.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function getCommandName(): string
public function getDefaultArgs(): array
{
return [
'path' => Helpers::getProjectPaths('projectRoot'),
'path' => Helpers::getProjectPaths('root'),
'file_name' => 'setup.json',
'source_path' => __DIR__,
];
Expand Down