Skip to content
Snippets Groups Projects

Fixed the issues reported by phpcs

1 file
+ 15
7
Compare changes
  • Side-by-side
  • Inline
<?php
// Iterate through all Drutopia modules and others specified clumsily by regex.
// Replace https://git.drupalcode.org/project/drutopia_dev.git
// with: git@git.drupal.org:project/drutopia_dev.git
/**
* @file
* Iterate through all Drutopia modules and others specified clumsily by regex.
*/
// Replace https://git.drupalcode.org/project/drutopia_dev.git
// with: git@git.drupal.org:project/drutopia_dev.git.
$dir_pattern = '|^drutopia.*$|';
$replacements = [
'|(\[remote "origin"\]\n\surl = )(https://git.drupalcode.org/)|sm' => '${1}git@git.drupal.org:',
@@ -15,9 +18,14 @@ foreach ($dir as $item) {
if ($item->isDir() && (preg_match($dir_pattern, $fname) === 1)) {
$path = $item->getPath() . '/' . $fname . '/.git/config';
$content = file_get_contents($path);
// print(preg_replace(array_keys($replacements), array_values($replacements), $content, 1));
file_put_contents($path, preg_replace(array_keys($replacements), array_values($replacements), $content, 1));
file_put_contents(
$path,
preg_replace(
array_keys($replacements),
array_values($replacements),
$content,
1,
)
);
}
}
Loading