coding style - PHP "use" declarations repeated or with a comma? -
i curious know, when declaring use statements php @ start of class, why "use" keyword repeated in each line though possible put coma @ end off line next declaration, following:
namespace behat\mink; use behat\mink\driver\driverinterface, behat\mink\selector\selectorshandler, behat\mink\element\documentelement;
unlike this:
namespace symfony\bundle\frameworkbundle\controller; use symfony\component\httpfoundation\response; use symfony\component\httpfoundation\redirectresponse; use symfony\component\dependencyinjection\containeraware; use symfony\component\httpkernel\exception\notfoundhttpexception; use symfony\component\form\formtypeinterface; use symfony\component\form\form; use symfony\component\form\formbuilder; use symfony\bundle\doctrinebundle\registry; use symfony\component\httpfoundation\request;
it ease copy/paste ? mimic import statements of java ? or don't care... :)
it's convenience allow multiple statements on same line. here's excerpt php documentation:
php additionally supports convenience shortcut place multiple use statements on same line
Comments
Post a Comment