diff --git a/administrator/components/com_patchtester/PatchTester/Model/PullModel.php b/administrator/components/com_patchtester/PatchTester/Model/PullModel.php index 6451f3a..14ed671 100644 --- a/administrator/components/com_patchtester/PatchTester/Model/PullModel.php +++ b/administrator/components/com_patchtester/PatchTester/Model/PullModel.php @@ -89,7 +89,7 @@ class PullModel extends AbstractModel $params = ComponentHelper::getParams('com_patchtester'); // Decide based on repository settings whether patch will be applied through Github or CIServer - if (version_compare(JVERSION, '4', 'ge') && (bool) $params->get('ci_switch', 1)) + if ((bool) $params->get('ci_switch', 1)) { return $this->applyWithCIServer($id); } @@ -266,7 +266,7 @@ class PullModel extends AbstractModel $this->appendPatchChain($lastInserted, $id); // On Joomla 4 or later, remove the autoloader file - if (version_compare(JVERSION, '4', 'ge') && file_exists(JPATH_LIBRARIES . '/autoload_psr4.php')) + if (file_exists(JPATH_LIBRARIES . '/autoload_psr4.php')) { File::delete(JPATH_LIBRARIES . '/autoload_psr4.php'); } @@ -591,7 +591,7 @@ class PullModel extends AbstractModel $this->saveAppliedPatch($pull->number, $parsedFiles, $pull->head->sha); // On Joomla 4 or later, remove the autoloader file - if (version_compare(JVERSION, '4', 'ge') && file_exists(JPATH_LIBRARIES . '/autoload_psr4.php')) + if (file_exists(JPATH_LIBRARIES . '/autoload_psr4.php')) { File::delete(JPATH_LIBRARIES . '/autoload_psr4.php'); } @@ -689,9 +689,7 @@ class PullModel extends AbstractModel $params = ComponentHelper::getParams('com_patchtester'); // Decide based on repository settings whether patch will be applied through Github or CIServer - if (version_compare(JVERSION, '4', 'ge') && ((bool) $params->get('ci_switch', 1) - || $id === $this->getPatchChain($id)->insert_id) - ) + if (((bool) $params->get('ci_switch', 1) || $id === $this->getPatchChain($id)->insert_id)) { return $this->revertWithCIServer($id); } @@ -832,8 +830,8 @@ class PullModel extends AbstractModel Folder::delete($backupsPath); - // On Joomla 4 or later, remove the autoloader file - if (version_compare(JVERSION, '4', 'ge') && file_exists(JPATH_LIBRARIES . '/autoload_psr4.php')) + // Remove the autoloader file + if (file_exists(JPATH_LIBRARIES . '/autoload_psr4.php')) { File::delete(JPATH_LIBRARIES . '/autoload_psr4.php'); } @@ -1029,8 +1027,8 @@ class PullModel extends AbstractModel } } - // On Joomla 4 or later, remove the autoloader file - if (version_compare(JVERSION, '4', 'ge') && file_exists(JPATH_LIBRARIES . '/autoload_psr4.php')) + // Remove the autoloader file + if (file_exists(JPATH_LIBRARIES . '/autoload_psr4.php')) { File::delete(JPATH_LIBRARIES . '/autoload_psr4.php'); }