Skip to content

Commit

Permalink
docs: update docs for release 0.6.5
Browse files Browse the repository at this point in the history
  • Loading branch information
canvural committed Oct 15, 2020
1 parent 5c49b20 commit 585f53d
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 2 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [0.6.5] - 2020-10-15

This release introduces a new rule that can check the arguments of methods that expects a model property name, and can warn you if the passed argument is not actually a property of the model. You can read the details about the rule [here](https://github.com/nunomaduro/larastan/blob/master/docs/rules.md#modelpropertyrule).

**NOTE**: This rule is currently in beta! If you want to improve it's analysis, you can check out the issue [here](https://github.com/nunomaduro/larastan/issues/676) and contribute!


### Added
- Add a new `view-string` PHPDoc type ([#654](https://github.com/nunomaduro/larastan/pull/654))
- Stubs for Eloquent builder `value` and `orWhere` methods
Expand All @@ -17,6 +24,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Changed
- Made improvements to database migrations scanning. ([#670](https://github.com/nunomaduro/larastan/pull/670))
- Improved running test suite commands and Windows compatibility ([#682](https://github.com/nunomaduro/larastan/pull/682))

## [0.6.4] - 2020-09-02

Expand Down Expand Up @@ -412,7 +420,8 @@ Upgrade guide: [UPGRADE.md](https://github.com/nunomaduro/larastan/blob/master/U
### Added
- Adds first alpha version

[Unreleased]: https://github.com/nunomaduro/larastan/compare/v0.6.4...HEAD
[Unreleased]: https://github.com/nunomaduro/larastan/compare/v0.6.5...HEAD
[0.6.5]: https://github.com/nunomaduro/larastan/compare/v0.6.4...v0.6.5
[0.6.4]: https://github.com/nunomaduro/larastan/compare/v0.6.3...v0.6.4
[0.6.3]: https://github.com/nunomaduro/larastan/compare/v0.6.2...v0.6.3
[0.6.2]: https://github.com/nunomaduro/larastan/compare/v0.6.1...v0.6.2
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ A list of configurable rules specific to Laravel can be found [here](docs/rules.

A list of PHPDoc types specific to Larastan can be found [here](docs/custom-types.md).

## Custom PHPStan config parameters
A list of custom config parameters that you can use in your PHPStan config file can be found [here](docs/custom-config-paramaters.md).

## Errors To Ignore

Some parts of Laravel are currently too magical for Larastan/PHPStan to understand.
Expand All @@ -88,7 +91,7 @@ We listed common [errors to ignore](docs/errors-to-ignore.md), add them as neede

Thank you for considering contributing to Larastan. All the contribution guidelines are mentioned [here](CONTRIBUTING.md).

You can have a look at the [CHANGELOG](CHANGELOG.md) for constant updates & detailed information about the changes. You can also follow the Twitter account for the latest announcements or just come say hi!: [@enunomaduro](https://twitter.com/enunomaduro).
You can have a look at the [CHANGELOG](CHANGELOG.md) for constant updates & detailed information about the changes. You can also follow the Twitter account for the latest announcements or just come say hi!: [@enunomaduro](https://twitter.com/enunomaduro), [@can__vural](https://twitter.com/can__vural).

## ❤️ Support The Development

Expand Down
31 changes: 31 additions & 0 deletions docs/custom-config-paramaters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Custom config parameters

All custom config parameters that are defined by Larastan are listed here.

## `noUnnecessaryCollectionCall`, `noUnnecessaryCollectionCallOnly`, `noUnnecessaryCollectionCallExcept`

These parameters are related to the `NoUnnecessaryCollectionCall` rule. You can find the details about these parameters and the rule [here](rules.md#NoUnnecessaryCollectionCall).

## `databaseMigrationsPath`

By default, the default Laravel database migration path (`database/migrations`) is used to scan migration files to understand the table structure and model properties. If you have database migrations in other place then the default, you can use this config parameter to tell Larastan where the database migrations are stored.

You can give an absolute path, or a path relative to the PHPStan config file.

#### Example
```neon
parameters:
databaseMigrationsPath: ../custom/migrations/path
```

## `checkModelProperties`
**default**: `false`

This config parameter enables the checks for model properties that are passed to methods. You can read the details [here](rules.md#modelpropertyrule).

To enable you can set it to `true`:

```neon
parameters:
checkModelProperties: true
```
6 changes: 6 additions & 0 deletions docs/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ parameters:

## ModelPropertyRule

---

**NOTE**: This rule is currently in beta! If you want to improve it's analysis you can check out the issue [here](https://github.com/nunomaduro/larastan/issues/676) and contribute!

---

This rule checks every argument of a method or a function, and if the argument has the type `model-property`, it will try to check the given value against the model properties. And if the model does not have the given property, it'll produce an error.

### Basic example
Expand Down

0 comments on commit 585f53d

Please sign in to comment.