Skip to content

Commit c6432d5

Browse files
Fix typos, gramma and type issues
1 parent 9907fdd commit c6432d5

55 files changed

Lines changed: 127 additions & 109 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CONTRIBUTING.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ So you'd like to contribute to the `CaptainHook` library? Excellent! Thank you v
2121

2222
# Getting started
2323

24-
Fork the project to your own github account. Clone the forked repository to your development machine.
25-
Then run the following two commands to setup the project.
24+
Fork the project to your own GitHub account. Clone the forked repository to your development machine.
25+
Then run the following two commands to set up the project.
2626

2727
$ composer install
2828
$ tools/phive --home ./.phive install --trust-gpg-keys 4AA394086372C20A,31C7E470E2138192,8E730BA25823D8B5 --force-accept-unsigned
@@ -85,31 +85,31 @@ Test data should go in the `test/files` directory.
8585
Add lots of test cases; they're cheap. Don't just test the obvious happy-path cases; test the
8686
null case, where your feature does nothing (make sure it does!). Test edge cases, strange
8787
inputs, missing inputs, non-ASCII characters, zeroes, and nils. Knowing what you know
88-
about your implementation, what inputs and cases might possibly cause it to break? Test those.
88+
about your implementation, what inputs and cases might cause it to break? Test those.
8989

9090
Remember people are using `CaptainHook` in their daily development process
91-
where their data, their privacy, and even their business could be at stake. Now, of course
91+
where their data, their privacy, and even their business could be at stake. Now, of course,
9292
it's up to them to make sure that their programs are safe and correct; library maintainers
9393
bear no responsibility for that. But we can at least ensure that the code is as reliable
9494
and trustworthy as we can make it.
9595

9696
## Style and formatting
9797

98-
This is easy, just use the PSR12 coding standard.
98+
This is straightforward, use the PSR12 coding standard.
9999

100100
Your code should pass `phpstan` and `phpcs` without errors
101101
(and if you want to run other linters too, that would be excellent).
102102

103103
# Documentation
104104

105105
It doesn't matter if you write the greatest piece of code in the history of the world,
106-
if no one knows it exists, or how to use it.
106+
if no one knows it exists or how to use it.
107107

108108
## Write doc comments
109109

110110
Any functions or methods you write should have useful documentation comments in the standard `PHPDoc`
111111
format. Specifically, they should say what inputs the function takes, what it does (in detail),
112-
and what outputs it returns. If it returns an error value or throw an exception,
112+
and what outputs it returns. If it returns an error value or throws an exception,
113113
explain under what circumstances this happens.
114114

115115
## Update the docs
@@ -163,17 +163,17 @@ but responding to code reviews is also a skilled task.
163163

164164
If you find yourself reacting emotionally, take a break. Go walk in the woods for a while, or play
165165
with a laughing child. When you come back to the code, approach it as though it were someone else's,
166-
not your own, and ask yourself seriously whether or not the reviewer _has a point_.
166+
not your own, and ask yourself seriously whether the reviewer _has a point_.
167167

168-
If you genuinely think the reviewer has just misunderstood something, or made a mistake,
168+
If you genuinely think the reviewer has just misunderstood something or made a mistake,
169169
try to clarify the issue. Ask questions, don't make accusations. Remember that every project
170170
has a certain way of doing things, which may not be your way. It's polite to go along with these
171171
practices and conventions.
172172

173-
You may feel as though you're doing the project maintainer a favour by contributing, as indeed you are,
173+
You may feel as though you're doing the project maintainer a favor by contributing, as indeed you are,
174174
but an open source project is like somebody's home. They're used to living there, they probably
175175
like it the way it is, and they don't always respond well to strangers marching in and rearranging the furniture.
176-
Be considerate, and be willing to listen and make changes.
176+
Be considerate and be willing to listen and make changes.
177177

178178
## This may take a while
179179

composer.phar.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "library",
44
"description": "PHP git hook manager",
55
"keywords": ["git", "hooks", "pre-commit", "pre-push", "commit-msg", "prepare-commit-msg", "post-merge"],
6-
"homepage": "http://php.captainhook.info/",
6+
"homepage": "https://php.captainhook.info/",
77
"license": "MIT",
88
"authors": [
99
{

src/Config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@ public function getCustomSettings(): array
303303
}
304304

305305
/**
306-
* Whether to abort the hook as soon as a any action has errored. Default is true.
307-
* Otherwise, all actions get executed (even if some of them have failed) and
306+
* Whether to abort the hook as soon as any action has errored. Default is true.
307+
* Otherwise, all actions get executed (even if some of them have failed), and
308308
* finally, a non-zero exit code is returned if any action has errored.
309309
*
310310
* @return bool

src/Config/Action.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ private function setupSettings(array $settings): void
122122
}
123123

124124
/**
125-
* Marks a action config as included
125+
* Marks an action config as included
126126
*
127127
* @return void
128128
*/

src/Config/Factory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ private function mergeHookConfigFromIncludes(Hook $hook, array $includes): void
301301
}
302302

303303
/**
304-
* Return list of included configurations to add them to the main configuration afterwards
304+
* Return list of included configurations to add them to the main configuration afterward
305305
*
306306
* @param array<string, mixed> $json
307307
* @param string $path

src/Config/Options.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ public function __construct(array $options)
3939
}
4040

4141
/**
42-
* Return a option value
42+
* Return an option value
4343
*
4444
* @template ProvidedDefault
4545
* @param string $name
4646
* @param ProvidedDefault $default
4747
* @return ProvidedDefault|mixed
4848
*/
49-
public function get(string $name, $default = null)
49+
public function get(string $name, $default = null): mixed
5050
{
5151
return $this->options[$name] ?? $default;
5252
}

src/Console/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function __construct(string $executable)
6262
public function doRun(InputInterface $input, OutputInterface $output): int
6363
{
6464
if ($this->isHelpWithoutCommand($input)) {
65-
// Run the `list` command not `list --help`
65+
// Run the `list` command, not `list --help`
6666
return $this->find('list')->run($input, $output);
6767
}
6868
return parent::doRun($input, $output);

src/Console/Command/Add.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ protected function configure(): void
5151
* @return int
5252
* @throws \CaptainHook\App\Exception\InvalidHookName
5353
* @throws \Exception
54+
* @throws \Throwable
5455
*/
5556
protected function execute(InputInterface $input, OutputInterface $output): int
5657
{

src/Console/Command/Configuration.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,11 @@ protected function configure(): void
5353
/**
5454
* Execute the command
5555
*
56-
* @param \Symfony\Component\Console\Input\InputInterface $input
57-
* @param \Symfony\Component\Console\Output\OutputInterface $output
56+
* @param \Symfony\Component\Console\Input\InputInterface $input
57+
* @param \Symfony\Component\Console\Output\OutputInterface $output
5858
* @return int
5959
* @throws \Exception
60+
* @throws \Throwable
6061
*/
6162
protected function execute(InputInterface $input, OutputInterface $output): int
6263
{

src/Console/Command/Disable.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ protected function configure(): void
5151
* @return int
5252
* @throws \CaptainHook\App\Exception\InvalidHookName
5353
* @throws \Exception
54+
* @throws \Throwable
5455
*/
5556
protected function execute(InputInterface $input, OutputInterface $output): int
5657
{

0 commit comments

Comments
 (0)