Skip to content

Commit

Permalink
Merge pull request #82 from hydephp/analysis-bQw1PY
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
hydephp authored Apr 9, 2022
2 parents 0f9a9e4 + 404fc1a commit b3852ba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
11 changes: 2 additions & 9 deletions src/Actions/ActionContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,12 @@
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
{
/**
* Execute the action.
*/
public function execute();
}
}
11 changes: 6 additions & 5 deletions src/Actions/ChecksIfPublishableFileDiffersFromSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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,
Expand All @@ -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);
}
}
}
3 changes: 2 additions & 1 deletion src/Hyde.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit b3852ba

Please sign in to comment.