Example No. 1:
$something = [1,2,3,4] foreach ($something as $key => $value) { //code code code } $something2 = [];
I can’t find a clear answer about the new living before and after foreach, what does PSR-2 say about this?
Point 2.3 "Lines" Make it optional to add blank lines before and after statements. It is still useful to separate code blocks in “paragraphs” to improve logical understanding and readability.
Blank lines MAY be added to improve readability and indicate appropriate blocks of code.
Source: https://habr.com/ru/post/1609756/More articles:Spring to encrypt and decrypt an API key in a properties file - javaapplication connects to database - javareCaptcha: allow all domains or add via API - recaptchaFailed to import spark packages - javaGoogle+ Sign-in for iOS9 - ios9Spring Шифровать значения из файла свойств - propertiesHow to set the position and size (software) for the main window? - cocoaJNI Bundle's own shared libraries with Clojure libraries - javaSignalR long polling shuts down after 5 seconds - .net3-bit unsigned integer in c - optimizationAll Articles