Skip to content

Instantly share code, notes, and snippets.

@Enelar
Created April 12, 2018 23:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Enelar/30156f533acabc7804a364f6a3f9bc90 to your computer and use it in GitHub Desktop.
Save Enelar/30156f533acabc7804a364f6a3f9bc90 to your computer and use it in GitHub Desktop.
Find any catch block without _logger
rgrep -zoP "catch(?:.*){\n(?:.*\n){0,10}?(?:.*?(_logger)?.*\n)(?:.*\n){0,10}?.*}\n" | grep -aEvz "(.*.php).*(_logger).*?\n" | grep -aPo "(.*php)"
# catch (\Exception $e) {
# $this->_logger->critical($e);
# $message = __('An exception occurred while saving the address');
# $response = ['error' => 'true', 'message' => $message];
# }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment