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

DerManoMann / json-object-mapper / 3868897722

pending completion
3868897722

push

github

GitHub
Merge pull request #33 from DerManoMann/refresh

357 of 409 relevant lines covered (87.29%)

33.96 hits per line

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

85.71
/src/TypeReference/ScalarTypeReference.php
1
<?php declare(strict_types=1);
2

3
/*
4
* This file is part of the ObjectMapper library.
5
*
6
* (c) Martin Rademacher <mano@radebatz.net>
7
*
8
* For the full copyright and license information, please view the LICENSE
9
* file that was distributed with this source code.
10
*/
11

12
namespace Radebatz\ObjectMapper\TypeReference;
13

14
use Radebatz\ObjectMapper\TypeReferenceInterface;
15

16
/**
17
 * Scalar type reference.
18
 */
19
class ScalarTypeReference implements TypeReferenceInterface
20
{
21
    protected $scalarType;
22
    protected $nullable;
23

24
    public function __construct(string $scalarType, bool $nullable = true)
25
    {
26
        $this->scalarType = $scalarType;
56✔
27
        $this->nullable = $nullable;
56✔
28
    }
29

30
    /**
31
     * @inheritdoc
32
     */
33
    public function isCollection(): bool
34
    {
35
        return false;
55✔
36
    }
37

38
    /**
39
     * @inheritdoc
40
     */
41
    public function isNullable()
42
    {
43
        return $this->nullable;
29✔
44
    }
45

46
    /**
47
     * @inheritdoc
48
     */
49
    public function getType(): string
50
    {
51
        return $this->getScalarType();
3✔
52
    }
53

54
    public function getScalarType(): string
55
    {
56
        return $this->scalarType;
66✔
57
    }
58

59
    public function setScalarType(string $scalarType)
60
    {
61
        $this->scalarType = $scalarType;
×
62
    }
63
}
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