Skip to content

Commit

Permalink
up: update some dep version, update git chlog params
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Dec 5, 2021
1 parent 89d68b5 commit 7f20d90
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 15 deletions.
6 changes: 3 additions & 3 deletions app/Console/Controller/GitController.php
Original file line number Diff line number Diff line change
Expand Up @@ -805,8 +805,8 @@ public function logCommand(FlagsParser $fs, Output $output): void
* wl word length filter.
* --format The git log option `--pretty` value.
* can be one of oneline, short, medium, full, fuller, reference, email, raw, format:<string> and tformat:<string>.
* --style The style for generate for changelog.
* allow: markdown(<cyan>default</cyan>), simple, gh-release
* -s, --style The style for generate for changelog.
* allow: markdown(<cyan>default</cyan>), simple, gh-release(ghr)
* --repo-url The git repo URL address. eg: https://github.com/inhere/kite
* default will auto use current git origin remote url
* --no-merges bool;No contains merge request logs
Expand Down Expand Up @@ -893,7 +893,7 @@ public function changelogCommand(FlagsParser $fs, Output $output): void
}

$style = $fs->getOpt('style');
if ($style === 'gh-release') {
if ($style === 'ghr' || $style === 'gh-release') {
$gcl->setItemFormatter(new GithubReleaseFormatter());
} elseif ($style === 'simple') {
$gcl->setItemFormatter(new SimpleFormatter());
Expand Down
23 changes: 12 additions & 11 deletions app/Lib/Jump/JumpStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
use function md5;
use function str_replace;
use function stripos;
use function strpos;
use const JSON_PRETTY_PRINT;
use const JSON_UNESCAPED_SLASHES;

Expand All @@ -38,22 +37,22 @@ class JumpStorage implements JsonSerializable
/**
* @var string
*/
private $datafile;
private string $datafile;

/**
* @var bool
*/
private $dataChanged = false;
private bool $dataChanged = false;

/**
* @var string
*/
private $prevPath = '';
private string $prevPath = '';

/**
* @var string
*/
private $lastPath = '';
private string $lastPath = '';

/**
* Named jump paths.
Expand All @@ -68,7 +67,7 @@ class JumpStorage implements JsonSerializable
*
* @var array
*/
private $namedPaths = [];
private array $namedPaths = [];

/**
*
Expand All @@ -83,12 +82,12 @@ class JumpStorage implements JsonSerializable
*
* @var string[]
*/
private $histories = [];
private array $histories = [];

/**
* @var bool
*/
private $windowsOS;
private bool $windowsOS;

/**
* Class constructor.
Expand Down Expand Up @@ -285,7 +284,7 @@ public function matchOne(string $keywords): string
}

foreach ($this->histories as $path) {
if (strpos($path, $keywords) !== false) {
if (str_contains($path, $keywords)) {
return $path;
}
}
Expand Down Expand Up @@ -372,6 +371,7 @@ public function formatPath(string $path): string

/**
* @return string
* @throws \JsonException
*/
public function __toString(): string
{
Expand All @@ -380,6 +380,7 @@ public function __toString(): string

/**
* @return string
* @throws \JsonException
*/
public function toString(): string
{
Expand Down Expand Up @@ -418,11 +419,11 @@ public function genID(string $path): string
* Specify data which should be serialized to JSON
*
* @link https://php.net/manual/en/jsonserializable.jsonserialize.php
* @return mixed data which can be serialized by <b>json_encode</b>,
* @return array data which can be serialized by <b>json_encode</b>,
* which is a value of any type other than a resource.
* @since 5.4
*/
public function jsonSerialize()
public function jsonSerialize(): array
{
return $this->toArray();
}
Expand Down
13 changes: 13 additions & 0 deletions app/func.php
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
<?php

if (!function_exists('env')) {
/**
* @param string $key
* @param string $default
*
* @return string
*/
function env(string $key, string $default = ''): string
{
return Toolkit\Stdlib\OS::getEnvStrVal($key, $default);
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"phppkg/hucron": "dev-master",
"phppkg/phpgit": "dev-master",
"phppkg/cli-markdown": "^1.0",
"toolkit/fsutil": "^1.0",
"toolkit/fsutil": "^2.0",
"colinodell/json5": "^2.2",
"laktak/hjson": "^2.1",
"knplabs/github-api": "^3.3",
Expand Down

0 comments on commit 7f20d90

Please sign in to comment.