Your project should use return types 10

More information: https://insight.symfony.com/what-we-analyse/php.missing_return_typehint

  1. /**
  2. * Insert inline.
  3. * e.g.: ++text++ -> <ins>text</ins>.
  4. */
  5. protected function inlineInsert($Excerpt)

    Method Cecil\Converter\Parsedown::inlineInsert() has no return type specified.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Arnaud Ligny
  6. {
  7. if (!isset($Excerpt['text'][1])) {
  8. return;
  9. }
  • narno

    Ignored on Sat, 15 Oct 2022 23:08:47 GMT
  1. }
  2. /**
  3. * {@inheritdoc}
  4. */
  5. protected function inlineLink($Excerpt)

    Method Cecil\Converter\Parsedown::inlineLink() has no return type specified.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Arnaud Ligny
  6. {
  7. $link = parent::inlineLink($Excerpt); // @phpstan-ignore staticMethod.notFound
  8. if (!isset($link)) {
  9. return null;
  • narno

    Ignored on Sun, 23 Oct 2022 22:33:57 GMT
  • narno

    Ignored on Sun, 23 Oct 2022 22:34:12 GMT
  1. }
  2. /**
  3. * {@inheritdoc}
  4. */
  5. protected function inlineImage($Excerpt)

    Method Cecil\Converter\Parsedown::inlineImage() has no return type specified.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Arnaud Ligny
  6. {
  7. $InlineImage = parent::inlineImage($Excerpt); // @phpstan-ignore staticMethod.notFound
  8. if (!isset($InlineImage)) {
  9. return null;
  10. }
  • narno

    Ignored on Sat, 15 Oct 2022 23:08:50 GMT
  1. }
  2. /**
  3. * Image block.
  4. */
  5. protected function blockImage($Excerpt)

    Method Cecil\Converter\Parsedown::blockImage() has no return type specified.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Arnaud Ligny
  6. {
  7. if (1 !== preg_match($this->regexImage, $Excerpt['text'])) {
  8. return;
  9. }
  • narno

    Ignored on Mon, 31 Oct 2022 20:50:51 GMT
  1. * **Tip:** This is an advice.
  2. * :::
  3. *
  4. * Code inspired by https://github.com/sixlive/parsedown-alert from TJ Miller (@sixlive).
  5. */
  6. protected function blockNote($block)

    Method Cecil\Converter\Parsedown::blockNote() has no return type specified.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Arnaud Ligny
  7. {
  8. if (preg_match('/:::(.*)/', $block['text'], $matches)) {
  9. $block = [
  10. 'char' => ':',
  11. 'element' => [
  • narno

    d on Sat, 15 Oct 2022 23:08:55 GMT
  1. return $block;
  2. }
  3. }
  4. protected function blockNoteContinue($line, $block)

    Method Cecil\Converter\Parsedown::blockNoteContinue() has no return type specified.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Arnaud Ligny
  5. {
  6. if (isset($block['complete'])) {
  7. return;
  8. }
  9. if (preg_match('/:::/', $line['text'])) {
  • narno

    Ignored on Sat, 15 Oct 2022 23:08:57 GMT
  1. $block['element']['text'] .= $line['text'] . "\n";
  2. return $block;
  3. }
  4. protected function blockNoteComplete($block)

    Method Cecil\Converter\Parsedown::blockNoteComplete() has no return type specified.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Arnaud Ligny
  5. {
  6. $block['element']['rawHtml'] = $this->text($block['element']['text']);
  7. unset($block['element']['text']);
  8. return $block;
  • narno

    Ignored on Sat, 15 Oct 2022 23:09:00 GMT
  1. }
  2. /**
  3. * Apply Highlight to code blocks.
  4. */
  5. protected function blockFencedCodeComplete($block)

    Method Cecil\Converter\Parsedown::blockFencedCodeComplete() has no return type specified.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Arnaud Ligny
  6. {
  7. if (!(bool) $this->config->get('pages.body.highlight.enabled')) {
  8. return $block;
  9. }
  10. if (!isset($block['element']['text']['attributes'])) {
  • narno

    Ignored on Sat, 15 Oct 2022 23:09:02 GMT
  1. }
  2. /**
  3. * {@inheritdoc}
  4. */
  5. protected function parseAttributeData($attributeString)

    Method Cecil\Converter\Parsedown::parseAttributeData() has no return type specified.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Arnaud Ligny
  6. {
  7. $attributes = preg_split('/[ ]+/', $attributeString, -1, PREG_SPLIT_NO_EMPTY);
  8. $Data = [];
  9. $HtmlAtt = [];
  • narno

    Ignored on Sat, 15 Oct 2022 23:09:05 GMT
  1. }
  2. /**
  3. * Adds global variables.
  4. */
  5. protected function addGlobals()

    Method Cecil\Step\Pages\Render::addGlobals() has no return type specified.

    Time to fix: about 9 minutes
    Read doc Open Issue Permalink
    Last edited by Arnaud Ligny
  6. {
  7. $this->builder->getRenderer()->addGlobal('cecil', [
  8. 'url' => \sprintf('https://cecil.app/#%s', Builder::getVersion()),
  9. 'version' => Builder::getVersion(),
  10. 'poweredby' => \sprintf('Cecil v%s', Builder::getVersion()),
  • narno

    Ignored on Sat, 15 Oct 2022 23:09:14 GMT

Your project uses discouraged functions to kill scripts

More information: https://insight.symfony.com/what-we-analyse/php.use_exit_function

  1. if ($this->io === null) {
  2. $this->io = new SymfonyStyle($input, $output);
  3. }
  4. $this->io->error($e->getMessage());
  5. exit(1);

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Read doc Open Issue Permalink
    Last edited by Arnaud Ligny
  6. }
  7. }
  8. /**
  9. * Returns the working path.
  • narno

    Ignored on Sun, 21 Nov 2021 02:26:06 GMT

Your project uses the sleep function, which could introduce timeouts

More information: https://insight.symfony.com/what-we-analyse/php.use_php_sleep_function

in src/Command/Serve.php, line 190
  1. if ($open) {
  2. $output->writeln('Opening web browser...');
  3. Util\Plateform::openBrowser(\sprintf('http://%s:%s', $host, $port));
  4. }
  5. while ($process->isRunning()) {
  6. sleep(1); // wait for server is ready

    sleep() may create timeouts without even protecting your application.

    Time to fix: about 4 hours
    Read doc Open Issue Permalink
    Last edited by Arnaud Ligny
  7. if (!fsockopen($host, (int) $port)) {
  8. $output->writeln('<info>Server is not ready.</info>');
  9. return 1;
  10. }
  • narno

    Ignored on Fri, 12 Jan 2024 18:56:30 GMT

Your project templates should not be too long

More information: https://insight.symfony.com/what-we-analyse/twig.template_too_long

6% of all your templates have more than 200 lines, the threshold is 5%.

Time to fix: about 5 hours
Read doc Open Issue Permalink
Collective
  • narno

    Ignored on Wed, 20 Sep 2023 22:34:39 GMT