What is PSR in php ? Please explain with example
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
4
down vote
favorite
How PSR is useful in Magento 2 .
I learned
PSR-0 â Autoloader Standard
PSR-1 â Basic Coding Standard
PSR-2 â Coding Style Guide
PSR-3 â Logger Interface
PSR-4- Autoloader Standard
but I want to learn from example .
can anyone show me examples .
magento2 php-7 psr
add a comment |Â
up vote
4
down vote
favorite
How PSR is useful in Magento 2 .
I learned
PSR-0 â Autoloader Standard
PSR-1 â Basic Coding Standard
PSR-2 â Coding Style Guide
PSR-3 â Logger Interface
PSR-4- Autoloader Standard
but I want to learn from example .
can anyone show me examples .
magento2 php-7 psr
add a comment |Â
up vote
4
down vote
favorite
up vote
4
down vote
favorite
How PSR is useful in Magento 2 .
I learned
PSR-0 â Autoloader Standard
PSR-1 â Basic Coding Standard
PSR-2 â Coding Style Guide
PSR-3 â Logger Interface
PSR-4- Autoloader Standard
but I want to learn from example .
can anyone show me examples .
magento2 php-7 psr
How PSR is useful in Magento 2 .
I learned
PSR-0 â Autoloader Standard
PSR-1 â Basic Coding Standard
PSR-2 â Coding Style Guide
PSR-3 â Logger Interface
PSR-4- Autoloader Standard
but I want to learn from example .
can anyone show me examples .
magento2 php-7 psr
edited Aug 23 at 8:59
kunj
2,3772420
2,3772420
asked Aug 23 at 8:59
Jaykumar R
212
212
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
4
down vote
PSR stands for PHP Standards Recommendations, this is a code convention. Magento 2 uses PSR-1 and PSR-2 See https://www.php-fig.org/psr/ for the conventions and examples.
An example is that you should write methods in camelCase and not with underscores, for example:
public function my_method()
// do something
Should be:
public function myMethod()
// do something
can you show examples .
â Jaykumar R
Aug 23 at 9:16
@JaykumarR Added an example for you
â R. Jansen
Aug 23 at 9:40
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
PSR stands for PHP Standards Recommendations, this is a code convention. Magento 2 uses PSR-1 and PSR-2 See https://www.php-fig.org/psr/ for the conventions and examples.
An example is that you should write methods in camelCase and not with underscores, for example:
public function my_method()
// do something
Should be:
public function myMethod()
// do something
can you show examples .
â Jaykumar R
Aug 23 at 9:16
@JaykumarR Added an example for you
â R. Jansen
Aug 23 at 9:40
add a comment |Â
up vote
4
down vote
PSR stands for PHP Standards Recommendations, this is a code convention. Magento 2 uses PSR-1 and PSR-2 See https://www.php-fig.org/psr/ for the conventions and examples.
An example is that you should write methods in camelCase and not with underscores, for example:
public function my_method()
// do something
Should be:
public function myMethod()
// do something
can you show examples .
â Jaykumar R
Aug 23 at 9:16
@JaykumarR Added an example for you
â R. Jansen
Aug 23 at 9:40
add a comment |Â
up vote
4
down vote
up vote
4
down vote
PSR stands for PHP Standards Recommendations, this is a code convention. Magento 2 uses PSR-1 and PSR-2 See https://www.php-fig.org/psr/ for the conventions and examples.
An example is that you should write methods in camelCase and not with underscores, for example:
public function my_method()
// do something
Should be:
public function myMethod()
// do something
PSR stands for PHP Standards Recommendations, this is a code convention. Magento 2 uses PSR-1 and PSR-2 See https://www.php-fig.org/psr/ for the conventions and examples.
An example is that you should write methods in camelCase and not with underscores, for example:
public function my_method()
// do something
Should be:
public function myMethod()
// do something
edited Aug 23 at 9:40
answered Aug 23 at 9:05
R. Jansen
707
707
can you show examples .
â Jaykumar R
Aug 23 at 9:16
@JaykumarR Added an example for you
â R. Jansen
Aug 23 at 9:40
add a comment |Â
can you show examples .
â Jaykumar R
Aug 23 at 9:16
@JaykumarR Added an example for you
â R. Jansen
Aug 23 at 9:40
can you show examples .
â Jaykumar R
Aug 23 at 9:16
can you show examples .
â Jaykumar R
Aug 23 at 9:16
@JaykumarR Added an example for you
â R. Jansen
Aug 23 at 9:40
@JaykumarR Added an example for you
â R. Jansen
Aug 23 at 9:40
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f239314%2fwhat-is-psr-in-php-please-explain-with-example%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password