This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Hard to read the data | |
* Repeated values | |
* Lacks intent | |
*/ | |
class Customer { | |
function amountInvoicedIn($start_date, $end_date) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use DateRange; | |
/** | |
* Easy to read | |
* Easy to refactor | |
* Easy to mock and test | |
*/ | |
class Customer { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE'users' ( | |
'id' int(10) unsigned NOT NULL AUTO_INCREMENT, | |
'password' text COLLATE utf8_unicode_ci NOT NULL, | |
'email' varchar(45) COLLATE utf8_unicode_ci NOT NULL, | |
PRIMARY KEY ('id') | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
*/ | |
namespace Events; | |
use User; | |
class SentryUserAction { | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SimpleTitleParse implements TitleParserInterface { | |
function getTitle($url) | |
{ | |
$url_parts=explode('/',$url); | |
$title=array_pop($url_parts); | |
return $title; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return [ | |
/** | |
* his function determines whether run-together words will be treated as legal | |
* compounds. That is, "thecat" will be a legal compound, although there should be | |
* a space between the two words | |
*/ | |
'run_together'=>false, | |
/** | |
* Set a file that contains replacement pairs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"0": { | |
"worker_details": { | |
"role": "quia", | |
"name": "Shaun Leuschke" | |
} | |
}, | |
"1": { | |
"worker_details": { | |
"role": "quis", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Ofcos the classes should be in different files | |
* Assumes you are using a command bus to raise events I happen to love Jeff Way https://github.com/laracasts/Commander | |
* | |
* With this architecture you don't need to modify any existing classes for new headers just add a new class and should work | |
* | |
* More than one class can handle the requests | |
*/ | |
class CommitComment extends GithubRequest { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Chencha\Autosuggest\Validators; | |
use Chencha\Autosuggest\Exceptions\PspellIsNotInstalled; | |
class CheckPspellIsInstalled { | |
function __construct() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Model\Processors; | |
use DB; | |
/** | |
* Class GetAllColumns | |
* @package Model\Processors | |
* - See more at: http://laravelsnippets.com/snippets/get-all-columns-names-from-a-eloquent-model#sthash.wgqPKvG9.dpuf | |
*/ | |
trait GetAllColumns | |
{ |
OlderNewer