Type matching mismatch in child class with SINGLE TABLE INHERITANCE
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 32/100
Research direction
Start with the Doctrine single-table-inheritance guidance quoted in the issue and trace where PHPStan Doctrine reports a type matching mismatch for child-class fields. Determine the expected behavior for non-nullable entity fields backed by nullable database columns, then add coverage showing that the mismatch is handled correctly.
Written by the indexing model from the issue text.
Description
Hi!
In the case of SINGLE TABLE INHERITANCE the doctrine documentation states that:
For Single-Table-Inheritance to work in scenarios where you are using either a legacy database schema or a self-written database schema you have to make sure that all columns that are not in the root entity but in any of the different sub-entities has to allow null values. Columns that have NOT NULL constraints have to be on the root entity of the single-table inheritance hierarchy.
So I think that the analysis shouldn't report an "type matching mismatch" for fields in child class that are not nullable even if the database field can be NULL.
What is your opinion on that matter?
- Dominant language
- PHP
- Stars
- 678
- Forks
- 122
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 3
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from phpstan/phpstan-doctrine
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
phpstan/phpstan-doctrine#794 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
phpstan/phpstan-doctrine#785 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
phpstan/phpstan-doctrine#792 · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
phpstan/phpstan-doctrine#788 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
phpstan/phpstan-doctrine#763 ·
All issues in phpstan/phpstan-doctrine
Similar issues
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nextcloud/fulltextsearch#1011 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Automattic/static-site-importer#1767 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100