for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace yentu\database;
use yentu\exceptions\SyntaxErrorException;
class PrimaryKey extends BasicKey
{
#[\Override]
protected function addKey($constraint)
$this->getChangeLogger()->addPrimaryKey($constraint);
addPrimaryKey()
yentu\ChangeLogger
__call
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
$this->getChangeLogger()->/** @scrutinizer ignore-call */ addPrimaryKey($constraint);
}
protected function doesKeyExist($constraint)
return $this->getChangeLogger()->doesPrimaryKeyExist($constraint);
doesPrimaryKeyExist()
return $this->getChangeLogger()->/** @scrutinizer ignore-call */ doesPrimaryKeyExist($constraint);
protected function dropKey($constraint)
$this->getChangeLogger()->dropPrimaryKey($constraint);
dropPrimaryKey()
$this->getChangeLogger()->/** @scrutinizer ignore-call */ dropPrimaryKey($constraint);
protected function getNamePostfix()
return 'pk';
public function autoIncrement()
if (count($this->columns) > 1) {
throw new SyntaxErrorException("Cannot make an auto incrementing composite key.", $this->home);
$this->getChangeLogger()->addAutoPrimaryKey(
addAutoPrimaryKey()
$this->getChangeLogger()->/** @scrutinizer ignore-call */ addAutoPrimaryKey(
\yentu\Parameters::wrap(array(
'table' => $this->table->getName(),
'schema' => $this->table->getSchema()->getName(),
'column' => $this->columns[0]
)
);
return $this;