Skip to content

Instantly share code, notes, and snippets.

View yourwebmaker's full-sized avatar
🍊
Back to Reality!

Daniel Lima yourwebmaker

🍊
Back to Reality!
  • Netherlands
View GitHub Profile
<?php
declare(strict_types=1);
namespace PHPBrasil\ExemploTest;
use PHPUnit\Framework\TestCase;
class ExemploMockStub extends TestCase
{
[
{
"region": "Amsterdam",
"liquidity": 80,
"published": 123
},
{
"region": "Utrecht",
"liquidity": 76,
"published": 321
<?php
class FooEntity
{
public string $entityId;
public DateTime $date;
public function __construct(string $entityId, DateTime $date)
{
$this->entityId = $entityId;
$this->date = $date;
<?php
class Book
{
private $rates = [];
public function rate(string $userId, int $rate) : void
{
if (isset($this->rates[$userid])) {
throw new AlreadyRatedThisBook();
}