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

Suppress errors for one line only #2

Closed
muglug opened this issue Nov 21, 2016 · 3 comments
Closed

Suppress errors for one line only #2

muglug opened this issue Nov 21, 2016 · 3 comments
Assignees

Comments

@muglug
Copy link
Collaborator

muglug commented Nov 21, 2016

Allow single-line issue suppression e.g.

/** @psalm-suppress UndefinedMethod **/
$foo->bar();
@ghost
Copy link

ghost commented May 12, 2017

psalm:dev-master 53b81ac

$args = [
                            $args[0],
                            $fields[$id]['options'],
                            $args[1],
                        ];
                        $args[2] = array_merge_recursive(
                            ((array)($args[2])),
                            [
                                'style' => [
                                    'width:100%;',
                                ],
                            ]
                        );
                        if (isset($args, $args[2], $args[2]['value'])) {
                            /**
                            * @psalm-suppress InvalidArrayAccess
                            */
                            unset($args[2]['value']);
                        }

error not suppressed, incidentally also conflicts with php-cs-fixer 0ea4f7ed06ca55da (1.x release, not yet able to upgrade to 2.x), with phpdoc_to_comment, despite it being turned off.

@weirdan
Copy link
Collaborator

weirdan commented Oct 19, 2017

Would also be useful to suppress things like DeprecatedMethod, where there's no structural element to attach the docblock to.

class A {
  /**
   * @deprecated
   */
  public static function b(): void {}
}
/**
 * @psalm-suppress DeprecatedMethod
 */
A::b();

@muglug muglug closed this as completed in 8b7d82d Oct 26, 2017
@muglug
Copy link
Collaborator Author

muglug commented Oct 27, 2017

cc @nickyr

danog referenced this issue in nicelocal/psalm Jun 22, 2022
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

2 participants