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 | |
namespace League\Event; | |
interface ListenerInterface | |
{ | |
/** | |
* Handle an event. | |
* | |
* @param EventInterface $event |
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 | |
namespace League\Event; | |
abstract class AbstractListener implements ListenerInterface | |
{ | |
/** | |
* {@inheritdoc} | |
*/ | |
public function isListener($listener) |
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
trait PartialListener | |
{ | |
/** | |
* {@inheritdoc} | |
*/ | |
public function isListener($listener) | |
{ | |
return $this === $listener; | |
} | |
} |
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
private function setTransformer(TransformerInterface $transformer) | |
{ | |
$this->writer->insertOne($transformer->getHeaders()); | |
$this->writer->addFormatter([$transformer, 'transform']); | |
} |
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
trait CsvWriter | |
{ | |
private $file; | |
private $writer; | |
private function setup() | |
{ | |
$this->file = new SplTempFileObject(); | |
$this->writer = Writer::createFromFileObject($this->file); | |
} |
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
trait CsvWriter | |
{ | |
private $file; | |
private $writer; | |
} |
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 CsvExporter | |
{ | |
protected $repository; | |
protected $file; | |
protected $writer; | |
protected $parameters; |
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 AbstractRepository | |
{ | |
public function __construct(Model $models) | |
{ | |
$this->models = $models; | |
} | |
public function get(array $options = []) | |
{ | |
if (isset($options['sort'])) { |
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 ResolvableMiddleware | |
{ | |
public function __construct(ContainerInterface $container, $classname) | |
{ | |
$this->container = $container; | |
$this->classname = $classname; | |
} |
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
# Show graph of commits with abbreviated hashes and commit messages | |
git log --oneline --decorate --all --graph | |
# Show entire repo's changes one at a time to decide which to stage and which not. | |
git add -p | |
# Record conflict resolving. https://git-scm.com/blog/2010/03/08/rerere.html | |
git config --global rerere.enabled true | |
# Merge, but always add an extra merge commit instead of just moving the branch reference. |