From 78b36e2cbb7f64fce1e6277eadc76dd6ea9c8970 Mon Sep 17 00:00:00 2001 From: Sebastian Feldmann Date: Tue, 11 Feb 2025 20:08:43 +0100 Subject: [PATCH] Add type definitions --- src/Command/Add/AddFiles.php | 12 ++++++------ src/Command/Apply/ApplyPatch.php | 8 ++++---- src/Command/Checkout/RestoreWorkingTree.php | 4 ++-- src/Command/CloneCmd/CloneCmd.php | 6 +++--- src/Command/Config/Get.php | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Command/Add/AddFiles.php b/src/Command/Add/AddFiles.php index abc1002..bdf86f2 100644 --- a/src/Command/Add/AddFiles.php +++ b/src/Command/Add/AddFiles.php @@ -28,42 +28,42 @@ class AddFiles extends Base * * @var string */ - private $dryRun = ''; + private string $dryRun = ''; /** * Update. * * @var string */ - private $update = ''; + private string $update = ''; /** * All. * * @var string */ - private $all = ''; + private string $all = ''; /** * No all. * * @var string */ - private $noAll = ''; + private string $noAll = ''; /** * Intent to add. * * @var string */ - private $intentToAdd = ''; + private string $intentToAdd = ''; /** * Files to add content from to the index. * * @var string[] */ - private $files = []; + private array $files = []; /** * Set dry run. diff --git a/src/Command/Apply/ApplyPatch.php b/src/Command/Apply/ApplyPatch.php index 303f369..f8e0971 100644 --- a/src/Command/Apply/ApplyPatch.php +++ b/src/Command/Apply/ApplyPatch.php @@ -28,28 +28,28 @@ class ApplyPatch extends Base * * @var string[] */ - private $patchFiles = []; + private array $patchFiles = []; /** * Action to take when encountering whitespace. * * @var string */ - private $whitespace = ' --whitespace=\'warn\''; + private string $whitespace = ' --whitespace=\'warn\''; /** * Number of leading path components to remove from the diff paths. * * @var string */ - private $pathComponents = ' -p1'; + private string $pathComponents = ' -p1'; /** * Ignore changes in whitespace in context lines. * * @var string */ - private $ignoreSpaceChange = ''; + private string $ignoreSpaceChange = ''; /** * Patch files to apply. diff --git a/src/Command/Checkout/RestoreWorkingTree.php b/src/Command/Checkout/RestoreWorkingTree.php index 11f049b..e37f017 100644 --- a/src/Command/Checkout/RestoreWorkingTree.php +++ b/src/Command/Checkout/RestoreWorkingTree.php @@ -28,14 +28,14 @@ class RestoreWorkingTree extends Base * * @var array */ - private $files = ['.']; + private array $files = ['.']; /** * Skip the checkout hooks? * * @var bool */ - private $noMoreHooks = false; + private bool $noMoreHooks = false; /** * Do not trigger git hooks while restoring diff --git a/src/Command/CloneCmd/CloneCmd.php b/src/Command/CloneCmd/CloneCmd.php index f668b8f..b16be51 100644 --- a/src/Command/CloneCmd/CloneCmd.php +++ b/src/Command/CloneCmd/CloneCmd.php @@ -30,17 +30,17 @@ final class CloneCmd extends Base /** * @var Url */ - private $url; + private Url $url; /** * @var string */ - private $dir = ''; + private string $dir = ''; /** * @var string */ - private $depth = ''; + private string $depth = ''; public function __construct(Url $url) { diff --git a/src/Command/Config/Get.php b/src/Command/Config/Get.php index 5b1679a..f97f201 100644 --- a/src/Command/Config/Get.php +++ b/src/Command/Config/Get.php @@ -28,7 +28,7 @@ class Get extends Base * * @var string */ - private $name; + private string $name; /** * The name of the configuration key to get.