Expand documentation for Helper directory.

This commit is contained in:
James Cole
2018-07-07 23:14:16 +02:00
parent 8e08ff2d39
commit 10492e3b2f
30 changed files with 328 additions and 51 deletions

View File

@@ -35,14 +35,14 @@ use Route;
*/
class Help implements HelpInterface
{
/**
*
*/
/** @var string The cache key */
public const CACHEKEY = 'help_%s_%s';
/** @var string */
/** @var string The user agent. */
protected $userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36';
/**
* Get from cache.
*
* @param string $route
* @param string $language
*
@@ -56,12 +56,14 @@ class Help implements HelpInterface
}
/**
* Get text from GitHub.
*
* @param string $route
* @param string $language
*
* @return string
*/
public function getFromGithub(string $route, string $language): string
public function getFromGitHub(string $route, string $language): string
{
$uri = sprintf('https://raw.githubusercontent.com/firefly-iii/help/master/%s/%s.md', $language, $route);
Log::debug(sprintf('Trying to get %s...', $uri));
@@ -89,6 +91,8 @@ class Help implements HelpInterface
}
/**
* Do we have the route?
*
* @param string $route
*
* @return bool
@@ -99,6 +103,8 @@ class Help implements HelpInterface
}
/**
* Is in cache?
*
* @param string $route
* @param string $language
*
@@ -119,6 +125,8 @@ class Help implements HelpInterface
}
/**
* Put help text in cache.
*
* @param string $route
* @param string $language
* @param string $content