for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace OCA\FaceRecognition\Migration;
use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\IDBConnection;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
/**
* Auto-generated migration step: Please modify to your needs!
*/
class Version000604Date20200908224225 extends SimpleMigrationStep {
/** @var IDBConnection */
protected $connection;
public function __construct(IDBConnection $connection) {
$this->connection = $connection;
}
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* @param array $options
* @return null|ISchemaWrapper
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
$personsTable = $schema->getTable('facerecog_persons');
$personsTable->changeColumn('name', [
'notnull' => false,
'default' => null,
]);
return $schema;
*
* @return void
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) {
$query = $this->connection->getQueryBuilder();
$query->update('facerecog_persons')
->set('name', $query->createNamedParameter(null))
->where($query->expr()->iLike('name', $query->createNamedParameter('New person %')));
$query->execute();
OCP\DB\QueryBuilder\IQueryBuilder::execute()
If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated annotation
ignore-deprecated
/** @scrutinizer ignore-deprecated */ $query->execute();
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.