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

plank / laravel-metable / 8730412986

18 Apr 2024 12:20AM UTC coverage: 90.887% (-7.9%) from 98.76%
8730412986

Pull #102

github

web-flow
Merge pull request #101 from anilkumarthakur60/v6

V6 migration and ci fixes
Pull Request #102: V6

185 of 222 new or added lines in 16 files covered. (83.33%)

26 existing lines in 7 files now uncovered.

369 of 406 relevant lines covered (90.89%)

64.39 hits per line

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

53.85
/src/DataType/SerializeHandler.php
1
<?php
2

3
namespace Plank\Metable\DataType;
4

5
/**
6
 * Securely handle any type of value using php serialize with encryption.
7
 */
8
class SerializeHandler implements HandlerInterface
9
{
10
    public function getDataType(): string
11
    {
12
        return 'serialized';
276✔
13
    }
14

15
    public function canHandleValue(mixed $value): bool
16
    {
17
        return !is_resource($value);
18✔
18
    }
19

20
    public function serializeValue(mixed $value): string
21
    {
22
        return app('encrypter')->encrypt($value, true);
18✔
23
    }
24

25
    public function unserializeValue(string $serializedValue): mixed
26
    {
27
        return app('encrypter')->decrypt($serializedValue, true);
18✔
28
    }
29

30
    public function getNumericValue(mixed $value): null|int|float
31
    {
32
        return null;
18✔
33
    }
34

35
    public function getStringValue(mixed $value): null|string
36
    {
37
        if (!config('metable.indexComplexDataTypes', false)) {
18✔
38
            return null;
18✔
39
        }
40

NEW
41
        return substr(
×
NEW
42
            serialize($value),
×
NEW
43
            0,
×
NEW
44
            config('metable.stringValueIndexLength', 255)
×
NEW
45
        );
×
46
    }
47

48
    public function isIdempotent(): bool
49
    {
NEW
50
        return false;
×
51
    }
52

53
}
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