• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PHP-Alchemist / coreFiles / 15423086982

03 Jun 2025 04:47PM UTC coverage: 92.512%. First build
15423086982

Pull #9

github

druid628
CS Fixes
Pull Request #9: [Release] v3.0.0

136 of 167 new or added lines in 16 files covered. (81.44%)

556 of 601 relevant lines covered (92.51%)

4.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.89
/src/Trait/JsonHydratorTrait.php
1
<?php
2

3
namespace PHPAlchemist\Trait;
4

5
trait JsonHydratorTrait
6
{
7
    public function hydrateFromJson(string $json)
2✔
8
    {
9
        $jsonDecodedData = json_decode($json, true);
2✔
10
        foreach ($jsonDecodedData as $key => $value) {
2✔
11
            if (!property_exists($this, $key)) {
2✔
NEW
12
                continue;
×
13
            }
14

15
            if (is_callable([$this, 'set'.ucfirst($key)])) {
2✔
16
                $this->{'set'.ucfirst($key)}($value);
2✔
17
            } elseif (property_exists($this, $key)) {
2✔
18
                $this->{$key} = $value;
2✔
19
            }
20
        }
21
    }
22
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc