Skip to content

Commit

Permalink
A whole bunch of PHPDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
silasary committed Oct 29, 2023
1 parent 65ccd87 commit f567328
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gatherling/api_lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,11 @@ function card_catalog()
return $result;
}

/**
* @param string $id
* @return string
* @throws Exception
*/
function cardname_from_id($id)
{
$sql = 'SELECT c.name as name FROM cards c WHERE c.scryfallId = ?';
Expand Down
33 changes: 33 additions & 0 deletions tests/EventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,17 @@
use Gatherling\Event;
use Gatherling\Matchup;
use Gatherling\Series;
use PHPUnit\Framework\ExpectationFailedException;
use PHPUnit\Framework\TestCase;
use SebastianBergmann\RecursionContext\InvalidArgumentException;

final class EventsTest extends TestCase
{
/**
* @return Series
* @throws InvalidArgumentException
* @throws ExpectationFailedException
*/
public function testSeriesCreation()
{
if (!Series::exists('Test')) {
Expand All @@ -30,6 +37,11 @@ public function testSeriesCreation()
}

/**
* @param Series $series
* @return Event
* @throws Exception
* @throws InvalidArgumentException
* @throws ExpectationFailedException
* @depends testSeriesCreation
*/
public function testEventCreation($series)
Expand Down Expand Up @@ -78,6 +90,11 @@ public function testEventCreation($series)
}

/**
* @param Event $event
* @return Event
* @throws InvalidArgumentException
* @throws ExpectationFailedException
* @throws Exception
* @depends testEventCreation
*/
public function testRegistration($event)
Expand Down Expand Up @@ -113,6 +130,10 @@ public function testRegistration($event)
}

/**
* @param mixed $event
* @return Event
* @throws InvalidArgumentException
* @throws ExpectationFailedException
* @depends testRegistration
*/
public function testEventStart($event)
Expand All @@ -130,6 +151,10 @@ public function testEventStart($event)
}

/**
* @param mixed $event
* @return mixed
* @throws InvalidArgumentException
* @throws ExpectationFailedException
* @depends testEventStart
*/
public function testReporting($event)
Expand All @@ -151,6 +176,14 @@ public function testReporting($event)
}
}

/**
* @param string $player
* @param Event $event
* @param string $main
* @param string $side
* @return Deck
* @throws Exception
*/
function insertDeck($player, $event, $main, $side)
{
$deck = new Deck(0);
Expand Down

0 comments on commit f567328

Please sign in to comment.