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

plank / laravel-metable / 8731108978

18 Apr 2024 01:38AM UTC coverage: 92.361% (-6.4%) from 98.76%
8731108978

Pull #102

github

frasmage
added metable:refresh artisan command
Pull Request #102: V6

215 of 248 new or added lines in 18 files covered. (86.69%)

26 existing lines in 7 files now uncovered.

399 of 432 relevant lines covered (92.36%)

65.06 hits per line

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

85.71
/src/DataType/ScalarHandler.php
1
<?php
2

3
namespace Plank\Metable\DataType;
4

5
/**
6
 * Handle serialization of scalar values.
7
 */
8
abstract class ScalarHandler implements HandlerInterface
9
{
10
    /**
11
     * The name of the scalar data type.
12
     *
13
     * @var string
14
     */
15
    protected $type;
16

17
    /**
18
     * {@inheritdoc}
19
     */
20
    public function getDataType(): string
21
    {
22
        return $this->type;
300✔
23
    }
24

25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function canHandleValue(mixed $value): bool
29
    {
30
        return gettype($value) == $this->type;
312✔
31
    }
32

33
    /**
34
     * {@inheritdoc}
35
     */
36
    public function serializeValue(mixed $value): string
37
    {
38
        settype($value, 'string');
294✔
39

40
        return $value;
294✔
41
    }
42

43
    /**
44
     * {@inheritdoc}
45
     */
46
    public function unserializeValue(string $serializedValue): mixed
47
    {
48
        settype($serializedValue, $this->type);
132✔
49

50
        return $serializedValue;
132✔
51
    }
52

53
    public function isIdempotent(): bool
54
    {
NEW
55
        return true;
×
56
    }
57
}
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

© 2025 Coveralls, Inc