aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/App/AppStore/Version/VersionParser.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/App/AppStore/Version/VersionParser.php')
-rw-r--r--lib/private/App/AppStore/Version/VersionParser.php30
1 files changed, 6 insertions, 24 deletions
diff --git a/lib/private/App/AppStore/Version/VersionParser.php b/lib/private/App/AppStore/Version/VersionParser.php
index 6a369b1cb6e..8976f28837f 100644
--- a/lib/private/App/AppStore/Version/VersionParser.php
+++ b/lib/private/App/AppStore/Version/VersionParser.php
@@ -1,26 +1,8 @@
<?php
+
/**
- * @copyright Copyright (c) 2016 Lukas Reschke <lukas@statuscode.ch>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Lukas Reschke <lukas@statuscode.ch>
- * @author Morris Jobke <hey@morrisjobke.de>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OC\App\AppStore\Version;
@@ -54,9 +36,9 @@ class VersionParser {
// Count the amount of =, if it is one then it's either maximum or minimum
// version. If it is two then it is maximum and minimum.
$versionElements = explode(' ', $versionSpec);
- $firstVersion = isset($versionElements[0]) ? $versionElements[0] : '';
+ $firstVersion = $versionElements[0] ?? '';
$firstVersionNumber = substr($firstVersion, 2);
- $secondVersion = isset($versionElements[1]) ? $versionElements[1] : '';
+ $secondVersion = $versionElements[1] ?? '';
$secondVersionNumber = substr($secondVersion, 2);
switch (count($versionElements)) {
@@ -64,7 +46,7 @@ class VersionParser {
if (!$this->isValidVersionString($firstVersionNumber)) {
break;
}
- if (strpos($firstVersion, '>') === 0) {
+ if (str_starts_with($firstVersion, '>')) {
return new Version($firstVersionNumber, '');
}
return new Version('', $firstVersionNumber);