-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SDK-4212 Introduced a logic for an empty PR (#240)
* SDK-4212 empty PR * SDK-4212 update steps executor * SDK-4212 update command * SDK-4212 add test * SDK-4212 update functionality * SDK-4212 fix test * SDK-4212 add tests * SDK-4212 add empty PR
- Loading branch information
1 parent
e657080
commit 4c00f86
Showing
13 changed files
with
483 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/Upgrade/Application/Factory/ComposerViolationDtoFactory.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright © 2016-present Spryker Systems GmbH. All rights reserved. | ||
* Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Upgrade\Application\Factory; | ||
|
||
use Upgrade\Application\Dto\PackageManagerResponseDto; | ||
use Upgrade\Application\Dto\ValidatorViolationDto; | ||
|
||
class ComposerViolationDtoFactory | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public const VIOLATION_TITLE = 'Composer issues'; | ||
|
||
/** | ||
* @param \Upgrade\Application\Dto\PackageManagerResponseDto $packageManagerResponseDto | ||
* | ||
* @return \Upgrade\Application\Dto\ValidatorViolationDto | ||
*/ | ||
public function createFromPackageManagerResponse(PackageManagerResponseDto $packageManagerResponseDto): ValidatorViolationDto | ||
{ | ||
$errorMessage = $packageManagerResponseDto->getOutputMessage() ?? 'Module fetcher error'; | ||
preg_match('/(?<error>Problem 1.*)/s', $errorMessage, $matches); | ||
|
||
return new ValidatorViolationDto(static::VIOLATION_TITLE, $matches['error'] ?? $errorMessage); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.