PHP7 https://www.garfieldtech.com/ en Don't use mocking libraries https://www.garfieldtech.com/blog/no-mocking <span class="field field--name-title field--type-string field--label-hidden">Don&#039;t use mocking libraries</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>I am all for testing. Whether you always write unit tests in advance as Test Driven Development (TDD) advocates call for, write them after, write them alongside, a little of each, I don't care. Tests are your friend. You want tests, and specifically you want good tests.</p> <p>There's a lot of opinions on what constitutes a "good" test, of course, and much is subjective to the type of code you're working on. However, since the release of PHP 7 I've found that while writing tests... I am never using a mocking library. In fact, I'm going to go as far and say that</p> <blockquote><p>You should never use a mocking library in PHP 7.</p></blockquote> <p>Before all of you gasp, clutch your pearls, and send ninja hit squads after me, let me justify that position.</p> <p><a href="https://steemit.com/php/@crell/don-t-use-mocking-libraries">Continue reading on Steemit</a></p> </div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span>Larry</span></span> <span class="field field--name-created field--type-created field--label-hidden">14 September 2018 - 6:25pm</span> <div class="node__links"> <ul class="links inline"><li class="node-readmore"><a href="/blog/no-mocking" rel="tag" title="Don&#039;t use mocking libraries" hreflang="en">Read more<span class="visually-hidden"> about Don&#039;t use mocking libraries</span></a></li></ul> </div> Fri, 14 Sep 2018 23:25:34 +0000 Larry 256 at https://www.garfieldtech.com Short and safe array iteration https://www.garfieldtech.com/blog/short-array-iteration <span class="field field--name-title field--type-string field--label-hidden">Short and safe array iteration</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>One reason to follow development mailing lists is you sometimes pick up on some very neat tricks. Here's one that I spotted on the PHP Internals list recently to simplify array iteration in PHP 7.</p> </div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span>Larry</span></span> <span class="field field--name-created field--type-created field--label-hidden">22 October 2017 - 4:50am</span> <div class="node__links"> <ul class="links inline"><li class="node-readmore"><a href="/blog/short-array-iteration" rel="tag" title="Short and safe array iteration" hreflang="en">Read more<span class="visually-hidden"> about Short and safe array iteration</span></a></li><li class="comment-comments"><a href="/blog/short-array-iteration#comments" title="Jump to the first comment." hreflang="en">5 comments</a></li><li class="comment-new-comments"><a href="/taxonomy/term/109/feed" class="hidden" title="Jump to the first new comment." data-history-node-last-comment-timestamp="1513795416" data-history-node-field-name="comment"></a></li></ul> </div> Sun, 22 Oct 2017 09:50:39 +0000 Larry 252 at https://www.garfieldtech.com PHP 7 Explained: A review https://www.garfieldtech.com/blog/php7explained-review <span class="field field--name-title field--type-string field--label-hidden">PHP 7 Explained: A review</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>The team over at thePHP.cc recently published an ebook entitled <em><a href="https://php7explained.com/">PHP 7 Explained</a></em>, "Everything you need to know about the next generation."</p> <p>A few weeks back, I received an email from them stating "As a token of our appreciation for your involvement in the PHP community we would like to gift you a copy of our eBook." Yay, free stuff! Since I'd gotten it free, and it's of timely use to the PHP world, I decided to publish a formal review.</p> <p>Disclaimer: I was not asked to write a review, although the authors did ask for feedback. The only compensation I receive for this review is the book itself, which was sent without the expectation of a review. Also to the authors, yes feel free to quote portions of this review on the books site as long as it's credited.</p></div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span>Larry</span></span> <span class="field field--name-created field--type-created field--label-hidden">31 December 2016 - 1:50pm</span> <div class="node__links"> <ul class="links inline"><li class="node-readmore"><a href="/blog/php7explained-review" rel="tag" title="PHP 7 Explained: A review" hreflang="en">Read more<span class="visually-hidden"> about PHP 7 Explained: A review</span></a></li></ul> </div> Sat, 31 Dec 2016 19:50:47 +0000 Larry 242 at https://www.garfieldtech.com New Drupal, new Platform, new PHP, new year https://www.garfieldtech.com/blog/drupal8-upgrade <span class="field field--name-title field--type-string field--label-hidden">New Drupal, new Platform, new PHP, new year</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>OK, well, it took a while, but I've finally gotten my blog off of Drupal 6. :-) Welcome to the new and improved Garfieldtech.com! My blog is unsurprisingly rather bland, as it's, well, a blog. That made updating to Drupal 8.2 using the Drupal migrate module reasonably easy. It wasn't hiccup free, and a few not-yet-updated modules got lost along the way, but it wasn't an epic struggle, either. There were only two major hiccups:</p></div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span>Larry</span></span> <span class="field field--name-created field--type-created field--label-hidden">31 December 2016 - 12:19pm</span> <div class="node__links"> <ul class="links inline"><li class="node-readmore"><a href="/blog/drupal8-upgrade" rel="tag" title="New Drupal, new Platform, new PHP, new year" hreflang="en">Read more<span class="visually-hidden"> about New Drupal, new Platform, new PHP, new year</span></a></li><li class="comment-comments"><a href="/blog/drupal8-upgrade#comments" title="Jump to the first comment." hreflang="en">2 comments</a></li><li class="comment-new-comments"><a href="/taxonomy/term/109/feed" class="hidden" title="Jump to the first new comment." data-history-node-last-comment-timestamp="1483385365" data-history-node-field-name="comment"></a></li></ul> </div> Sat, 31 Dec 2016 18:19:33 +0000 Larry 241 at https://www.garfieldtech.com