Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return value of Symfony\Component\Debug\ExceptionHandler::setFileLinkFormat() must be of the type string, null returned #32150

Closed
jlslew opened this issue Jun 24, 2019 · 1 comment

Comments

@jlslew
Copy link

jlslew commented Jun 24, 2019

Symfony version(s) affected: master

Description

The variable fileLinkFormat is initialized everywhere in the class Symfony\Component\Debug\ExceptionHandler to null but here it is asking for a string

public function setFileLinkFormat($fileLinkFormat): string
{
    $old = $this->fileLinkFormat;
    $this->fileLinkFormat = $fileLinkFormat;
    return $old;
}

How to reproduce

  • git clone git@github.com:symfony/website-skeleton.git .
  • composer install

Additional context

The return type was added in PR #31996

@fancyweb
Copy link
Contributor

Status: reviewed

Yes, the comment and the strict return type is wrong. Can you send a PR?

@fabpot fabpot closed this as completed Jun 26, 2019
fabpot added a commit that referenced this issue Jun 26, 2019
…nkFormat accept Null as a return type (jls-esokia)

This PR was merged into the 5.0-dev branch.

Discussion
----------

Make Symfony\Component\Debug\ExceptionHandler::setFileLinkFormat accept Null as a return type

fixes #32150

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #32150    <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | - <!-- required for new features -->

<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too).
 - Features and deprecations must be submitted against branch 4.4.
 - Legacy code removals go to the master branch.
-->
Make `Symfony\Component\Debug\ExceptionHandler::setFileLinkFormat` accept null as a return type.
Since Symfony requires PHP 7.2+ and that PHP feature was introduced in 7.1, I use that feature instead of changing the default value of the variable.

Commits
-------

e6cb7d8 Remove return type from ExceptionHandler::setFileLinkFormat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants