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 | |
class Collection<EntryType> | |
{ | |
private $collection = []; | |
public function addValue(EntryType $item) | |
{ | |
$this->collection[] = $item; | |
} |
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 | |
public function runBatch<T is Runnable>(T $batch) { | |
foreach ($batch as $entry) { | |
$entry->run(); // Runnable | |
} | |
} |
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 | |
public function resolve($toResolve) | |
{ | |
if (is_callable($toResolve)) { | |
return $toResolve; | |
} | |
if (!is_string($toResolve)) { | |
$this->assertCallable($toResolve); | |
} |
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 | |
function resolve($toResolve) | |
{ | |
if (is_callable($toResolve)) { | |
return $toResolve; | |
} else { | |
if (!is_string($toResolve)) { | |
$this->assertCallable($toResolve); | |
} | |
if (preg_match(self::CALLABLE_PATTERN, $toResolve, $m)) |
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
PATCH images/4 | |
{ | |
"width": 400, | |
"height": 200 | |
} |
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
POST images.crop-image | |
{ | |
"id": 4, | |
"width": 400, | |
"height": 200 | |
} |
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
POST cropImage | |
{ | |
"id": 4, | |
"width": 400, | |
"height": 200 | |
} |
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
POST displayUser | |
{ | |
“Id”: 4 | |
} |
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
GET displayUser?id=4 |
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 | |
public function mailUsers(Message $message) | |
{ | |
$users = $this->userRespository->getUsers(); | |
MailService::SendToUsers($users, $message); | |
} |