Skip to content

Commit

Permalink
BUGFIX: Repair flow contentgraphintegrity:runviolationdetection
Browse files Browse the repository at this point in the history
Too few arguments to function ContentGraphIntegrityCommandController 0 passed
  • Loading branch information
mhsdesign committed May 11, 2024
1 parent 8916eab commit 866c9e4
Showing 1 changed file with 15 additions and 9 deletions.
Expand Up @@ -11,29 +11,35 @@
* source code.
*/

use Neos\ContentRepository\Core\Projection\ContentGraph\ProjectionIntegrityViolationDetectionRunner;
use Neos\ContentGraph\DoctrineDbalAdapter\DoctrineDbalProjectionIntegrityViolationDetectionRunnerFactory;
use Neos\ContentRepository\Core\Infrastructure\DbalClientInterface;
use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId;
use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry;
use Neos\Error\Messages\Result;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Cli\CommandController;

final class ContentGraphIntegrityCommandController extends CommandController
{
private const OUTPUT_MODE_CONSOLE = 'console';
private const OUTPUT_MODE_LOG = 'log';

private ProjectionIntegrityViolationDetectionRunner $detectionRunner;
#[Flow\Inject()]
protected DbalClientInterface $dbalClient;

#[Flow\Inject()]
protected ContentRepositoryRegistry $contentRepositoryRegistry;

public function __construct(ProjectionIntegrityViolationDetectionRunner $detectionRunner)
public function runViolationDetectionCommand(string $contentRepository = 'default', string $outputMode = null): void
{
$this->detectionRunner = $detectionRunner;
parent::__construct();
}
$detectionRunner = $this->contentRepositoryRegistry->buildService(
ContentRepositoryId::fromString($contentRepository),
new DoctrineDbalProjectionIntegrityViolationDetectionRunnerFactory($this->dbalClient)
);

public function runViolationDetectionCommand(string $outputMode = null): void
{
$outputMode = $this->resolveOutputMode($outputMode);
/** @var Result $result */
$result = $this->detectionRunner->run();
$result = $detectionRunner->run();
switch ($outputMode) {
case self::OUTPUT_MODE_CONSOLE:
foreach ($result->getErrors() as $error) {
Expand Down

0 comments on commit 866c9e4

Please sign in to comment.