for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace App\Blog;
use Cycle\ORM\ORMInterface;
use Cycle\ORM\Select;
use Cycle\ORM\Transaction;
use Yiisoft\Yii\Cycle\Data\Reader\EntityReader;
final class PostRepository extends Select\Repository
{
private ORMInterface $orm;
public function __construct(Select $select, ORMInterface $orm)
$this->orm = $orm;
parent::__construct($select);
}
public function findAll(array $scope = [], array $orderBy = []): EntityReader
return new EntityReader(
$this
->select()
->where($scope)
->orderBy($orderBy)
);
public function save(Post $user): void
$transaction = new Transaction($this->orm);
Cycle\ORM\Transaction
If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated annotation
ignore-deprecated
$transaction = /** @scrutinizer ignore-deprecated */ new Transaction($this->orm);
$transaction->persist($user);
$transaction->run();