Skip to content

Conversation

@dereuromark
Copy link
Contributor

Summary

  • Fixes generated method and constant names for underscore-prefixed fields like _joinData and _matchingData
  • Adds stripLeadingUnderscore filter to generate proper camelCase names
  • Adds documentation for CakePHP special fields

Before

// Field: _matchingData
$dto->get_matchingData();
$dto->with_matchingData($data);
UserDto::FIELD__MATCHING_DATA;  // double underscore

After

// Field: _matchingData
$dto->getMatchingData();
$dto->withMatchingData($data);
UserDto::FIELD_MATCHING_DATA;  // single underscore

This is needed for CakePHP's projectAs() feature which uses _joinData (BelongsToMany pivot data) and _matchingData (matching query results).

Related to #51 which added support for underscore-prefixed field names.

- Add stripLeadingUnderscore filter to generate proper camelCase names
- Update all method templates to use the filter
- Update constants template to avoid double underscores
- Add documentation for CakePHP _joinData and _matchingData fields

Before: get_matchingData(), FIELD__MATCHING_DATA
After:  getMatchingData(), FIELD_MATCHING_DATA
@codecov
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.69%. Comparing base (416d131) to head (0b05f6d).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master      #54      +/-   ##
============================================
+ Coverage     83.66%   83.69%   +0.02%     
- Complexity     1185     1187       +2     
============================================
  Files            34       34              
  Lines          2908     2913       +5     
============================================
+ Hits           2433     2438       +5     
  Misses          475      475              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dereuromark dereuromark merged commit f8237a5 into master Jan 21, 2026
12 checks passed
@dereuromark dereuromark deleted the fix-constant-double-underscore branch January 21, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants