From 404fc1a5bdcf63cc9be8b9cb0f811874c1382245 Mon Sep 17 00:00:00 2001 From: hydephp Date: Sat, 9 Apr 2022 06:54:18 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Actions/ActionContract.php | 11 ++--------- .../ChecksIfPublishableFileDiffersFromSource.php | 11 ++++++----- src/Hyde.php | 3 ++- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/Actions/ActionContract.php b/src/Actions/ActionContract.php index 233f217d..16cceb41 100644 --- a/src/Actions/ActionContract.php +++ b/src/Actions/ActionContract.php @@ -3,14 +3,7 @@ namespace Hyde\Framework\Actions; /** - * Interface ActionContract - * @package Hyde\Framework\Actions - * - * An Action is a class that handles a single responsibility. - * Actions are useful to separate business logic from controllers. - * - * If the Action is part a Service it should be in the ServiceActions directory. - * See Services which are used to house the logic of a larger system. + * Interface ActionContract. */ interface ActionContract { @@ -18,4 +11,4 @@ interface ActionContract * Execute the action. */ public function execute(); -} \ No newline at end of file +} diff --git a/src/Actions/ChecksIfPublishableFileDiffersFromSource.php b/src/Actions/ChecksIfPublishableFileDiffersFromSource.php index 6af055d0..4d64b68d 100644 --- a/src/Actions/ChecksIfPublishableFileDiffersFromSource.php +++ b/src/Actions/ChecksIfPublishableFileDiffersFromSource.php @@ -10,9 +10,9 @@ class ChecksIfPublishableFileDiffersFromSource implements ActionContract protected string $compareTo; /** - * @param string $filepath relative to Hyde installation to check. - * @param string|null $compareTo optionally specify the filepath to search for in the cache. - * Omit to search for a file with the same name as the supplied filepath. + * @param string $filepath relative to Hyde installation to check. + * @param string|null $compareTo optionally specify the filepath to search for in the cache. + * Omit to search for a file with the same name as the supplied filepath. */ public function __construct(string $filepath, ?string $compareTo = null) { @@ -24,6 +24,7 @@ public function __construct(string $filepath, ?string $compareTo = null) ** Check if a publishable file has been modified. * * Useful to determine if it is safe to overwrite a file. + * * @see https://github.com/hydephp/framework/issues/67 * * @return bool|null true if file has been modified, false if not, @@ -39,9 +40,9 @@ public function execute(): bool|null return null; } - + public static function getFilecache(): array { return json_decode(file_get_contents(Hyde::vendorPath('resources/data/filecache.json')), true); } -} \ No newline at end of file +} diff --git a/src/Hyde.php b/src/Hyde.php index 3d18eec5..c34901ff 100644 --- a/src/Hyde.php +++ b/src/Hyde.php @@ -71,10 +71,11 @@ public static function path(string $path = ''): string return getcwd().DIRECTORY_SEPARATOR.$path; } - /** + /** * Works similarly to the path() function, but returns a file in the Framework package. * * @todo Write a test for this function. + * * @param string $path * @return string */