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

PHP-Alchemist / coreFiles / 15423302022

03 Jun 2025 04:58PM UTC coverage: 92.411%. First build
15423302022

Pull #9

github

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

144 of 175 new or added lines in 16 files covered. (82.29%)

548 of 593 relevant lines covered (92.41%)

4.95 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