summaryrefslogtreecommitdiffstats
path: root/lib/private/App/AppStore/Version/VersionParser.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-01-25 22:26:47 +0100
committerMorris Jobke <hey@morrisjobke.de>2018-01-26 13:38:34 +0100
commit9ff51aafc518460e6c45996f09e9fe74e5f8d2e8 (patch)
tree7aa302bf04530f0add196f6bcd6e8636333e6be0 /lib/private/App/AppStore/Version/VersionParser.php
parentb9bbb894f8b01e000bb5e3a8a82db7bebad3ea00 (diff)
downloadnextcloud-server-9ff51aafc518460e6c45996f09e9fe74e5f8d2e8.tar.gz
nextcloud-server-9ff51aafc518460e6c45996f09e9fe74e5f8d2e8.zip
Use index based string access for substr with length of 1
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/App/AppStore/Version/VersionParser.php')
-rw-r--r--lib/private/App/AppStore/Version/VersionParser.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/private/App/AppStore/Version/VersionParser.php b/lib/private/App/AppStore/Version/VersionParser.php
index 3924b8aea16..cdbb62ffbc5 100644
--- a/lib/private/App/AppStore/Version/VersionParser.php
+++ b/lib/private/App/AppStore/Version/VersionParser.php
@@ -63,11 +63,10 @@ class VersionParser {
if(!$this->isValidVersionString($firstVersionNumber)) {
break;
}
- if(substr($firstVersion, 0, 1) === '>') {
+ if(strpos($firstVersion, '>') === 0) {
return new Version($firstVersionNumber, '');
- } else {
- return new Version('', $firstVersionNumber);
}
+ return new Version('', $firstVersionNumber);
case 2:
if(!$this->isValidVersionString($firstVersionNumber) || !$this->isValidVersionString($secondVersionNumber)) {
break;