To align or not to align...
Pros and cons of the following approaches.
I like to use first case. Because I think it's optimal, but someone else thinks otherwise.
- when adding a new constant to the file - diff is 1 string, not more
- clearer, more beautiful
- chain call (-> -> -> ->) - is clearer
What do you think? May be there is PSR about it?
Case style 1
class A {
const AB = 1;
const PAGE = 2;
const PP_SOMETHING_VERY_LONG = 3;
public function testLoooooooooong()
{
$a = 1;
$somethingWeryLong = 2;
$c = 3;
$res = $a + $c;
$b = 1;
$n = 100;
return 0;
}
public function test2($objectttttttttttttttLooooooong)
{
$objectttttttttttttttLooooooong->callSooooooooomethingLooooooong()
->call(
$this->testLoooooooooong(),
$this->testLoooooooooong2(),
$this->testLoooooooooong3()
)
->call(
$this->testLoooooooooong(),
$this->testLoooooooooong2(),
$this->testLoooooooooong3()
);
}
}
Case style 2
class A {
const AB = 1;
const PAGE = 2;
const PP_SOMETHING_VERY_LONG = 3;
public function testLoooooooooong() {
$a = 1;
$somethingWeryLong = 2;
$c = 3;
$res = $a + $c;
$b = 1;
$n = 100;
return 0;
}
public function test2($objectttttttttttttttLooooooong) {
$objectttttttttttttttLooooooong->callSooooooooomethingLooooooong()
->call(
$this->testLoooooooooong(),
$this->testLoooooooooong2(),
$this->testLoooooooooong3()
)
->call(
$this->testLoooooooooong(),
$this->testLoooooooooong2(),
$this->testLoooooooooong3()
);
}
}