Skip to content

Commit c2548d3

Browse files
TysonAndreWilfred
authored andcommitted
Fix miscellaneous typos detected by codespell
"inbetween" should either be "in-between" or "between" https://en.wiktionary.org/wiki/targetting is no longer used in British
1 parent 3d93b24 commit c2548d3

File tree

11 files changed

+23
-23
lines changed

11 files changed

+23
-23
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ While we aren't 100% rigid on how we want contributions to come to us (we want t
5555
+ `.php.hhvm.expect[f]`: An HHVM test runner [hhvm expect file](https://github.com/facebook/hhvm/blob/master/hphp/test/README.md#file-layout) with the expected results of running your code in HHVM.
5656
+ `.php.typechecker.expect[f]`: An HHVM test runner [typechecker expect file](https://github.com/facebook/hhvm/blob/master/hphp/test/README.md#file-layout) with the expected results of running the typechecker on your code (e.g., in `--typechecker` mode). Most of the time this should be a file that contains `No errors!`.
5757
+ `.php.example.hhvm.out`: If you are using an `.hhvm.expectf` file, then this file will be a raw output version of that file without any patterns. i.e., the result of running `hhvm` on the source file.
58-
+ `.php.no.auto.output`: Don't print out any output after the source code. This supercedes `.php.example.hhvm.out` and `.hhvm.expect` (i.e., those files will be ignored when it comes to printing raw output in the docs). Use this if you want to control where the output goes, or if you want no output at all.
58+
+ `.php.no.auto.output`: Don't print out any output after the source code. This supersedes `.php.example.hhvm.out` and `.hhvm.expect` (i.e., those files will be ignored when it comes to printing raw output in the docs). Use this if you want to control where the output goes, or if you want no output at all.
5959
Add `.type-errors` after `.php` or `.hack` if typechecker errors are expected.
6060

6161
The [examples associated with the async introduction](https://github.com/hhvm/user-documentation/tree/master/guides/hack/22-async/01-introduction-examples) will give you a guide on how to structure these files.

guides/hack/01-getting-started/03-starting-a-real-project.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ The fallback is called when hhvm can't find your type, constant or function in t
4949

5050
The fallback then may attempt to load the type, constant or function at runtime.
5151
(This process will slow down your execution considerably and should therefore not used in production.)
52-
Not all contants and functions can / will be found by HHClientFallbackHandler, see the [repository](https://github.com/hhvm/hhvm-autoload) for more details.
52+
Not all constants and functions can / will be found by HHClientFallbackHandler, see the [repository](https://github.com/hhvm/hhvm-autoload) for more details.
5353

5454
Once this configuration file is created, `vendor/bin/hh-autoload` can be executed
5555
to generate or update the map, which is created as `vendor/autoload.hack`

guides/hack/11-built-in-types/22-arrays.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ To remove an element from a dict, use `unset`.
106106
## keyset
107107

108108
A keyset is a data structure that contains an ordered collection of zero or more elements whose values are the keys. And as array keys must have
109-
type `int` or `string`, keysets are restricted to homogenous collections of
109+
type `int` or `string`, keysets are restricted to homogeneous collections of
110110
values of those types (the `arraykey` type can be used to declare a keyset that
111111
accepts both `int` and `string` values, but it's usually better to be explicit
112112
and choose only one type). As the number of elements in a keyset
@@ -264,7 +264,7 @@ Individual runtime settings are documented [here](darray-varray-runtime-options.
264264

265265
## Value vs. reference semantics
266266

267-
An important distinction between `arrays` and `Collections` is their interation with value semantics.
267+
An important distinction between `arrays` and `Collections` is their interaction with value semantics.
268268
All `arrays` (recognizable by their lowercase names) have value semantics.
269269
All `Collections` (recognizable by their uppercase names) have reference semantics.
270270

@@ -289,7 +289,7 @@ Watch out! Collections have reference semantics!
289289
@@ arrays-examples/maps-have-reference-semantics.php @@
290290

291291
This difference makes it very difficult to migrate from Containers to arrays.
292-
It is recommended to not share a mutable reference to a Collection accross a codebase.
292+
It is recommended to not share a mutable reference to a Collection across a codebase.
293293
If this is required for the correctness of your program, but you are migrating to Hack arrays, you can use `HH\Lib\Ref<T>`.
294294
Pass a `Ref<dict<string, string>>` around your program instead of a `Map<string, string>`.
295295
This makes it obvious that you intend to mutate the dict.

guides/hack/11-built-in-types/56-darray-varray-runtime-options.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ If it does not raise a warning, this option is not available in your version of
2525

2626
A `vec<_>` does not support implicitly appending. You can only append using an empty subscript operator `$x[] = ''` and update using a keyed subscript operator `$x[2] = ''`. The runtime will throw when you use the updating syntax in order to append. `'OutOfBoundsException' with message 'Out of bounds vec access: invalid index 2'`.
2727

28-
A `varray<_>` will, as of now, accept you implicitly appending a key. It will remain a `varray<_>`. This is the only case where writing to a non existant index in a `varray<_>` will not cause the `varray<_>` to escalate to a `darray<_, _>`. More information about array escalation can be found below.
28+
A `varray<_>` will, as of now, accept you implicitly appending a key. It will remain a `varray<_>`. This is the only case where writing to a non existent index in a `varray<_>` will not cause the `varray<_>` to escalate to a `darray<_, _>`. More information about array escalation can be found below.
2929

3030
## Check varray promote
3131

@@ -60,7 +60,7 @@ The second situation, calling unset on an element of a `varray<_>`, can have mul
6060

6161
The first case is most likely a confusion caused by a removed behavior of all legacy arrays. Before hhvm 4 accessing an key that wasn't present would log a notice and return null. An unset on an array would under these circumstances act very similarly to explicitly setting to value to null. This is however quite tricky to do right if this array is being passed around the program a lot. An unset key is actually removed from the array. This means that `C\contains_key()` will return `false`, `idx()` will return its default argument, and `??` will evaluate to the RHS. However, explicitly setting the value to `null` does not remove the key from the array. This means that `C\contains_key()` returns `true`, `idx()` will return the `null`, but `??` will be unaffected.
6262

63-
The second usecase is not met by Hack arrays. There is no `Container<_>` type that allows you to append to the end and remove things by index (except for `keyset<_>`, but that has a constraint value type). You can however emulate this behavior using a `varray<_>` or `vec<_>`. Removing the first key can be done using `Vec\drop($x, 1)`. Removing the last key can be done using `\array_pop()` <span class="fbonly apiAlias">`C\fb\pop_back`</span>. Removing a key from the middle can be done with the slightly unwieldly `Vec\filter_with_key($x, ($key, $_) ==> $key === 1)`. All of these will rekey the array. Any values after the key will be shifted down. This does however have a computational complexity of `O(n)`. If you need to remove a lot of keys from the middle that are next to eachother, use `Vec\slice()` to save some resources. If you need to remove a ton of arbitrary keys, at different points of your function it might be better to `dict($x)`, unset on the `dict<_, _>` and rekey it back to a `varray<_>` using `varray()` or `array_values()` depending on your hhvm version.
63+
The second usecase is not met by Hack arrays. There is no `Container<_>` type that allows you to append to the end and remove things by index (except for `keyset<_>`, but that has a constraint value type). You can however emulate this behavior using a `varray<_>` or `vec<_>`. Removing the first key can be done using `Vec\drop($x, 1)`. Removing the last key can be done using `\array_pop()` <span class="fbonly apiAlias">`C\fb\pop_back`</span>. Removing a key from the middle can be done with the slightly unwieldy `Vec\filter_with_key($x, ($key, $_) ==> $key === 1)`. All of these will rekey the array. Any values after the key will be shifted down. This does however have a computational complexity of `O(n)`. If you need to remove a lot of keys from the middle that are next to each other, use `Vec\slice()` to save some resources. If you need to remove a ton of arbitrary keys, at different points of your function it might be better to `dict($x)`, unset on the `dict<_, _>` and rekey it back to a `varray<_>` using `varray()` or `array_values()` depending on your hhvm version.
6464

6565
The third usecase used to be valid Hack. Unsetting the last index of a `varray<_>` or `vec<_>` was allowed and acted like an `\array_pop()`<span class="fbonly apiAlias">`C\fb\pop_back`</span>. This will currently not generate a warning, but it is unclear to me if this will continue to be allowed. The typechecker already raises a typeerror when you use unset on a non dictionary/hashmap like array type.
6666

guides/hack/11-built-in-types/74-nothing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ Let's work out the hierarchy of scalar types. Forget about nullable types and `d
1313
- `string` is a subtype of `arraykey`.
1414
- `nothing` is a subtype of `int`, `float`, `string`, and `bool`.
1515

16-
The important thing to note here is that `nothing` is never inbetween two types. `nothing` only shows up right below a type with no other subtypes.
16+
The important thing to note here is that `nothing` is never between two types. `nothing` only shows up right below a type with no other subtypes.
1717

1818
Okay that was all very academical, but "what can I use it for?", I hear you ask.
1919

2020
When making a new / empty `Container<T>`, Hack will infer its type to be `Container<nothing>`. It is not that there are actual value of type `nothing` in the `Container<T>`, it is just that this is a very nice way of modeling empty `Container<T>`s.
2121

22-
Should you be able to pass an empty vec where a `vec<string>` is expected? Yes, there is no element inside that is not a `string`, so that shoud be fine. You can even pass the same vec into a function that takes a `vec<bool>` since there are no elements that are not of type `bool`. What are you allowed to do with the `$nothing` of this foreach? Well, you can do anything to it. Since nothing is a subtype of everything, you can pass it to any method and do all the things you want to.
22+
Should you be able to pass an empty vec where a `vec<string>` is expected? Yes, there is no element inside that is not a `string`, so that should be fine. You can even pass the same vec into a function that takes a `vec<bool>` since there are no elements that are not of type `bool`. What are you allowed to do with the `$nothing` of this foreach? Well, you can do anything to it. Since nothing is a subtype of everything, you can pass it to any method and do all the things you want to.
2323

2424
@@ nothing-examples/empty-vec.php @@
2525

guides/hack/12-generics/19-type-erasure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ following situations:
3939
* As the type of a static property.
4040
* As the type of the exception in a catch block: `catch (T $exception)`
4141

42-
For passing around class names for for instantation, Hack provides
42+
For passing around class names for for instantiation, Hack provides
4343
[`Classname<T>`](../built-in-types/classname.md) that extends the
4444
representation of `Foo::class`.

guides/hack/15-asynchronous-operations/15-await-as-an-expression.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $result = foo(
2323
await baz_async(), // yes!
2424
);
2525
if (await x_async()) { // yes!
26-
// Conditional but seperate statement
26+
// Conditional but separate statement
2727
await y_async(); // yes!
2828
}
2929
$x =

guides/hack/30-silencing-errors/05-error-codes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ which the typechecker is unaware of.
3535
Suggestions: Check your spelling. Use safe Hack APIs rather than
3636
legacy PHP APIs.
3737

38-
## 4005: Array acces on a type that doesn't support indexing
38+
## 4005: Array access on a type that doesn't support indexing
3939

4040
@@ error-codes-examples/4005_array_access.php @@
4141

@@ -129,7 +129,7 @@ exception.
129129
Suggestions: Check that the value is non-null with `nullthrows` or
130130
assert with `$m as nonnull`.
131131

132-
## 4101: Wrong number of type paramters
132+
## 4101: Wrong number of type parameters
133133

134134
@@ error-codes-examples/4101_type_params.php @@
135135

guides/hhvm/03-advanced-usage/02-repo-authoritative.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ path behavior:
153153

154154
### NGINX
155155

156-
For NGINX, a minimial configuration is:
156+
For NGINX, a minimal configuration is:
157157

158158
```
159159
events {

0 commit comments

Comments
 (0)