Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into implement-laravel…
Browse files Browse the repository at this point in the history
…-coding-standards

* upstream/master:
  Add Magento projects to project type mapping (#66)
  • Loading branch information
Arjen Miedema committed Mar 26, 2021
2 parents ffa46e3 + 7ac0b41 commit e8a7401
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Depending on the composer type of the project an other standard will be used:

- `magento-module`: [MediaCT Coding Standard Magento1](https://github.com/mediact/coding-standard-magento1)
- `magento2-module`: [MediaCT Coding Standard Magento2](https://github.com/mediact/coding-standard-magento2)
- `magento-project`: [MediaCT Coding Standard Magento1](https://github.com/mediact/coding-standard-magento1)
- `magento2-project`: [MediaCT Coding Standard Magento2](https://github.com/mediact/coding-standard-magento2)

### Overriding the type

Expand Down
3 changes: 3 additions & 0 deletions src/ProjectTypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class ProjectTypeResolver
private $mapping = [
'magento2-module' => 'magento2',
'magento-module' => 'magento1',
'magento2-project' => 'magento2',
'magento-project' => 'magento2',
'alumio-project' => 'alumio',
];

Expand All @@ -54,6 +56,7 @@ public function __construct(Composer $composer, array $mapping = null)
public function resolve(): string
{
$config = $this->composer->getConfig();

if ($config->has(static::COMPOSER_CONFIG_KEY)) {
$configNode = $config->get(static::COMPOSER_CONFIG_KEY);
if (isset($configNode[static::COMPOSER_CONFIG_TYPE_KEY])) {
Expand Down

0 comments on commit e8a7401

Please sign in to comment.