Created
April 30, 2020 19:27
-
-
Save rockoo/7d49b083aee13b504f76925d28abdeb4 to your computer and use it in GitHub Desktop.
Nonesenical example for an Medium article on Stack Traces
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 | |
namespace Poker; | |
class Deck | |
{ | |
protected $deck = null; | |
public function __construct(int $cards = 52) | |
{ | |
$this->deck = range(0, $cards); | |
} | |
private function _shuffle(): Deck | |
{ | |
\shufflr($this->deck); | |
return $this; | |
} | |
private function _log(): bool | |
{ | |
return true; | |
} | |
public function deal(): array | |
{ | |
$this->_log(); // Pass | |
$this->_shuffle(); // Fail | |
} | |
} | |
(new Deck)->deal(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment