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

Detect dependencies in catch blocks #267

Merged
merged 1 commit into from
Feb 21, 2024
Merged

Detect dependencies in catch blocks #267

merged 1 commit into from
Feb 21, 2024

Conversation

jakobw
Copy link
Contributor

@jakobw jakobw commented Feb 20, 2024

This enables PHPat to detect dependencies to exception classes in catch blocks.

Example: Given a class that isn't allowed to depend on SomeException, the following code snippet now correctly reports a violation of this rule.

try {
    // something dangerous
} catch(SomeException $e) {
    // ...
}

This enables PHPat to detect dependencies to exception classes in catch
block. Given a class that isn't allowed to depend on `SomeException`,
the following code snippet now correctly reports a violation of this
rule:

```php
try {
    // something dangerous
} catch(SomeException $e) {
    // ...
}
```
@carlosas carlosas merged commit b6efadd into carlosas:master Feb 21, 2024
12 checks passed
@jakobw jakobw deleted the catch-block-relation branch February 21, 2024 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants