Skip to content

Commit

Permalink
Prevent exception when require and/or require-dev is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
jissereitsma committed Aug 29, 2024
1 parent 9438b2f commit 1c4fbeb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

# [2.4.4] = 29 August 2024
### Fixed
- Prevent exception when require and/or require-dev is empty

# [2.4.3] = 23 August 2024
### Fixed
- Fixes for dev requirements
Expand Down
14 changes: 10 additions & 4 deletions Composer/ComposerFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,18 @@ public function getName(): string

/**
* @return array
* @throws NotFoundException
* @throws RuntimeException
*/
public function getRequirements(): array
{
// @todo: Merge this with require-dev?
return array_merge($this->get('require'), $this->get('require-dev'));
$requirements = [];
try {
$requirements = array_merge($requirements, $this->get('require'));
} catch (RuntimeException) {}

try {
$requirements = array_merge($requirements, $this->get('require-dev'));
} catch (RuntimeException) {}

return $requirements;
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "yireo/magento2-extensionchecker",
"license": "OSL-3.0",
"type": "magento2-module",
"version": "2.4.3",
"version": "2.4.4",
"homepage": "https://github.com/yireo/Yireo_ExtensionChecker",
"description": "Scan the code of a Magento module",
"keywords": [
Expand Down

0 comments on commit 1c4fbeb

Please sign in to comment.