Skip to content

Commit d8f5c52

Browse files
committed
Merge 5.x and resolve conflict from #8186
Remove phpunit10.md in favor of renamed phpunit-upgrade.md which incorporates the useful content from #8186.
2 parents 1fc139b + 66989ae commit d8f5c52

File tree

4 files changed

+518
-0
lines changed

4 files changed

+518
-0
lines changed

_ANALYSIS_SUMMARY.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Analysis Summary: Remaining Method Signatures Without Return Types
2+
3+
## Overview
4+
5+
After PR #8173 (scalar return types) and PR #8174 (object return types) merge into the `5.x` branch, **96 method signatures** will still be missing return types in the CakePHP documentation.
6+
7+
## Baseline Numbers
8+
9+
- **Total signatures on 5.x branch**: 395
10+
- **Signatures without return types**: 391
11+
- **Signatures with return types**: 4
12+
13+
## PRs Impact
14+
15+
- **PR #8173 (scalar types)**: Added return types to 272 signatures
16+
- Includes: `void`, `bool`, `int`, `string`, `array`, `mixed`, `static`, etc.
17+
18+
- **PR #8174 (object types)**: Added return types to 24 signatures
19+
- Includes: `Response`, `Component`, `SelectQuery`, `EntityInterface`, etc.
20+
21+
## Remaining: 96 Signatures
22+
23+
### Breakdown by Category
24+
25+
| Category | Count | Priority | Description |
26+
|----------|-------|----------|-------------|
27+
| **Has return type in source (easy wins!)** | **40** | **HIGH** | Already have return types in PHP source—just need to add to docs |
28+
| No return type in source | 13 | Medium | Need to investigate and determine appropriate type |
29+
| Fluent methods | 9 | Medium | Return `$this` or `static` but lack type declaration in source |
30+
| Not found / inherited | 33 | Low | May be inherited from third-party libs, deprecated, or in traits |
31+
| Callback classes | 1 | Low | Documentation convention only |
32+
33+
### Category Highlights
34+
35+
#### Category 3: Easy Wins (40 signatures) ⭐
36+
37+
These are **low-hanging fruit**—they already have return types in the PHP source:
38+
39+
- **30 Collection methods**: All return `CollectionInterface`
40+
- `append()`, `map()`, `filter()`, `chunk()`, etc.
41+
42+
- **10 other methods**:
43+
- `Log::log()``bool`
44+
- Session methods → `void`, `bool`, `mixed`
45+
- `Debugger::getType()``string`
46+
- `Hash::insert()``ArrayAccess|array`
47+
48+
#### Category 1: Fluent Methods (9 signatures)
49+
50+
Methods that return `$this`/`static` for chaining but lack return type:
51+
- `Controller::addViewClasses()`
52+
- `CorsBuilder` methods (5 methods)
53+
- `Table::addBehavior()`
54+
- `FormHelper::unlockField()`
55+
- `RouteBuilder::setRouteClass()`
56+
57+
#### Category 2: No Return Type in Source (13 signatures)
58+
59+
Need to check source to determine return type:
60+
- `Collection::each()`
61+
- `ConsoleOptionParser` methods (7 methods)
62+
- `RouteBuilder` methods (3 methods)
63+
- Others (2 methods)
64+
65+
#### Category 5: Not Found/Inherited (33 signatures)
66+
67+
Require investigation:
68+
- **DateTime methods** (7): Likely inherited from Chronos library
69+
- **Helper methods** (5): May be in traits
70+
- **Entity methods** (4): Check for traits
71+
- **Others** (17): Various classes, may be deprecated
72+
73+
## Recommended Next Steps
74+
75+
1. **Quick win**: Add the 40 signatures from Category 3 (already have return types)
76+
2. Add return types to 9 fluent methods in PHP source, then update docs
77+
3. Investigate and add return types to 13 methods without declared types
78+
4. Research 33 'not found' methods—determine if inherited/deprecated/in traits
79+
80+
## Files Generated
81+
82+
- `/media/mark/data/work/git/docs/_remaining_signatures_analysis.md` - Detailed analysis with code examples
83+
- `/media/mark/data/work/git/docs/_remaining_signatures_by_category.txt` - Simple list by category
84+
- `/media/mark/data/work/git/docs/_ANALYSIS_SUMMARY.md` - This file
85+
86+
## Verification
87+
88+
```
89+
Original without types: 391
90+
Scalar PR additions: 272
91+
Object PR additions: 24
92+
----
93+
Remaining: 95-96 ✓
94+
```
95+
96+
The small discrepancy (95 vs 96) is likely due to signature variations or duplicates in the parsing.

