for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Doctrine\DBAL\Driver;
/**
* Last insert ID container.
*/
final class LastInsertId
{
/** @var int */
private $value = 0;
public function get() : int
return $this->value;
}
public function register(int $value) : void
// The last insert ID is reset to 0 in certain situations by some implementations,
// therefore we keep the previously set insert ID locally.
if ($value === 0) {
return;
$this->value = $value;