for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/**
* neuralyzer : Data Anonymization Library and CLI Tool
*
* PHP Version 7.2
* @author Emmanuel Dyan
* @copyright 2020 Emmanuel Dyan
* @package edyan/neuralyzer
* @license GNU General Public License v2.0
* @link https://github.com/edyan/neuralyzer
*/
namespace Edyan\Neuralyzer\Helper\DB;
* Various methods related to PostgreSQL
class PostgreSQL extends AbstractDBHelper
{
* Set the right enclosure
public function getEnclosureForCSV(): string
return chr(0);
}
* {@inheritdoc}
public function loadData(string $table, string $fname, array $fields, string $mode): string
$fields = implode(', ', $fields);
if ($this->pretend === false) {
if ($mode === 'update') {
$this->conn->query("TRUNCATE {$table}");
Doctrine\DBAL\Connection::query()
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 */ $this->conn->query("TRUNCATE {$table}");
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.
$pdo = $this->conn->getWrappedConnection();
$pdo->pgsqlCopyFromFile($table, $fname, '|', '\\\\N', $fields);
$sql = "COPY {$table} (${fields}) FROM '{$fname}' ";
$sql .= '... Managed by pgsqlCopyFromFile';
return $sql;
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.