Skip to content

Instantly share code, notes, and snippets.

@ogrrd
Last active December 19, 2015 05:59
Show Gist options
  • Save ogrrd/5908355 to your computer and use it in GitHub Desktop.
Save ogrrd/5908355 to your computer and use it in GitHub Desktop.
Code rules

Some rules on coding style

Carriage return unless its the only line of code in that control structure

<?php
$result = $tags->filter(function($v) use ($type) {
    return $v->getType() === $type;
});
<?php
public function getRows()
{
    return $this->rows;
}
<?php
public function findOneBy(FilterCollectionInterface $criteria)
{
    $out = $this->findBy($criteria);
    $out->setMaxResults(1);

    return $out;
}
<?php
public function setRows($rows)
{
    $this->rows = $rows;

    return $this;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment