Your project should use return types 10
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.missing_return_typehint
- /**
- * Insert inline.
- * e.g.: ++text++ -> <ins>text</ins>.
- */
- protected function inlineInsert($Excerpt)
- {
- if (!isset($Excerpt['text'][1])) {
- return;
- }
- }
- /**
- * {@inheritdoc}
- */
- protected function inlineLink($Excerpt)
- {
- $link = parent::inlineLink($Excerpt); // @phpstan-ignore staticMethod.notFound
- if (!isset($link)) {
- return null;
- }
- /**
- * {@inheritdoc}
- */
- protected function inlineImage($Excerpt)
- {
- $InlineImage = parent::inlineImage($Excerpt); // @phpstan-ignore staticMethod.notFound
- if (!isset($InlineImage)) {
- return null;
- }
- }
- /**
- * Image block.
- */
- protected function blockImage($Excerpt)
- {
- if (1 !== preg_match($this->regexImage, $Excerpt['text'])) {
- return;
- }
- * **Tip:** This is an advice.
- * :::
- *
- * Code inspired by https://github.com/sixlive/parsedown-alert from TJ Miller (@sixlive).
- */
- protected function blockNote($block)
- {
- if (preg_match('/:::(.*)/', $block['text'], $matches)) {
- $block = [
- 'char' => ':',
- 'element' => [
- return $block;
- }
- }
- protected function blockNoteContinue($line, $block)
- {
- if (isset($block['complete'])) {
- return;
- }
- if (preg_match('/:::/', $line['text'])) {
- $block['element']['text'] .= $line['text'] . "\n";
- return $block;
- }
- protected function blockNoteComplete($block)
- {
- $block['element']['rawHtml'] = $this->text($block['element']['text']);
- unset($block['element']['text']);
- return $block;
- }
- /**
- * Apply Highlight to code blocks.
- */
- protected function blockFencedCodeComplete($block)
- {
- if (!(bool) $this->config->get('pages.body.highlight.enabled')) {
- return $block;
- }
- if (!isset($block['element']['text']['attributes'])) {
- }
- /**
- * {@inheritdoc}
- */
- protected function parseAttributeData($attributeString)
- {
- $attributes = preg_split('/[ ]+/', $attributeString, -1, PREG_SPLIT_NO_EMPTY);
- $Data = [];
- $HtmlAtt = [];
- }
- /**
- * Adds global variables.
- */
- protected function addGlobals()
- {
- $this->builder->getRenderer()->addGlobal('cecil', [
- 'url' => \sprintf('https://cecil.app/#%s', Builder::getVersion()),
- 'version' => Builder::getVersion(),
- 'poweredby' => \sprintf('Cecil v%s', Builder::getVersion()),
Your project uses discouraged functions to kill scripts
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.use_exit_function
- if ($this->io === null) {
- $this->io = new SymfonyStyle($input, $output);
- }
- $this->io->error($e->getMessage());
- exit(1);
- }
- }
- /**
- * Returns the working path.
Your project uses the sleep function, which could introduce timeouts
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.use_php_sleep_function
- if ($open) {
- $output->writeln('Opening web browser...');
- Util\Plateform::openBrowser(\sprintf('http://%s:%s', $host, $port));
- }
- while ($process->isRunning()) {
- sleep(1); // wait for server is ready
- if (!fsockopen($host, (int) $port)) {
- $output->writeln('<info>Server is not ready.</info>');
- return 1;
- }
Your project templates should not be too long
- Read doc
- Productivity
- Minor
More information: https://insight.symfony.com/what-we-analyse/twig.template_too_long
- resources/layouts/partials/new.css.twig is 386 lines long
- resources/…/partials/metatags.html.twig is 208 lines long
narno