Skip to content

Conversation

@batyrmastyr
Copy link
Contributor

Q A
Is bugfix? ✔️
New feature?
Breaks BC?

Treat uninitialized property as null to align with ArrayDataSet and inexisting properties handling.

$parser = new ObjectParser(new class () {
    public int $a = 4;
    public int $uninitialized;
});

$this->assertNull($parser->getPropertyValue('not-existing')); // null 
$this->assertSame(4, $parser->getPropertyValue('a'));   // 4
$this->assertNull($parser->getPropertyValue('uninitialized')); // exception in main branch

@codecov
Copy link

codecov bot commented Sep 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.20%. Comparing base (fe63447) to head (3ada8cd).
⚠️ Report is 90 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #783      +/-   ##
============================================
+ Coverage     94.40%   96.20%   +1.80%     
- Complexity      953     1044      +91     
============================================
  Files           108      122      +14     
  Lines          3018     3292     +274     
============================================
+ Hits           2849     3167     +318     
+ Misses          169      125      -44     

☔ 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.

@batyrmastyr batyrmastyr changed the title Treat uninitialized property as null Treat uninitialized property as not existing Sep 15, 2025
batyrmastyr and others added 3 commits September 17, 2025 18:03
Co-authored-by: Sergei Predvoditelev <sergey.predvoditelev@gmail.com>
Co-authored-by: Sergei Predvoditelev <sergey.predvoditelev@gmail.com>
@vjik vjik merged commit 9e3230c into yiisoft:master Sep 21, 2025
31 of 32 checks passed
@vjik
Copy link
Member

vjik commented Sep 21, 2025

Thank you, @batyrmastyr !

@batyrmastyr batyrmastyr deleted the typed_property branch September 21, 2025 12:15
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.

3 participants