1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 12:24:49 +01:00

Fix wording nits in documentation

This commit is contained in:
Tyson Andre 2018-10-27 12:54:13 -04:00 committed by Matthew Brown
parent 750ef3e443
commit 6ba76e1589
4 changed files with 9 additions and 9 deletions

View File

@ -13,7 +13,7 @@ It's able to find a [large number of issues](https://github.com/vimeo/psalm/blob
## Psalm documentation
Documentation is available on [Psalms website](https://getpsalm.org/docs), generated from the [docs](https://github.com/vimeo/psalm/blob/master/docs) folder.
Documentation is available on [Psalms website](https://getpsalm.org/docs), generated from the [docs](https://github.com/vimeo/psalm/blob/master/docs) folder.
## Quickstart Guide
@ -35,7 +35,7 @@ Then run Psalm:
./vendor/bin/psalm
```
The config created above will show you all issues in your code, but will emit `INFO` issues (as opposed to `ERROR`) for certain common trivial code problems. If you want a more lenient config you can specify the level with
The config created above will show you all issues in your code, but will emit `INFO` issues (as opposed to `ERROR`) for certain common trivial code problems. If you want a more lenient config, you can specify the level with
```bash
./vendor/bin/psalm --init [source_dir] [level]

View File

@ -59,7 +59,7 @@ Psalm uses an XML config file. A barebones example looks like this:
- `allowFileIncludes=[bool]`<br />
whether or not to allow `require`/`include` calls in your PHP. Defaults to `true`.
- `serializer=["igbinary"|"default"]`<br />
Allows you to hard-code a serializer for Psalm to use when caching data. By default Psalm uses `ext-igbinary` *if* the version is greater or equal to 2.0.5, otherwise it defaults to PHP's built-in serializer.
Allows you to hard-code a serializer for Psalm to use when caching data. By default, Psalm uses `ext-igbinary` *if* the version is greater or equal to 2.0.5, otherwise it defaults to PHP's built-in serializer.
## Project settings
@ -84,5 +84,5 @@ Psalm uses an XML config file. A barebones example looks like this:
Do you use mock classes in your tests? If you want Psalm to ignore them when checking files, include a fully-qualified path to the class with `<class name="Your\Namespace\ClassName" />`
- `<stubs>` (optional)<br />
If you codebase uses classes and functions that are not visible to Psalm via reflection (e.g. if there are internal packages that your codebase relies on that are not available on the machine running Psalm), you can use stub files. Used by PhpStorm (a popular IDE) and others, stubs provide a description of classes and functions without the implementations. You can find a list of stubs for common classes [here](https://github.com/JetBrains/phpstorm-stubs). List out each file with `<file name="path/to/file.php" />`.

View File

@ -33,7 +33,7 @@ I've got it working with [this plugin](https://plugins.jetbrains.com/plugin/1020
Setup is done via a GUI.
When you install the plugin you should see a "Language Server Protocol" section under the "Languages & Frameworks" tab.
When you install the plugin, you should see a "Language Server Protocol" section under the "Languages & Frameworks" tab.
In the "Server definitions" tab you should add a definition for Psalm:
@ -62,7 +62,7 @@ I use the excellent Sublime [LSP plugin](https://github.com/tomv564/LSP) with th
**ALE**
LSP supported was recently added to [ALE](https://github.com/w0rp/ale)'s master branch, but not yet in a tagged release.
LSP support was recently added to [ALE](https://github.com/w0rp/ale)'s master branch, but not yet in a tagged release.
**vim-lsp**

View File

@ -4,7 +4,7 @@ Psalm is able to interpret all PHPDoc type annotations, and use them to further
## Union Types
PHP and other dynamically-typed languages allow expressions to resolved to conflicting types for example, after this statement
PHP and other dynamically-typed languages allow expressions to resolve to conflicting types for example, after this statement
```php
$rabbit = rand(0, 10) === 4 ? 'rabbit' : ['rabbit'];
```
@ -58,7 +58,7 @@ foreach ([1, 2, 3] as $i) {
}
```
Because Psalm scans a file progressively, it cannot tell that `return $a` produces an integer. Instead it knows only that `$a` is not `empty`. We can fix this by adding a type hint docblock:
Because Psalm scans a file progressively, it cannot tell that `return $a` produces an integer. Instead, it knows only that `$a` is not `empty`. We can fix this by adding a type hint docblock:
```php
/** @var int|null */