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