From 84e5e5a3462723e63e2895d8f287e7728472ff18 Mon Sep 17 00:00:00 2001 From: Netkas Date: Thu, 17 Aug 2023 14:08:22 -0400 Subject: [PATCH] - Corrected code-smell and code style issues in `\ncc\Classes > BashExtension > BashRunner` --- CHANGELOG.md | 2 +- src/ncc/Classes/BashExtension/BashRunner.php | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f70d2b3..87f85d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Corrected code-smell and code style issues in `\ncc\Classes > HttpClient` - - Corrected code-smell and code style issues in `\ncc\Classes > GitClient` + - Corrected code-smell and code style issues in `\ncc\Classes > BashExtension > BashRunner` diff --git a/src/ncc/Classes/BashExtension/BashRunner.php b/src/ncc/Classes/BashExtension/BashRunner.php index c10b993..b4d938b 100644 --- a/src/ncc/Classes/BashExtension/BashRunner.php +++ b/src/ncc/Classes/BashExtension/BashRunner.php @@ -36,13 +36,17 @@ namespace ncc\Classes\BashExtension; */ public static function processUnit(string $path, ExecutionPolicy $policy): ExecutionUnit { - $execution_unit = new ExecutionUnit(); if(!file_exists($path) && !is_file($path)) + { throw new FileNotFoundException($path); - $policy->Execute->Target = null; + } + + $execution_unit = new ExecutionUnit(); $execution_unit->ExecutionPolicy = $policy; $execution_unit->Data = IO::fread($path); + $policy->Execute->Target = null; + return $execution_unit; }