This file contains hidden or 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
Collection::macro('transpose', function () { | |
$items = array_map(function (...$items) { | |
return $items; | |
}, ...$this->values()); | |
return new static($items); | |
}); | |
public function store(Request $request) | |
{ |
This file contains hidden or 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 | |
class RetriesExceededException extends \Exception {} | |
class Retry | |
{ | |
const MAX_RETRIES = 5; | |
const BASE_RETRY_DELAY = 1000000; |
This file contains hidden or 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
Let's start simple. | |
Add your name, contact info (twitter) and a line or two describing where you're holding and what you're looking to get out of a pairing in the comments below. | |
If you make a connection, come back and remove your comment. | |
Over the course of a week (max) pledge each other one hour of code review. | |
Throw some code in a gist or a repo, invite your partner and see what happens. |
This file contains hidden or 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
abstract class ValueObject | |
{ | |
private function __construct(array $params) | |
{ | |
foreach($params as $key => $value) | |
{ | |
if (property_exists($this, $key)) | |
{ | |
$this->$key = $value; |
This file contains hidden or 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 MyValueObject | |
{ | |
/** | |
* @Assert\Length(min = 3) | |
* @Assert\NotBlank | |
*/ | |
private $propertyOne; | |
This file contains hidden or 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
#!/bin/bash | |
# | |
# Allows us to read user input below, assigns stdin to keyboard | |
exec < /dev/tty | |
while true; do | |
read -p "Run Composer install? [Y/n]: " yn | |
case $yn in | |
[Yy]* ) composer install;; |
NewerOlder