success example

// general document errors have a '-1' line number                     $line = -1 === $error['line'] ? null : $error['line'];

                    $githubReporter?->error($error['message']$info['file']$line, null !== $line ? $error['column'] : null);

                    return null === $line ? $error['message'] : sprintf('Line %d, Column %d: %s', $line$error['column']$error['message']);
                }$info['messages']));
            }
        }

        if (0 === $erroredFiles) {
            $io->success(sprintf('All %d XLIFF files contain valid syntax.', $countFiles));
        } else {
            $io->warning(sprintf('%d XLIFF files have valid syntax and %d contain errors.', $countFiles - $erroredFiles$erroredFiles));
        }

        return min($erroredFiles, 1);
    }

    private function displayJson(SymfonyStyle $io, array $filesInfo): int
    {
        $errors = 0;

        
$msg->setMediaIds($result->getEntities()->getIds());

            if (Feature::isActive('v6.6.0.0')) {
                $msg->setContext($context);
            } else {
                $msg->withContext($context);
            }

            $this->messageBus->dispatch($msg);
            ++$batchCount;
        }
        $this->io->success(sprintf('Generated %d Batch jobs!', $batchCount));
    }
}

    }

    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $io = new SymfonyStyle($input$output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output);

        $cacheItem = $this->restartSignalCachePool->getItem(StopWorkerOnRestartSignalListener::RESTART_REQUESTED_TIMESTAMP_KEY);
        $cacheItem->set(microtime(true));
        $this->restartSignalCachePool->save($cacheItem);

        $io->success('Signal successfully sent to stop any running workers.');

        return 0;
    }
}

        if ($input->getOption('clearCache')) {
            $io->note('Clearing Cache');

            try {
                $this->cacheClearer->clear();
            } catch (\Exception) {
                $io->error('Error clearing cache');

                return;
            }
            $io->success('Cache cleared');

            return;
        }

        $io->note(
            sprintf(
                'You may want to clear the cache after %s plugin(s). To do so run the cache:clear command',
                $action
            )
        );
    }

    
return 0;
    }

    private function removeThumbnails(SymfonyStyle $io): void
    {
        $filesystem = $this->getContainer()->get(MediaServiceInterface::class)->getFilesystem();

        $thumbnailFiles = $this->searchThumbnails($io$filesystem);

        if (\count($thumbnailFiles) === 0) {
            $io->success('No orphaned thumbnails found.');

            return;
        }

        // verbose information         if ($io->getVerbosity() === SymfonyStyle::VERBOSITY_VERBOSE) {
            $io->caution('The following files will be deleted:');
            $io->listing($thumbnailFiles);
        }

        if (!$io->confirm(sprintf('Found %d orphaned thumbnails. Are you sure you want to delete the files? This step is irreversible.', \count($thumbnailFiles)))) {
            
if ($rows) {
            $io->table(['', 'Bundle', 'Method / Error']$rows);
        }

        if (0 !== $exitCode) {
            $io->error('Some errors occurred while installing assets.');
        } else {
            if ($copyUsed) {
                $io->note('Some assets were installed via copy. If you make changes to these assets you have to run this command again.');
            }
            $io->success($rows ? 'All assets were successfully installed.' : 'No assets were provided by any bundle.');
        }

        return $exitCode;
    }

    /** * Try to create relative symlink. * * Falling back to absolute symlink and finally hard copy. */
    private function relativeSymlinkWithFallback(string $originDir, string $targetDir): string
    {
$format = $input->getOption('format');

        if (!$descriptor = $this->descriptors[$format] ?? null) {
            throw new InvalidArgumentException(sprintf('Unsupported format "%s".', $format));
        }

        $errorIo = $io->getErrorStyle();
        $errorIo->title('Symfony Var Dumper Server');

        $this->server->start();

        $errorIo->success(sprintf('Server listening on %s', $this->server->getHost()));
        $errorIo->comment('Quit the server with CONTROL-C.');

        $this->server->listen(function DData $data, array $context, int $clientId) use ($descriptor$io) {
            $descriptor->describe($io$data$context$clientId);
        });

        return 0;
    }

    public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void
    {
        
$additionalData['firstName'] = $input->getOption('firstName');
        }
        if ($input->getOption('email')) {
            $additionalData['email'] = $input->getOption('email');
        }
        if ($input->getOption('admin')) {
            $additionalData['admin'] = true;
        }

        $this->userProvisioner->provision($username$password$additionalData);

        $io->success(sprintf('User "%s" successfully created.', $username));

        return self::SUCCESS;
    }
}
public function execute(array $commands, WriteContext $context): void
    {
        $beforeWriteEvent = EntityWriteEvent::create($context$commands);

        $this->eventDispatcher->dispatch($beforeWriteEvent);

        try {
            RetryableTransaction::retryable($this->connection, function D) use ($commands$context): void {
                $this->executeCommands($commands$context);
            });

            $beforeWriteEvent->success();
        } catch (\Throwable $e) {
            $event = new WriteCommandExceptionEvent($e$commands$context->getContext());
            $this->eventDispatcher->dispatch($event);

            $beforeWriteEvent->error();

            throw $e;
        }
    }

    /** * @param list<WriteCommand> $commands */
