Skip to content

#977 Sync word-count#981

Merged
mk-mxp merged 17 commits into
exercism:mainfrom
Hazeolation:main
Jun 2, 2026
Merged

#977 Sync word-count#981
mk-mxp merged 17 commits into
exercism:mainfrom
Hazeolation:main

Conversation

@Hazeolation
Copy link
Copy Markdown
Contributor

  • Synced word-count metadata and docs
  • Added missing tests
  • Added UUID and TestDox to tests
  • Reordered tests to match order in tests.toml
  • Added GitHub handle to config.json
  • Added word-count to auto-sync.txt
  • Removed strict types comments from example.php and WordCountTest.php

Ref: #977

@github-actions
Copy link
Copy Markdown

This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested.

If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos.

[no important files changed]

For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping @exercism/maintainers-admin in a comment. Thank you!

@mk-mxp
Copy link
Copy Markdown
Contributor

mk-mxp commented May 27, 2026

Thanks for helping! And welcome to the PHP track. I'll look through this at the weekend, I currently have no time left.

@mk-mxp mk-mxp mentioned this pull request May 27, 2026
6 tasks
@Hazeolation
Copy link
Copy Markdown
Contributor Author

Unfortunately I'm a bit busy with private projects, so I can't really continue with this right now

@mk-mxp mk-mxp self-requested a review May 31, 2026 08:36
Copy link
Copy Markdown
Contributor

@mk-mxp mk-mxp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your work! You are invited to continue when your time allows. We are all volunteers here, and this will stay for at least 4 weeks for you to continue.

In addition to the fixes listed below, I'd like to have all tests formatted to fit a smaller code view better. In the online editor, the tests are shown in a small column ~62 chars wide. So I think we should use more lines like so:

        $this->assertEquals(
            ['word' => 1],
            wordCount('word'),
        );

And when the expected array becomes to long, please spread it over multiple lines like this:

        $this->assertEquals(
            [
                'one' => 1,
                'fish' => 4,
                'two' => 1,
                'red' => 1,
                'blue' => 1,
            ],
            wordCount('one fish two fish red fish blue fish'),
        );

Please add the trailing comma after the wordCount() calls and the last array items, too, when you use multiple lines.

Again, thanks a lot for your contribution. I'm looking forward for your changes!

Comment thread exercises/practice/word-count/WordCountTest.php Outdated
Comment thread exercises/practice/word-count/WordCountTest.php Outdated
Comment thread exercises/practice/word-count/WordCountTest.php Outdated
Comment thread exercises/practice/word-count/WordCountTest.php Outdated
Comment thread exercises/practice/word-count/WordCountTest.php Outdated
Comment thread exercises/practice/word-count/WordCountTest.php Outdated
Comment thread exercises/practice/word-count/WordCountTest.php Outdated
Comment thread exercises/practice/word-count/WordCountTest.php Outdated
Comment thread exercises/practice/word-count/WordCountTest.php Outdated
@mk-mxp mk-mxp added x:action/sync Sync content with its latest version x:knowledge/elementary Little Exercism knowledge required x:module/practice-exercise Work on Practice Exercises x:type/content Work on content (e.g. exercises, concepts) x:size/small Small amount of work x:rep/small Small amount of reputation labels May 31, 2026
Hazeolation and others added 9 commits June 1, 2026 08:41
Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com>
Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com>
Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com>
Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com>
Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com>
Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com>
Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com>
Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com>
Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com>
@Hazeolation Hazeolation requested a review from mk-mxp June 1, 2026 06:47
Copy link
Copy Markdown
Contributor

@mk-mxp mk-mxp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! That looks great now.

@mk-mxp
Copy link
Copy Markdown
Contributor

mk-mxp commented Jun 1, 2026

Hmm, single quotes and apostrophes make a lot of trouble now. Let me get into it...

Comment thread exercises/practice/word-count/.meta/example.php Outdated
@mk-mxp mk-mxp added x:size/medium Medium amount of work x:rep/medium Medium amount of reputation and removed x:size/small Small amount of work x:rep/small Small amount of reputation labels Jun 1, 2026
@mk-mxp
Copy link
Copy Markdown
Contributor

mk-mxp commented Jun 1, 2026

For the record: 428 students have solved the exercise so far. I think adding single quotes and apostrophes is worth breaking them.

@Hazeolation Hazeolation requested a review from mk-mxp June 1, 2026 16:55
@mk-mxp
Copy link
Copy Markdown
Contributor

mk-mxp commented Jun 1, 2026

You can run the tests locally, to see if they will pass CI. The README has instructions. There need to be more Regular Expressions to replace occurances of single quotes, but keep the apostrophes.

The failures are here: https://github.com/exercism/php/actions/runs/26769201971/job/78905441267?pr=981#step:6:1171

Copy link
Copy Markdown
Contributor

@mk-mxp mk-mxp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for making this happen!

@mk-mxp mk-mxp merged commit 1341469 into exercism:main Jun 2, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

x:action/sync Sync content with its latest version x:knowledge/elementary Little Exercism knowledge required x:module/practice-exercise Work on Practice Exercises x:rep/medium Medium amount of reputation x:size/medium Medium amount of work x:type/content Work on content (e.g. exercises, concepts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants