File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515use Mistralys \VersionParser \Parser \NumberDetector ;
1616use Mistralys \VersionParser \Parser \ShortTags ;
1717use Mistralys \VersionParser \Parser \TagWeights ;
18+ use Stringable ;
1819
1920/**
2021 * Version number parsing utility: parses version numbers,
4748 * @package VersionParser
4849 * @author Sebastian Mordziol <s.mordziol@mistralys.eu>
4950 */
50- class VersionParser
51+ class VersionParser implements Stringable
5152{
5253 public const TAG_TYPE_NONE = 'none ' ;
5354 public const TAG_TYPE_BETA = 'beta ' ;
@@ -520,4 +521,9 @@ public function getSeparatorChar() : string
520521 {
521522 return $ this ->separator ;
522523 }
524+
525+ public function __toString () : string
526+ {
527+ return $ this ->getTagVersion ();
528+ }
523529}
Original file line number Diff line number Diff line change 66
77use Mistralys \VersionParser \Parser \ShortTags ;
88use Mistralys \VersionParser \Parser \TagWeights ;
9+ use Stringable ;
910
10- class VersionTag
11+ class VersionTag implements Stringable
1112{
1213 private string $ tagName ;
1314 private int $ number ;
@@ -168,4 +169,9 @@ public function toArray() : array
168169 'normalized ' => $ this ->getNormalized ()
169170 );
170171 }
172+
173+ public function __toString () : string
174+ {
175+ return $ this ->getNormalized ();
176+ }
171177}
You can’t perform that action at this time.
0 commit comments