Skip to content

Commit

Permalink
Merge pull request #136 from Xerkus/feature/keep-qa-tools
Browse files Browse the repository at this point in the history
Keep QA tools after installer is done
  • Loading branch information
Xerkus committed Jan 10, 2024
2 parents 2cecef9 + 7bd2ac1 commit 490b657
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 32 deletions.
3 changes: 0 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@
/.github/ export-ignore
/.laminas-ci.json export-ignore
/composer.lock export-ignore
/phpcs.xml.dist export-ignore
/psalm.xml.dist export-ignore
/psalm-baseline.xml export-ignore
/renovate.json export-ignore
22 changes: 0 additions & 22 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.18.0@b113f3ed0259fd6e212d87c3df80eec95a6abf19">
<file src="config/pipeline.php">
<UnusedClosureParam>
<code>$container</code>
<code>$factory</code>
</UnusedClosureParam>
</file>
<file src="public/index.php">
<MissingFile>
<code><![CDATA[require 'config/container.php']]></code>
<code><![CDATA[require 'config/routes.php']]></code>
</MissingFile>
<MixedArgument>
<code>$factory</code>
</MixedArgument>
<MixedAssignment>
<code>$factory</code>
</MixedAssignment>
<PossiblyUndefinedArrayOffset>
<code><![CDATA[$_SERVER['SCRIPT_FILENAME']]]></code>
</PossiblyUndefinedArrayOffset>
</file>
<file src="src/MezzioInstaller/OptionalPackages.php">
<ArgumentTypeCoercion>
<code><![CDATA[$this->stabilityFlags]]></code>
Expand Down Expand Up @@ -84,7 +63,6 @@
</PossiblyInvalidIterator>
<PossiblyNullArgument>
<code>$content</code>
<code>$phpunitConfig</code>
</PossiblyNullArgument>
<PossiblyUnusedMethod>
<code>install</code>
Expand Down
1 change: 0 additions & 1 deletion psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<projectFiles>
<directory name="src"/>
<directory name="test"/>
<directory name="public"/>
<ignoreFiles>
<directory name="src/MezzioInstaller/Resources"/>
<directory name="vendor"/>
Expand Down
26 changes: 20 additions & 6 deletions src/MezzioInstaller/OptionalPackages.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ class OptionalPackages
'.laminas-ci.json',
'CHANGELOG.md',
'phpcs.xml',
'phpcs.xml.dist',
'psalm.xml.dist',
'psalm-baseline.xml',
'renovate.json',
'src/App/templates/.gitkeep',
];
Expand Down Expand Up @@ -169,9 +166,6 @@ class OptionalPackages
'filp/whoops',
'jsoumelidis/zend-sf-di-config',
'mikey179/vfsstream',
'laminas/laminas-coding-standard',
'vimeo/psalm',
'psalm/plugin-phpunit',
'mezzio/mezzio-fastroute',
'mezzio/mezzio-platesrenderer',
'mezzio/mezzio-twigrenderer',
Expand Down Expand Up @@ -613,6 +607,7 @@ private function cleanUp(): void
$this->recursiveRmdir($this->projectRoot . 'docs');

$this->preparePhpunitConfig();
$this->preparePsalmConfig();
}

/**
Expand All @@ -625,9 +620,28 @@ private function preparePhpunitConfig(): void
$phpunitConfigFile = $this->projectRoot . 'phpunit.xml.dist';
$phpunitConfig = file_get_contents($phpunitConfigFile);
$phpunitConfig = $this->removeLinesContainingStrings(['exclude', 'MezzioInstaller'], $phpunitConfig);
if ($phpunitConfig === null) {
return;
}
file_put_contents($phpunitConfigFile, $phpunitConfig);
}

/**
* Remove the MezzioInstaller exclusion from the psalm configuration
*
* @codeCoverageIgnore
*/
private function preparePsalmConfig(): void
{
$psalmConfigFile = $this->projectRoot . 'psalm.xml.dist';
$psalmConfig = file_get_contents($psalmConfigFile);
$psalmConfig = $this->removeLinesContainingStrings(['MezzioInstaller'], $psalmConfig);
if ($psalmConfig === null) {
return;
}
file_put_contents($psalmConfigFile, $psalmConfig);
}

/**
* Prepare and ask questions and return the answer
*
Expand Down

0 comments on commit 490b657

Please sign in to comment.