Skip to content

Commit

Permalink
Merge pull request #115 from ec-europa/feature/DQA-6658
Browse files Browse the repository at this point in the history
DQA-6658: 8.x QA automation CredentialsSniff regression
  • Loading branch information
joaocsilva authored Apr 4, 2023
2 parents 80ae763 + efdcddb commit 3fa27df
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions phpcs/QualityAssurance/Sniffs/Generic/CredentialsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,24 @@ public function register()
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
*
* @return void
* @return int
*/
public function process(File $phpcsFile, $stackPtr)
{
$end = (count($phpcsFile->getTokens()) + 1);
$filePath = $phpcsFile->getFilename();
$fileName = basename($filePath);

if (preg_match('/docker-compose*/', strtolower($fileName)) === false) {
if (preg_match('/^docker-compose*/i', $fileName) !== 1) {
return $end;
}

$fileContent = file($filePath);
$checkEnvVars = [
'asda_user',
'asda_pass',
'asda_password',
'nextcloud_user',
'nextcloud_pass',
'api_token',
];
try {
Expand Down

0 comments on commit 3fa27df

Please sign in to comment.