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 MyPresenter | |
// ... | |
public function showUsers() | |
{ | |
// ... | |
$data = $this->accountManager->getUserDetails($from = 10, $to = 20); | |
$this->view->bind('list', $data); | |
// ... |
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 | |
// src/UI/Admin/Some/Controller/Namespace/Detail/SomeEntityDetailController.php | |
namespace UI\Admin\Some\Controller\Namespace\Detail; | |
// use ... | |
final class SomeEntityDetailController | |
{ | |
/** |
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
#!/usr/bin/env bash | |
# ATTENTION | |
# This script is incomplete, we would still need to add a way to provide the paths where the files we want to keep have been before. | |
# Alternatively, we could change the script to remove all files that are not under the path we specify, | |
# the code is already there, we just need to adjust and test. | |
# Usage: ./git-move.sh git@github.com:My/source-repo.git git@github.com:My/destination-repo.git my/path/to/keep | |
SOURCE_REPO=${1} |
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 | |
// taken from http://www.peej.co.uk/articles/rmr-architecture.html | |
class Resource { | |
private resourceData = []; | |
method constructor(request, dataSource) { | |
// load data from data source | |
} | |
method get(request) { | |
return new Response(200, getRepresentation(request.url, resourceData)); |
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 | |
// Source: https://github.com/pmjones/adr-example/blob/master/src/Web/Blog/Add/BlogAddAction.php | |
namespace Pmjones\Adr\Web\Blog\Add; | |
use Pmjones\Adr\Domain\Blog\BlogService; | |
use Psr\Http\Message\ResponseInterface as Response; | |
use Psr\Http\Message\ServerRequestInterface as Request; | |
class BlogAddAction | |
{ | |
protected $domain; |
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 | |
final class Point | |
{ | |
private int $x; | |
private int $y; | |
public function __construct(int $x, int $y) | |
{ |
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 | |
final class CreatePostalCodeCommand | |
{ | |
private string $postalCode; | |
private string $locality; | |
private float $latitude; |
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 | |
declare(strict_types=1); | |
function render(string $templateFilePath, array $args = []): string | |
{ | |
if (!file_exists($templateFilePath)) { | |
throw new Exception("Template file '$templateFilePath' does not exist."); | |
} |
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
#!/usr/bin/env bash | |
SCRIPT_PATH="$( | |
cd "$(dirname "$0")" || exit >/dev/null 2>&1 | |
pwd -P | |
)"#!/usr/bin/env bash | |
################################# | |
# Named arguments for base scripts | |
################################# |
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
# Makefile | |
# | |
# Execute targets as often as wanted | |
.PHONY: config | |
# Mute all `make` specific output. Comment this out to get some debug information. | |
.SILENT: | |
# make commands be run with `bash` instead of the default `sh` |
OlderNewer