Whether a child's effective type equals its native type, meaning no docblock override was applied. Returns `true` when the child wrote no `@return` / `@var` / `@param` tag (so the effective type is just the native hint). Returns `false` when the child provided its own docblock type — in that case the child's type is an intentional override and should not be replaced.
(effective: &Option<PhpType>, native: &Option<PhpType>)
| 103 | /// when the child provided its own docblock type — in that case the |
| 104 | /// child's type is an intentional override and should not be replaced. |
| 105 | fn lacks_docblock_override(effective: &Option<PhpType>, native: &Option<PhpType>) -> bool { |
| 106 | match (effective, native) { |
| 107 | // No effective type at all — nothing to override. |
| 108 | (None, _) => true, |
| 109 | // Effective type present but no native type — the child wrote |
| 110 | // a docblock-only type (e.g. `@return list<Pen>` with no native |
| 111 | // hint). That is an intentional override. |
| 112 | (Some(_), None) => false, |
| 113 | // Both present — if they are equivalent, the child didn't write |
| 114 | // a docblock (the effective type is just the native hint echoed). |
| 115 | (Some(eff), Some(nat)) => eff.equivalent(nat), |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | /// Whether an ancestor's type is richer than the child's native type. |
| 120 | /// |
no test coverage detected