<?php
declare(strict_types=1);
trait PropertiesTrait
{
private string $property;
}
class Properties
{
use PropertiesTrait;
public function __construct(string $property)
{
$this->property = $property;
}
}
Expected behaviour
No warning as the class doesn't define the property, only sets its value.
Environment details
PhpStorm 2022.1.2
Build #PS-221.5787.33, built on June 1, 2022
Licensed to Petri Haikonen
You have a perpetual fallback license for this version.
Subscription is active until April 19, 2023.
Runtime version: 11.0.15+10-b2043.56 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.4.0-113-generic
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Registry:
run.processes.with.pty=TRUE
Non-Bundled Plugins:
some.awesome (1.14)
net.sjrx.intellij.plugins.systemdunitfiles (0.3.7)
Key Promoter X (2022.2)
zielu.gittoolbox (212.9.0)
mobi.hsz.idea.gitignore (4.4.0)
com.kalessil.phpStorm.phpInspectionsEA (4.0.7.1)
de.espend.idea.php.toolbox (6.1.0)
de.espend.idea.php.annotation (8.2.1)
ru.adelf.idea.dotenv (2022.1)
Current Desktop: ubuntu:GNOME
Current behaviour
Example code:
Expected behaviour
No warning as the class doesn't define the property, only sets its value.
Environment details