_quick_reference.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Quick Reference: 96 Remaining Signatures by Priority
2+
3+
## HIGH PRIORITY: Category 3 - Easy Wins (40 signatures)
4+
5+
These already have return types in PHP source. Just add to docs!
6+
7+
### Collection Methods (30) - All return `CollectionInterface`
8+
```
9+
append, appendItem, buffered, chunk, chunkWithKeys, combine, compile, countBy,
10+
extract, filter, groupBy, indexBy, insert, listNested, map, match, nest,
11+
prepend, prependItem, reject, sample, shuffle, skip, sortBy, stopWhen, take,
12+
through, transpose, unfold, zip
13+
```
14+
15+
### Other Methods (10)
16+
| Method | Return Type |
17+
|--------|-------------|
18+
| `Log::log()` | `bool` |
19+
| `Session::check()` | `bool` |
20+
| `Session::delete()` | `void` |
21+
| `Session::destroy()` | `void` |
22+
| `Session::read()` | `mixed` |
23+
| `Session::readOrFail()` | `mixed` |
24+
| `Session::renew()` | `void` |
25+
| `Session::write()` | `void` |
26+
| `Debugger::getType()` | `string` |
27+
| `Hash::insert()` | `ArrayAccess\|array` |
28+
29+
---
30+
31+
## MEDIUM PRIORITY: Categories 1 & 2 (22 signatures)
32+
33+
### Category 1: Fluent Methods (9) - Need `static`/`self` return type
34+
35+
```
36+
Controller::addViewClasses()
37+
CorsBuilder::allowCredentials()
38+
CorsBuilder::allowHeaders()
39+
CorsBuilder::allowMethods()
40+
CorsBuilder::exposeHeaders()
41+
CorsBuilder::maxAge()
42+
Table::addBehavior()
43+
FormHelper::unlockField()
44+
RouteBuilder::setRouteClass()
45+
```
46+
47+
### Category 2: No Return Type in Source (13) - Need investigation
48+
49+
**Collection:**
50+
- `each()`
51+
52+
**ConsoleOptionParser (7):**
53+
- `addArgument()`, `addArguments()`, `addOption()`, `addOptions()`
54+
- `merge()`, `setDescription()`, `setEpilog()`
55+
56+
**CorsBuilder:**
57+
- `allowOrigin()`
58+
59+
**RouteBuilder (3):**
60+
- `fallbacks()`, `plugin()`, `prefix()`
61+
62+
**View:**
63+
- `set()`
64+
65+
---
66+
67+
## LOW PRIORITY: Categories 4 & 5 (34 signatures)
68+
69+
### Category 4: Callback Classes (1)
70+
- `Class::responseHeader()` - Documentation convention only
71+
72+
### Category 5: Not Found/Inherited (33)
73+
74+
These need research to determine if they're inherited, deprecated, or in traits:
75+
76+
- **DateTime methods (7)**: Likely from Chronos library
77+
- **Helper methods (5)**: Check traits (FormHelper, HtmlHelper, PaginatorHelper)
78+
- **Entity methods (4)**: Check EntityTrait
79+
- **Controller methods (3)**: Check traits (fetchTable, fetchModel, set)
80+
- **Others (14)**: Various classes
81+
82+
---
83+
84+
## Action Plan
85+
86+
### Phase 1: Quick Wins (Est. 1-2 hours)
87+
✓ Add 40 signatures that already have return types in source
88+
89+
### Phase 2: Fluent Methods (Est. 2-3 hours)
90+
✓ Add return types to 9 fluent methods in PHP source
91+
✓ Update documentation
92+
93+
### Phase 3: Investigation (Est. 3-4 hours)
94+
✓ Investigate 13 methods without return types
95+
✓ Determine and add appropriate types
96+
97+
### Phase 4: Research (Est. 4-6 hours)
98+
✓ Research 33 'not found' methods
99+
✓ Determine if inherited/deprecated/in traits
100+
✓ Update or remove from documentation
101+
102+
**Total estimated effort: 10-15 hours**

0 commit comments

Comments
 (0)