-
Notifications
You must be signed in to change notification settings - Fork 162
Closed
Labels
acceptedNew rule is acceptedNew rule is acceptednew ruleNew feature implementationNew feature implementationon holdThe issue or PR is on hold.The issue or PR is on hold.technical guidelinesThe rule is based on Magento Technical GuidelinesThe rule is based on Magento Technical Guidelines
Description
Rule
If a method uses system resources (such as files, sockets, streams, etc), the code MUST be wrapped with a try block and the corresponding finally block. In the finally sections, all resources SHOULD be properly released.
Reason
Source: Magento Technical Guidelines.
Implementation
- Subscribe to
T_STRING
token. - Prepare the list of build in PHP functions that use resources or alternatively functions prefixes (
stream_
,socket_
, etc) - Check if token content is
in_array
of system functions. - Raise a warning if no outer
try
statement detected.
Metadata
Metadata
Assignees
Labels
acceptedNew rule is acceptedNew rule is acceptednew ruleNew feature implementationNew feature implementationon holdThe issue or PR is on hold.The issue or PR is on hold.technical guidelinesThe rule is based on Magento Technical GuidelinesThe rule is based on Magento Technical Guidelines