This solution's metrics -- irrelevant, it's JavaScript. Strictly JSLint-ed though :)
XIAG is running the first Code Beauty Contest to encourage a good coding style.
- A participant must have a GitHub account
- Forking this repository declares the contest participation
- Your code must pass
./acceptance_test.php
; please replace thedoTest()
function to invoke your own implementation - Test coverage is calculated by PHPUnit; the tests must reside in
./test
- The solutions' beauty is rated based on an open voting, and on the formal metrics provided by Scrutinizer -- the participants have to enable their repositories at scrutinizer-ci, and update the metrics links in this document
- Any GitHub users can vote by starring the participant's repository
vagrant up && vagrant ssh
composer install --dev
./acceptance_test.php
./vendor/bin/phpunit
Implement a rows list pagination navigator
$offset
index of the first displayed row$total
total amount of rows in the list$rowsPerPage
maximum page size$maxNavigatorSize
how many page numbers the navigator should display
A string of text with page numbers, where the current page is wrapped into square brackets:
3 4 [5] 6 7
After the problem is solved, the participant makes a pull request. The solutions are accessible for voting in the pull requests list.