Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialDipika Purohit
Courses Plus Student 20,955 PointsAdd an abstract method named "roster" that accepts 2 optional parameters.
Add an abstract method named "roster" that accepts 2 optional parameters.
<?php
interface Students extends Countable
{}
2 Answers
Daniel Marin
8,021 PointsHi, So abstract methods don't contain a body and optional params means these params already have a value defined in the method. So something like this:
<?php
interface Students extends Countable {
public function roster($foo = null, $bar = null);
}
Charles Fields
4,205 PointsI'm thinking the same as Daniel, but get this odd message that I should capitalize the "Students" interface. It's already capitalized and that part was already accepted in task 1 of the challenge. Here is my code. Does anyone understand what is meant by this error? <?php interface Students extends Countable { public function roster($class = null, $student = null); }
Charles Fields
4,205 PointsBtw, how are people posting workspaces to this discussion? My code formatting went away when I posted the question above.
Dipika Purohit
Courses Plus Student 20,955 PointsDipika Purohit
Courses Plus Student 20,955 Pointsthanx again Daniel Marin :)