if ($shopwareId === null || $password === null) {
            throw new StoreInvalidCredentialsException();
        }

        try {
            $this->storeClient->loginWithShopwareId($shopwareId$password$userContext);
        } catch (ClientException $exception) {
            throw new StoreApiException($exception);
        }

        $io->success('Successfully logged in.');

        return (int) Command::SUCCESS;
    }
}
->setTitle($title)
            ->setIssue($issue)
            ->setFlag($flag)
            ->setAuthor($author)
            ->setAuthorEmail($authorEmail)
            ->setAuthorGitHub($authorGithub);

        $IOHelper->section('Generating: ');
        $target = $this->generator->generate($template$date$input->getOption('dry-run'));

        $IOHelper->newLine();
        $IOHelper->success('The changelog was generated successfully');
        $IOHelper->note($target);

        return self::SUCCESS;
    }

    /** * @return array{date: string, author: string, authorEmail: string, authorGithub: string} */
    private function getDefaultData(): array
    {
        $process = new Process(['git', 'config', 'user.name']);
        
return self::FAILURE;
        }

        $from = $input->getArgument('from');
        $to = $input->getArgument('to');

        $this->registry->migrate(
            $from,
            $to
        );

        $io->success(\sprintf('Successfully migrated number range increments from "%s" to "%s"', $from$to));

        return self::SUCCESS;
    }
}
$this->connection->executeStatement('TRUNCATE elasticsearch_index_task');

        try {
            $gateway = $this->gatewayRegistry->get(IncrementGatewayRegistry::MESSAGE_QUEUE_POOL);
            $gateway->reset('message_queue_stats', ElasticsearchIndexingMessage::class);
        } catch (IncrementGatewayNotFoundException) {
            // In case message_queue pool is disabled         }

        $this->connection->executeStatement('DELETE FROM `messenger_messages` WHERE `headers` LIKE "%ElasticsearchIndexingMessage%"');

        $io->success('Elasticsearch indices deleted and queue cleared');

        return self::SUCCESS;
    }
}
if (!file_exists($migrationDirectory) && !mkdir($migrationDirectory, 0777, true) && !is_dir($migrationDirectory)) {
            throw new RuntimeException(sprintf('Directory "%s" was not created', $migrationDirectory));
        }

        $nextVersion = $this->getLatestMigrationVersion($migrationDirectory) + 1;

        $fileName = $this->createMigration($migrationDirectory$migrationName$pluginName$nextVersion);

        $io = new SymfonyStyle($input$output);

        $io->success(sprintf('Generated file "%s/%s"', $migrationDirectory$fileName));

        return 0;
    }

    private function findMigrationDirectory(?string $pluginName): ?string
    {
        if ($pluginName === null) {
            $rootDir = $this->container->getParameter('kernel.root_dir');

            if (!\is_string($rootDir)) {
                throw new RuntimeException('Parameter kernel.root_dir has to be an string');
            }
$outputArray = $this->releaseExporter->export($this->getRequestedSection($input)$version$includeFeatureFlags$input->getOption('keys-only'));

        $path = $input->getOption('path') ?: '';
        if (\is_string($path) && $path !== '') {
            file_put_contents($pathimplode("\n", $outputArray));
            $IOHelper->writeln('* Pushed all changelogs into ' . $path);
        } else {
            $IOHelper->writeln($outputArray);
        }

        $IOHelper->newLine();
        $IOHelper->success('Done');

        return self::SUCCESS;
    }

    /** * @return array<string, bool> */
    private function getRequestedSection(InputInterface $input): array
    {
        $requested = [];
        foreach (ChangelogSection::cases() as $changelogSection) {
            
Home | Imprint | This part of the site doesn't use cookies.