From 9b12fd301b6a38442929eb37c6b10e02ca4a0693 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Sat, 28 Sep 2019 10:26:18 +0200 Subject: [PATCH 1/3] Documentation fixups --- CHANGELOG.md | 2 +- dist/readme.md | 4 ++-- src/Readers/Swar4.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a6935a..7e61d30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## vx.y.z (Release: aa-bbb-cccc) ## v1.2 (Release: 28-sep-2019) -* NEW READER: `Reader::swar-4` for reading out files created with Swar version 4. +* NEW READER: `Reader::swar-4` for reading out files created with SWAR version 4. * NEW FEATURE: `Tournament::getArbiters()` for multiple arbiters in 1 tournament * ENHANCEMENT: `Class::getBinaryData()` methods return null if field is non-existent * ENHANCEMENT: The template in distributions provides a more usable starting implementation diff --git a/dist/readme.md b/dist/readme.md index 1f56c27..6309eea 100644 --- a/dist/readme.md +++ b/dist/readme.md @@ -5,9 +5,9 @@ This distribution is a good start to use libpairtwo if you don't have knowledge How to use this distribution? ----------------------------- The file `template.php` is the one you'll probably want to work with. You'll want to point your browser to this file. It contains some initializations where the most important one is the variable `$pairingfile`. You'll want to set this to existing pairing file. -The other variable (`$pairingfileformat`) is a variable that defines the format of the above pairing file. For now only `Pairtwo-6` and `Pairtwo-5` are available. In the future more formats will become available. +The other variable (`$pairingfileformat`) is a variable that defines the format of the above pairing file. For now only `Pairtwo-6`, `Pairtwo-5` and `Swar-4` are available. In the future more formats will become available. -Below the comments you'll find some example code. This code is only a aggregation of several fields that are read out. If you need any modifications like putting the rankings in a table or you want to just write it to a file, go ahead it's all yours. +Below the comments you'll find some example code. The example codes gives the pairings and rankings of the currently used pairing file. If you need any modifications like adding your own template or you want to just write it to a file: go ahead it's all yours. How to update the library? -------------------------- diff --git a/src/Readers/Swar4.php b/src/Readers/Swar4.php index fd015db..899abc7 100644 --- a/src/Readers/Swar4.php +++ b/src/Readers/Swar4.php @@ -1,6 +1,6 @@ Date: Sat, 28 Sep 2019 10:28:33 +0200 Subject: [PATCH 2/3] DateTime instead \DateTime --- src/Readers/Swar4.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Readers/Swar4.php b/src/Readers/Swar4.php index 899abc7..d61e9a8 100644 --- a/src/Readers/Swar4.php +++ b/src/Readers/Swar4.php @@ -613,7 +613,7 @@ class Swar4 implements ReaderInterface * @param string $string * @return DateTime */ - public function convertStringToDate(string $string): \DateTime + public function convertStringToDate(string $string): DateTime { if (strlen($string) == 10) { return DateTime::createFromFormat('d/m/Y', $string); From 2bffc0c2933cc55c94205e4a81a1c54359c0db61 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Sat, 28 Sep 2019 10:33:59 +0200 Subject: [PATCH 3/3] Ordered use in classes --- src/Game.php | 3 +-- src/Player.php | 2 +- src/Readers/Pairtwo6.php | 14 +++++++------- src/Readers/Swar4.php | 8 ++++---- src/Round.php | 2 -- src/Tournament.php | 6 +++--- 6 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/Game.php b/src/Game.php index a6d75ef..34655b2 100644 --- a/src/Game.php +++ b/src/Game.php @@ -12,10 +12,9 @@ namespace JeroenED\Libpairtwo; -use DateTime; use JeroenED\Libpairtwo\Enums\Gameresult; -use JeroenED\Libpairtwo\Models\Round; use JeroenED\Libpairtwo\Pairing; +use DateTime; /** * Class Games diff --git a/src/Player.php b/src/Player.php index 9876f21..80f4cbb 100644 --- a/src/Player.php +++ b/src/Player.php @@ -12,8 +12,8 @@ namespace JeroenED\Libpairtwo; -use JeroenED\Libpairtwo\Enums\Title; use JeroenED\Libpairtwo\Enums\Gender; +use JeroenED\Libpairtwo\Enums\Title; use DateTime; /** diff --git a/src/Readers/Pairtwo6.php b/src/Readers/Pairtwo6.php index 1455d96..0055b21 100644 --- a/src/Readers/Pairtwo6.php +++ b/src/Readers/Pairtwo6.php @@ -13,18 +13,18 @@ namespace JeroenED\Libpairtwo\Readers; +use JeroenED\Libpairtwo\Enums\Color; +use JeroenED\Libpairtwo\Enums\Gender; +use JeroenED\Libpairtwo\Enums\Result; use JeroenED\Libpairtwo\Enums\Tiebreak; use JeroenED\Libpairtwo\Enums\Title; -use JeroenED\Libpairtwo\Enums\Gender; -use JeroenED\Libpairtwo\Enums\Color; -use JeroenED\Libpairtwo\Enums\Result; +use JeroenED\Libpairtwo\Enums\TournamentSystem; use JeroenED\Libpairtwo\Exceptions\IncompatibleReaderException; -use JeroenED\Libpairtwo\Tournament; +use JeroenED\Libpairtwo\Interfaces\ReaderInterface; +use JeroenED\Libpairtwo\Pairing; use JeroenED\Libpairtwo\Player; use JeroenED\Libpairtwo\Round; -use JeroenED\Libpairtwo\Pairing; -use JeroenED\Libpairtwo\Interfaces\ReaderInterface; -use JeroenED\Libpairtwo\Enums\TournamentSystem; +use JeroenED\Libpairtwo\Tournament; use DateTime; /** diff --git a/src/Readers/Swar4.php b/src/Readers/Swar4.php index d61e9a8..8ad9e54 100644 --- a/src/Readers/Swar4.php +++ b/src/Readers/Swar4.php @@ -13,9 +13,11 @@ namespace JeroenED\Libpairtwo\Readers; -use DateTime; use JeroenED\Libpairtwo\Enums\Color; +use JeroenED\Libpairtwo\Enums\Gender; +use JeroenED\Libpairtwo\Enums\Result; use JeroenED\Libpairtwo\Enums\Tiebreak; +use JeroenED\Libpairtwo\Enums\Title; use JeroenED\Libpairtwo\Enums\TournamentSystem; use JeroenED\Libpairtwo\Exceptions\IncompatibleReaderException; use JeroenED\Libpairtwo\Interfaces\ReaderInterface; @@ -23,9 +25,7 @@ use JeroenED\Libpairtwo\Pairing; use JeroenED\Libpairtwo\Player; use JeroenED\Libpairtwo\Round; use JeroenED\Libpairtwo\Tournament; -use JeroenED\Libpairtwo\Enums\Gender; -use JeroenED\Libpairtwo\Enums\Title; -use JeroenED\Libpairtwo\Enums\Result; +use DateTime; /** * Class Swar4 diff --git a/src/Round.php b/src/Round.php index e7ef644..cc2aa99 100644 --- a/src/Round.php +++ b/src/Round.php @@ -14,8 +14,6 @@ namespace JeroenED\Libpairtwo; use DateTime; use JeroenED\Libpairtwo\Enums\Result; -use JeroenED\Libpairtwo\Game; -use JeroenED\Libpairtwo\Pairing; /** * Class Round diff --git a/src/Tournament.php b/src/Tournament.php index f5b53be..0a3d8f5 100644 --- a/src/Tournament.php +++ b/src/Tournament.php @@ -12,11 +12,11 @@ namespace JeroenED\Libpairtwo; +use JeroenED\Libpairtwo\Enums\Color; +use JeroenED\Libpairtwo\Enums\Tiebreak; +use JeroenED\Libpairtwo\Enums\TournamentSystem; use Closure; use DateTime; -use JeroenED\Libpairtwo\Enums\Tiebreak; -use JeroenED\Libpairtwo\Enums\Color; -use JeroenED\Libpairtwo\Enums\TournamentSystem; /** * Class Tournament