<p>A few months ago, <a href="/podcast/6-dan-leech-php-tui">Beyond Blocks podcast guest Dan Leech</a> give another talk at the PHP South West user group.</p>
<p>This talk was about <a href="https://www.youtube.com/watch?v=UpyVAcWGQhg">building an expression language from scratch</a>, but in one part of the talk, Dan showed how he creates Collection classes.</p>
<p>I use Collection classes a lot, have <a href="/presentations/using-illuminate-collections-outside-laravel">given talks about them</a> and <a href="https://www.drupal.org/project/collection_class">wrote a Collections module for Drupal 7</a>.</p>
<p>In Dan's talk, instead of using a Collection from Laravel or Doctrine, <a href="https://github.com/dantleech/onehourexpr/blob/8c4ee4a3c1680455118e16a3e1be2a08418ab207/src/Tokens.php">he created his own</a>.</p>
<p>His extended PHP's <code>IteratorAggregate</code> class so had no external dependencies.</p>
<p>He could then add whatever additional methods and functionality he needed.</p>
<p>Looking at other repositories on GitHub, I was able to find other examples.</p>
<p>I've done this on projects since Dan's talk and like taking the minimalist approach - avoiding adding a dependency to my project and only adding the functionality I need and functionality that's more specific to my domain.</p>
<p>A few months ago, <a href="/podcast/6-dan-leech-php-tui">Beyond Blocks podcast guest Dan Leech</a> give another talk at the PHP South West user group.</p>
<p>This talk was about <a href="https://www.youtube.com/watch?v=UpyVAcWGQhg">building an expression language from scratch</a>, but in one part of the talk, Dan showed how he creates Collection classes.</p>
<p>I use Collection classes a lot, have <a href="/presentations/using-illuminate-collections-outside-laravel">given talks about them</a> and <a href="https://www.drupal.org/project/collection_class">wrote a Collections module for Drupal 7</a>.</p>
<p>In Dan's talk, instead of using a Collection from Laravel or Doctrine, <a href="https://github.com/dantleech/onehourexpr/blob/8c4ee4a3c1680455118e16a3e1be2a08418ab207/src/Tokens.php">he created his own</a>.</p>
<p>His extended PHP's <code>IteratorAggregate</code> class so had no external dependencies.</p>
<p>He could then add whatever additional methods and functionality he needed.</p>
<p>Looking at other repositories on GitHub, I was able to find other examples.</p>
<p>I've done this on projects since Dan's talk and like taking the minimalist approach - avoiding adding a dependency to my project and only adding the functionality I need and functionality that's more specific to my domain.</p>