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

valksor / php-doctrine-tools / 21323315897

28 Dec 2025 12:41AM UTC coverage: 6.965% (-16.9%) from 23.881%
21323315897

push

github

k0d3r1s
funding coffee

14 of 201 relevant lines covered (6.97%)

0.15 hits per line

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

0.0
/Doctrine/DBAL/Traits/_ConvertToDatabaseValue.php
1
<?php declare(strict_types = 1);
2

3
/*
4
 * This file is part of the Valksor package.
5
 *
6
 * (c) Davis Zalitis (k0d3r1s)
7
 * (c) SIA Valksor <packages@valksor.com>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12

13
namespace Valksor\Component\DoctrineTools\Doctrine\DBAL\Traits;
14

15
use DateTimeInterface;
16
use Doctrine\DBAL\Platforms\AbstractPlatform;
17
use Doctrine\DBAL\Types\Exception\InvalidType;
18
use Valksor\Component\DoctrineTools\UTCDateTimeImmutable;
19

20
trait _ConvertToDatabaseValue
21
{
22
    /**
23
     * @throws InvalidType
24
     */
25
    public function convertToDatabaseValue(
26
        $value,
27
        AbstractPlatform $platform,
28
    ): ?string {
29
        if ($value instanceof DateTimeInterface) {
×
30
            $value = $value->setTimezone(timezone: UTCDateTimeImmutable::getUTCTimeZone());
×
31
        }
32

33
        return parent::convertToDatabaseValue(value: $value, platform: $platform);
×
34
    }
35
}
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