for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/**
* Audioplayer
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the LICENSE.md file.
* @author Marcel Scherello <[email protected]>
* @author Arthur Schiwon <[email protected]>
* @author Christoph Wurst <[email protected]>
* @copyright 2020 Marcel Scherello
*/
namespace OCA\audioplayer\WhatsNew;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Db\QBMapper;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
use Psr\Log\LoggerInterface;
class WhatsNewMapper extends QBMapper
{
public const TABLE_NAME = 'audioplayer_whats_new';
private $logger;
public function __construct(
LoggerInterface $logger,
IDBConnection $db
)
parent::__construct($db, self::TABLE_NAME);
$this->logger = $logger;
}
* @throws DoesNotExistException
public function getChanges(string $version): WhatsNewResult
/* @var $qb IQueryBuilder */
$qb = $this->db->getQueryBuilder();
$result = $qb->select('*')
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
$result = /** @scrutinizer ignore-deprecated */ $qb->select('*')
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.
->from(self::TABLE_NAME)
->where($qb->expr()->eq('version', $qb->createNamedParameter($version)))
->execute();
$data = $result->fetch();
$result->closeCursor();
if ($data === false) {
throw new DoesNotExistException('Changes info is not present');
return WhatsNewResult::fromRow($data);
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.