for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Shared Kernel library.
*
* Copyright (c) 2016-present LIN3S <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace LIN3S\SharedKernel\Infrastructure\Persistence\Doctrine\DBAL\Domain\Model\Phone\Types;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\TextType;
use LIN3S\SharedKernel\Domain\Model\Phone\Phone;
/**
* @author Beñat Espiña <[email protected]>
class PhoneType extends TextType
{
public function convertToDatabaseValue($value, AbstractPlatform $platform) : ?string
if ($value instanceof Phone) {
return $value->phone();
}
return $value;
public function convertToPHPValue($value, AbstractPlatform $platform) : ?Phone
if (null === $value) {
return;
return Phone::fromInternatinal($value);
fromInternatinal()
LIN3S\SharedKernel\Domain\Model\Phone\Phone
fromInternational()
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.
public function requiresSQLCommentHint(AbstractPlatform $platform) : bool
return true;
public function getName() : string
return 'phone';
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.