Skip to content

Commit df09ebd

Browse files
Add type hints
1 parent 77ef87b commit df09ebd

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

src/Config/Condition.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ class Condition
2727
*
2828
* @var string
2929
*/
30-
private $exec;
30+
private string $exec;
3131

3232
/**
3333
* Condition arguments
3434
*
3535
* @var array<mixed>
3636
*/
37-
private $args;
37+
private array $args;
3838

3939
/**
4040
* Condition constructor

src/Config/Hook.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ class Hook
2727
*
2828
* @var string
2929
*/
30-
private $name;
30+
private string $name;
3131

3232
/**
3333
* Is hook enabled
3434
*
3535
* @var bool
3636
*/
37-
private $isEnabled = false;
37+
private bool $isEnabled;
3838

3939
/**
4040
* List of Actions

src/Config/Options.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Options
2626
*
2727
* @var array<string, mixed>
2828
*/
29-
private $options;
29+
private array $options;
3030

3131
/**
3232
* Options constructor

src/Config/Plugin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ class Plugin
2929
*
3030
* @var string
3131
*/
32-
private $plugin;
32+
private string $plugin;
3333

3434
/**
3535
* Map of options name => value
3636
*
3737
* @var Options
3838
*/
39-
private $options;
39+
private Options $options;
4040

4141
/**
4242
* Plugin constructor

src/Console/Command.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ abstract class Command extends SymfonyCommand
3030
/**
3131
* Input output handler
3232
*
33-
* @var \CaptainHook\App\Console\IO
33+
* @var \CaptainHook\App\Console\IO|null
3434
*/
35-
private $io;
35+
private ?IO $io = null;
3636

3737
/**
3838
* Runtime resolver

src/Console/IOUtil.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ public static function answerToBool(string $answer): bool
6464
/**
6565
* Create formatted cli headline
6666
*
67-
* >>>> HEADLINE <<<<
68-
* ==== HEADLINE ====
67+
* ">>>> HEADLINE <<<<"
68+
* "==== HEADLINE ===="
6969
*
7070
* @param string $headline
7171
* @param int $length
@@ -93,7 +93,7 @@ public static function formatHeadline(string $headline, int $length, string $pre
9393
* @param string $default
9494
* @return string
9595
*/
96-
public static function argToString($arg, string $default = ''): string
96+
public static function argToString(mixed $arg, string $default = ''): string
9797
{
9898
return is_string($arg) ? $arg : $default;
9999
}
@@ -105,7 +105,7 @@ public static function argToString($arg, string $default = ''): string
105105
* @param bool $default
106106
* @return bool
107107
*/
108-
public static function argToBool($arg, bool $default = false): bool
108+
public static function argToBool(mixed $arg, bool $default = false): bool
109109
{
110110
return is_bool($arg) ? $arg : $default;
111111
}

0 commit comments

Comments
 (0)