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 Container { | |
public $config; | |
public $cache = []; | |
public function __construct($config) | |
{ | |
$this->config = $config; |
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 | |
$i = (fn($x) => (function ($x) { | |
return (fn($x) => $x + 1)($x + 1); | |
})($x + 1)); | |
echo $i(1); // 4 |
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 MyApiClient | |
{ | |
use Requestor; | |
const VERSION = 'v1'; | |
/** @var GuzzleHttp\Client */ | |
private $client; |
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
use Rms\Domains\User\Commands\{ CreateUserCommand, CreateReservationHandler } | |
use Rms\App\Controllers\{ UserController, ReservationController} | |
src | |
- Domains | |
- User | |
- UserRepository.php | |
- UserEntity.php | |
- Commands | |
- CreateUserCommand.php |
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 mod { | |
public function __construct(private $aMod) {} | |
public function map($cCall) { | |
$this->aMod = array_map($cCall, $this->aMod); | |
return $this; | |
} | |
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 StrictSwitch | |
{ | |
private $val; | |
private $done = false; | |
public function __construct($val) | |
{ |
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 | |
interface Dep { | |
public function has(); | |
} | |
// i want to test this function and get 100% code coverage | |
function depends(Dep $dependency) { | |
if ($dependency->has()) { | |
return true; |
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 | |
$aPages = [ | |
'reservation', 'room type', 'room', 'rate type', 'rate availability', 'settings', 'connectivity' | |
]; | |
$aTests = [ | |
'rs', 'rt', 'rm', 'rat', 'ra', 'st', 'cnn' | |
]; |
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 Price | |
{ | |
public function getAmount(): int | |
{ | |
return 0; | |
} | |
} |
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 Singleton | |
{ | |
protected static $instanches = []; | |
private function __construct() | |
{ | |
} | |