Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify instructions on city office #601

Merged
merged 3 commits into from Jan 20, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 13 additions & 12 deletions exercises/concept/city-office/.docs/instructions.md
Expand Up @@ -2,31 +2,32 @@

You have been working in the city office for a while, and you have developed a set of tools that speed up your day-to-day work, for example with filling out forms.

Now, a new colleague is joining you, and you realized your tools might not be self-explanatory. There are a lot of weird conventions in your office, like always filling out forms with uppercase letters and avoiding leaving fields empty.
Now, a new colleague is joining you, and you realized your tools might not be self-explanatory.
There are a lot of weird conventions in your office, like always filling out forms with uppercase letters and avoiding leaving fields empty.

You decide to write some documentation so that it's easier for your new colleague to hop right in and start using your tools.
As a first step you decide to add PHP type declarations so that it is easier for your new colleague to hop right in and start using your tools.

## 1. Document the types for the Address class
## 1. Declare the types for the Address class

Add property types to each of the `Address` class properties declared.
Add property type declarations to each of the `Address` class properties declared.
Each class property should be declared as a string.

## 2. Document the types to fill out the form with blank values
## 2. Declare the types to fill out the form with blank values

Add a parameter type and a return type to the `blanks` method in the `Form` class.
Add a parameter type declaration and a return type declaration to the `blanks` method in the `Form` class.
The method should take in an integer length, and return a string representation of the blank line.

## 3. Document the type when splitting a value into separate letters
## 3. Declare the type when splitting a value into separate letters

Add a parameter type and a return type to the `letters` method in the `Form` class.
Add a parameter type declaration and a return type declaration to the `letters` method in the `Form` class.
The method should take in a string, representing words, and return an array of letters.

## 4. Document the type when checking if a value will fit into a form
## 4. Declare the type when checking if a value will fit into a form

Add parameter types and a return type to the `checkLength` method in the `Form` class.
Add parameter type declarations and a return type declaration to the `checkLength` method in the `Form` class.
The method should take in a string word, and an integer maximum length, and return a true or false value.

## 5. Document the type when formatting an address in the form
## 5. Declare the type when formatting an address in the form

Add a parameter type, making use of the `Address` class updated previously, and a return type to the `formatAddress` method in the `Form` class.
Add a parameter type declaration, making use of the `Address` class updated previously, and a return type declaration to the `formatAddress` method in the `Form` class.
The method should take in an `Address` and return a formatted string.
1 change: 1 addition & 0 deletions exercises/concept/city-office/.meta/design.md
Expand Up @@ -2,6 +2,7 @@

This exercise should provide a boilerplate with already implemented functions that only need a type declaration.
The functions should be simple so that the exercise can appear early in the concept tree.
The instructions should clearly express that it is all about native PHP type declarations, not comments (PHPDoc or phpstan/psalm types).

## Learning objectives

Expand Down