Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ For listing and getting events:

```php
$cls = new BoxC\Tracking\Events();
// returns array of all events
$cls->list();
// returns associated array of all events with key being the event code
$cls->getAll();

// outputs an event description
$cls->get(100);
Expand Down
6 changes: 3 additions & 3 deletions src/Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

class Events {

const FILE_LOCATION = __DIR__."/data/events.json";
const FILE_LOCATION = "/data/events.json";

/**
* @var $dict List of events
Expand All @@ -35,7 +35,7 @@ class Events {
*/
public function __construct()
{
$events = file_get_contents(self::FILE_LOCATION);
$events = file_get_contents(__DIR__.self::FILE_LOCATION);
$this->dict = json_decode($events, true);
}

Expand All @@ -61,7 +61,7 @@ public function get($code)
*
* @return array
*/
public function list()
public function getAll()
{
return $this->dict;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Events/FetchingEventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class FetchingEventsTest extends TestCase
public function testListEvents()
{
$obj = new Events();
$events = $obj->list(true);
$events = $obj->getAll();
// $this->assertIsArray($events);
$this->assertNotEmpty($events);
}
Expand Down