for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Doctrine\ODM\MongoDB\Types;
use function max;
/**
* The Int type.
*/
class IntType extends Type implements Incrementable, Versionable
{
public function convertToDatabaseValue($value)
return $value !== null ? (int) $value : null;
}
public function convertToPHPValue($value)
public function closureToMongo() : string
return '$return = (int) $value;';
public function closureToPHP() : string
public function diff($old, $new)
return $new - $old;
public function getNextVersion($current)
return max(1, (int) $current + 1);