Last Updated: February 25, 2016
·
574
· sanguis

Don't manage the semi collin

when i am working on php classes some times I need to run multiple
class::functions on an object.

$query = new SysbioEntityFieldQuery();
    $query
      ->entityCondition('bundle', 'event')
      ->fieldCondition('field_event_type', 'tid', 'NULL', '!=')
      ->addTag('debug');

What if I need to add a function? I can just add it to the end w/o moving the semi colln, and this is constanly causeing me an extrea few keystrokes of debugging.

$query = new SysbioEntityFieldQuery();
    $query
      ->entityCondition('bundle', 'event')
      ->fieldCondition('field_event_type', 'tid', 'NULL', '!=')
      ->addTag('debug'); //declartions ends
      ->addTag('distinct') // error

So intead I have just moved the semi colin to its own line and I never have to waste that time again.

$query = new SysbioEntityFieldQuery();
$query
  ->entityCondition('bundle', 'event')
  ->fieldCondition('field_event_type', 'tid', 'NULL', '!=')
  ->addTag('debug')
  ->addTag('distinct')
  ;