| Conditions | 4 |
| Paths | 8 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 9.1992 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | 1 | public function game() // new game |
|
| 18 | { |
||
| 19 | // SET NAME |
||
| 20 | 1 | empty($_POST) ? print_r($this->name()) : null; |
|
| 21 | // SET NAME RESULT |
||
| 22 | 1 | if (isset($_POST['setName'])) { |
|
| 23 | $this->prepareSessions(); // save name and reset points |
||
| 24 | $this->shuffleDeck(); // shuffle deck, store in session('deck'); |
||
| 25 | $this->prepareStack(); // create draw stack |
||
| 26 | print_r($this->displayGrid()); // setup grid |
||
| 27 | } |
||
| 28 | // // IF CARD WAS PLACED ($_POST begins with 'place') |
||
| 29 | 1 | if (isset($_POST['placeCard'])) { |
|
| 30 | $this->placeCard(); |
||
| 31 | $this->prepareStack(); |
||
| 32 | $this->setPointsSessions(); |
||
| 33 | $this->checkFullRow(); |
||
| 34 | $this->checkFullColumn(); |
||
| 35 | print_r($this->displayGrid()); |
||
| 36 | $this->storeToDatabase(); |
||
| 37 | } |
||
| 38 | 1 | } |
|
| 39 | } |
||
| 40 |