Skip to content

Commit

Permalink
chnaged homepage content - fixed up assigning to array in pastEvents …
Browse files Browse the repository at this point in the history
…, doc blocks, removed travis deploy
  • Loading branch information
Shaun Hare committed Dec 22, 2015
1 parent 25f645e commit 1e0fb63
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
8 changes: 1 addition & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,4 @@ language: php
php: '7.0'
install: composer install
script: phpunit --configuration tests/phpunit/phpunit.xml
addons:
ssh_known_hosts:phpminds.org
deploy:
provider: script
script: scripts/deploy.sh
on:
branch: develop

4 changes: 4 additions & 0 deletions app/src/Service/EventsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ public function getLatestEvent()
return $this->meetupService->getLatestEvent();
}

/**
* Get all events except for latest.
* @return array
*/
public function getPastEvents()
{
return $this->meetupService->getPastEvents();
Expand Down
8 changes: 6 additions & 2 deletions app/src/Service/MeetupService.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ public function getLatestEvent()
return $this->meetupEvent->formatResponse($events['results'][0] ?? []);
}

/**
* get all events apart form last one in array
* @return array
*/
public function getPastEvents()
{
$pastEvents = [];
Expand All @@ -74,9 +78,9 @@ public function getPastEvents()
array_shift($events["results"]);

foreach($events["results"] as $event){
array_push($pastEvents,$this->meetupEvent->formatResponse($event));
$pastEvents[] = $this->meetupEvent->formatResponse($event);

};
}
return $pastEvents ?? [];
}
/**
Expand Down
6 changes: 1 addition & 5 deletions app/templates/content/past-events.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
Now our first event has finally happened, thanks to all those that came, we can publish
information about previous events. Other details to follow.

**In December 2015 we had Rob Allen speak on Building an API with Slim 3.**

Please leave your feedback on joind.in at https://joind.in/16610
information about previous events.
2 changes: 1 addition & 1 deletion app/templates/home.twig
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

<ul>
{% for previousEvent in previousEvents %}
<li>{{ previousEvent.subject|e }}</li>
<li>{{ previousEvent.subject|e }} on {{ previousEvent.date }}</li>
{% endfor %}
</ul>

Expand Down

0 comments on commit 1e0fb63

Please sign in to comment.