From f24f361a95170d97bf9766d6f883110c041d63cb Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Tue, 22 Jun 2021 21:20:10 +0300 Subject: [PATCH] Add documentation and schema entry for inferPropertyTypesFromConstructor Fixes vimeo/psalm#5974 --- config.xsd | 1 + docs/running_psalm/configuration.md | 9 +++++++++ tests/Config/ConfigTest.php | 9 +++++++++ 3 files changed, 19 insertions(+) diff --git a/config.xsd b/config.xsd index b8c55a9fa..ddc88d4f6 100644 --- a/config.xsd +++ b/config.xsd @@ -59,6 +59,7 @@ + diff --git a/docs/running_psalm/configuration.md b/docs/running_psalm/configuration.md index 1150e08ce..7cd85f6fb 100644 --- a/docs/running_psalm/configuration.md +++ b/docs/running_psalm/configuration.md @@ -213,6 +213,15 @@ When `true`, Psalm ignores possibly-false issues stemming from return values of ``` When `true`, Psalm ignores possibly-null issues stemming from return values of internal array functions (like `current`) that may return null, but do so rarely. Defaults to `true`. +#### inferPropertyTypesFromConstructor + +```xml + +``` +When `true`, Psalm infers property types from assignments seen in straightforward constructors. Defaults to `true`. + #### findUnusedVariablesAndParams ```xml assertContains('datetime', $this->project_analyzer->getConfig()->getUniversalObjectCrates()); } + public function testInferPropertyTypesFromConstructorIsRead(): void + { + $cfg = Config::loadFromXML( + dirname(__DIR__, 2), + '' + ); + $this->assertFalse($cfg->infer_property_types_from_constructor); + } + /** * @return array */