Repository: symplify/symplify (php)

Issue:
[Easy-CI] check-conflicts regex will miss some conflicts
The check-conflicts command uses a regex to check for merge conflicts in your code.
It has a regex for 8 `<` characters:

https://github.com/symplify/easy-ci/blob/d08571ff4083f766ab2d376ccd4e4df2c2514a69/src/Git/ConflictResolver.php#L13-L17

However, when using using Atlassian SourceTree, a merge conflict is produced as follows: [(atlassian documentation)](https://www.atlassian.com/git/tutorials/using-branches/merge-conflicts)

```
<<<<<<< HEAD
this is some content to mess with
content to append
=======
totally different content to merge later
>>>>>>> new_branch_to_merge_later
```

This produces a a string of 7 `<` characters and will fail to be spotted by the check-conflicts command.

I'm not familiar if this is a particular git implementation or a general typo, but a Github also produces a 7 `<`'s [(github documentation)](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line)



Pull request description:
[Easy-CI] check-conflicts regex update
Updates the regex to seven characters, so it will trigger on git conflicts.

Closes #4498 

Patch:
diff --git a/packages/easy-ci/src/Git/ConflictResolver.php b/packages/easy-ci/src/Git/ConflictResolver.php
index 8b790ecfd..f4f598a16 100644
--- a/packages/easy-ci/src/Git/ConflictResolver.php
+++ b/packages/easy-ci/src/Git/ConflictResolver.php
@@ -13,10 +13,10 @@ use Symplify\SmartFileSystem\SmartFileInfo;
 final class ConflictResolver
 {
     /**
-     * @see https://regex101.com/r/iYPxCV/1
+     * @see https://regex101.com/r/iYPxCV/2
      * @var string
      */
-    private const CONFLICT_REGEX = '#^<<<<<<<<#';
+    private const CONFLICT_REGEX = '#^<<<<<<<#';
 
     public function extractFromFileInfo(SmartFileInfo $fileInfo): int
     {


Test patch:
diff --git a/packages/easy-ci/tests/Git/ConflictResolver/ConflictResolverTest.php b/packages/easy-ci/tests/Git/ConflictResolver/ConflictResolverTest.php
index ac4563801..3fa076a02 100644
--- a/packages/easy-ci/tests/Git/ConflictResolver/ConflictResolverTest.php
+++ b/packages/easy-ci/tests/Git/ConflictResolver/ConflictResolverTest.php
@@ -35,6 +35,7 @@ final class ConflictResolverTest extends AbstractKernelTestCase
     public function provideData(): Iterator
     {
         yield [new SmartFileInfo(__DIR__ . '/Fixture/some_file.txt'), 1];
+        yield [new SmartFileInfo(__DIR__ . '/Fixture/some_other_file.txt'), 1];
         yield [new SmartFileInfo(__DIR__ . '/Fixture/correct_file.txt'), 0];
     }
 }
diff --git a/packages/easy-ci/tests/Git/ConflictResolver/Fixture/some_other_file.txt b/packages/easy-ci/tests/Git/ConflictResolver/Fixture/some_other_file.txt
new file mode 100644
index 000000000..7cbb8c657
--- /dev/null
+++ b/packages/easy-ci/tests/Git/ConflictResolver/Fixture/some_other_file.txt
@@ -0,0 +1,6 @@
+<<<<<<< HEAD
+this is some content to mess with
+content to append
+=======
+totally different content to merge later
+>>>>>>> new_branch_to_merge_later