Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> PSR a klamry if-a
noe
post
Post #1





Grupa: Zarejestrowani
Postów: 13
Pomógł: 0
Dołączył: 30.07.2011

Ostrzeżenie: (0%)
-----


Witam,

czy wg standardu kodowania PSR taka instrukcja jest prawidłowa:

  1. if( isset($values['key']) && $values['key'] ) foreach($values['key'] as $v){
  2. // do
  3. }
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 5)
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Naprawde wg. Ciebie ma to związek z OOP? Przenosze
Go to the top of the page
+Quote Post
com
post
Post #3





Grupa: Zarejestrowani
Postów: 3 034
Pomógł: 366
Dołączył: 24.05.2012

Ostrzeżenie: (0%)
-----


https://github.com/php-fig/fig-standards/bl...-style-guide.md
Go to the top of the page
+Quote Post
noe
post
Post #4





Grupa: Zarejestrowani
Postów: 13
Pomógł: 0
Dołączył: 30.07.2011

Ostrzeżenie: (0%)
-----


No właśnie nie mogę znależć nic na ten temat, tzn. nie widzę aby gdzieś było napisane że klamry muszą być zawsze w każdym przypadku.
Go to the top of the page
+Quote Post
Pyton_000
post
Post #5





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

Ostrzeżenie: (0%)
-----


Słabo z czytaniem:
Cytat
The body of each structure MUST be enclosed by braces.
Go to the top of the page
+Quote Post
nospor
post
Post #6





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Punkt 5 Control Structures ma wyraźnie napisane
Cytat
The body of each structure MUST be enclosed by braces. T
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 16:24