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

Singularise plurals #4

Merged
merged 10 commits into from
Aug 1, 2023
Merged

Conversation

andrewnicols
Copy link
Contributor

The convention in Moodle, Symfony, and pretty much everywhere really, is to use singular names for tables because each row is an instance of that thing and makes your code more meaningful to read, for example:

Is this person a users or user?

$user = new Users();

compare with:

$user = new User();

You also have a UserRepository rather than a UsersRepository because it contains a collection of user objects.

This very simple change just renames all tables to be in the singular.

It is built on top of #3.

@andrewnicols
Copy link
Contributor Author

Complete runs for phpunit and behat against master:

➜  sm git:(master) git log -1
commit e77452220b268f70612b9b915179c17fc6d93173 (HEAD -> master, public/master, origin/master, integration/master)
Author: Ilya Tregubov <ilya@moodle.com>
Date:   Fri Jul 14 09:25:31 2023 +0800

    weekly release 4.3dev
➜  sm git:(master) ./vendor/bin/phpunit --testsuite core_communication_testsuite,communication_matrix_testsuite
Moodle 4.3dev (Build: 20230714), e77452220b268f70612b9b915179c17fc6d93173
Php: 8.1.15, pgsql: 14.8 (Homebrew), OS: Darwin 22.3.0 arm64
PHPUnit 9.5.27 by Sebastian Bergmann and contributors.

............................................................      60 / 60 (100%)

Time: 00:44.033, Memory: 88.50 MB

OK (60 tests, 179 assertions)
➜  sm git:(master) vendor/bin/behat --profile=headlesschrome --format="moodle_progress" --out="std" --format="progress" --out="/Users/nicols/Sites/moodles/sm/extra/behat/progress.txt" --format="pretty" --out="/Users/nicols/Sites/moodles/sm/extra/behat/pretty.txt" --config=/Users/nicols/Sites/moodles/sm/moodledata_behat/behatrun/behat/behat.yml --tags core_communication,communication_matrix
Differences detected between cli and webserver...
 phpversion:
 - web server: 8.0.28
 - cli: 8.1.15
Moodle 4.3dev (Build: 20230714), e77452220b268f70612b9b915179c17fc6d93173
Php: 8.1.15, pgsql: 14.8 (Homebrew), OS: Darwin 22.3.0 arm64
Run optional tests:
- Accessibility: Yes
Server OS "Darwin", Browser: "chrome"
Started at 19-07-2023, 09:54
...................................................................... 70
.......................................

8 scenarios (8 passed)
109 steps (109 passed)
1m11.55s (65.85Mb)

@andrewnicols andrewnicols merged commit e556abf into moodlehq:main Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant