mirror of
https://github.com/standardebooks/web.git
synced 2025-07-07 07:10:29 -04:00
Code style tweaks to satisfy PHPStan
This commit is contained in:
parent
658db66c2b
commit
5c4617d759
6 changed files with 19 additions and 6 deletions
|
@ -1,13 +1,16 @@
|
|||
<?
|
||||
use function Safe\glob;
|
||||
use function Safe\preg_match_all;
|
||||
use function Safe\sort;
|
||||
|
||||
class Manual{
|
||||
public static function GetLatestVersion(){
|
||||
public static function GetLatestVersion(): string{
|
||||
$dirs = glob(MANUAL_PATH . '/*', GLOB_ONLYDIR);
|
||||
sort($dirs);
|
||||
return str_replace(MANUAL_PATH . '/', '', $dirs[sizeof($dirs) - 1]);
|
||||
}
|
||||
|
||||
public static function GetRequestedVersion(){
|
||||
public static function GetRequestedVersion(): ?string{
|
||||
try{
|
||||
if(preg_match_all('|/manual/([0-9]+\.[0-9]+\.[0-9]+)|ius', $_SERVER['REQUEST_URI'], $matches)){
|
||||
return($matches[1][0]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue