• 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

92.31
/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';
282✔
13
    }
14

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

20
    public function serializeValue(mixed $value): string
21
    {
22
        return app('encrypter')->encrypt($value, true);
24✔
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;
24✔
33
    }
34

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

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

48
    public function isIdempotent(): bool
49
    {
NEW
50
        return false;
×
51
    }
52
}
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