Skip to content

Commit 2c99664

Browse files
committed
enhance handle path errors
1 parent 1fbff20 commit 2c99664

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"role": "Developer"
3030
}
3131
],
32-
"version": "1.0.0",
32+
"version": "1.0.1",
3333
"require": {
3434
"php": "^8.1",
3535
"omaralalwi/php-builders": "^1.0"

src/Managers/ConfigManager.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,14 @@ class ConfigManager
3737
*/
3838
public function __construct(array $config = [])
3939
{
40-
if (empty($config['scripts_directory'])) {
41-
throw new InvalidArgumentException("Scripts directory is not configured.");
40+
$directory = $config['scripts_directory'];
41+
42+
if (empty($directory)) {
43+
throw new InvalidArgumentException("Scripts directory {$directory} is not configured.");
4244
}
4345

44-
if (!is_dir($config['scripts_directory'])) {
45-
throw new InvalidArgumentException("Scripts directory is invalid or does not exist.");
46+
if (!is_dir($directory)) {
47+
throw new InvalidArgumentException("Scripts directory {$directory} is invalid or does not exist.");
4648
}
4749

4850
if (empty($config['python_executable'])) {

0 commit comments

Comments
 (0)