Skip to content

Commit bb9f70b

Browse files
committed
AC-15344:: Add change level to breaking change table report in SVC
1 parent 1d153ff commit bb9f70b

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "magento/magento-semver",
33
"description": "Magento Semantic Version Checker",
4-
"version": "13.0.0-beta8",
4+
"version": "13.0.0-beta9",
55
"license": [
66
"OSL-3.0",
77
"AFL-3.0"

src/Analyzer/ClassMethodAnalyzer.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,10 @@ protected function reportChanged($report, $contextBefore, $contextAfter, $method
259259
$report->add($this->context, $data);
260260
$signatureChanged = true;
261261
} elseif ($signatureChanges['parameter_typing_changed']) {
262-
if ($signatureChanges['parameter_nullable_type_added']
263-
|| $signatureChanges['parameter_nullable_type_removed']) {
262+
if (
263+
$signatureChanges['parameter_nullable_type_added']
264+
|| $signatureChanges['parameter_nullable_type_removed']
265+
) {
264266
$data = new ClassMethodParameterTypingChangedNullable(
265267
$this->context,
266268
$this->fileAfter,
@@ -466,7 +468,8 @@ private function isReturnsEqualByNullability(ClassMethod $before, ClassMethod $a
466468
*/
467469
private function getDocReturnDeclaration(ClassMethod $method)
468470
{
469-
if (($parsedComment = $method->getAttribute('docCommentParsed'))
471+
if (
472+
($parsedComment = $method->getAttribute('docCommentParsed'))
470473
&& isset($parsedComment['return'])
471474
) {
472475
if ($parsedComment['return'][0] instanceof NullableType) {

src/Comparator/Signature.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,13 @@ public static function analyze(array $parametersA, array $parametersB): array
147147
if ($parametersA[$i]->type !== null && $parametersB[$i]->type !== null) {
148148
$changes['parameter_typing_changed'] = true;
149149
// Custom: detect nullable added
150-
if ($typeBefore instanceof \PhpParser\Node\NullableType
150+
if (
151+
$typeBefore instanceof \PhpParser\Node\NullableType
151152
&& !$typeAfter instanceof \PhpParser\Node\NullableType
152153
) {
153154
$changes['parameter_nullable_type_added'] = true;
154-
} elseif (!$typeBefore instanceof \PhpParser\Node\NullableType
155+
} elseif (
156+
!$typeBefore instanceof \PhpParser\Node\NullableType
155157
&& $typeAfter instanceof \PhpParser\Node\NullableType
156158
) {
157159
$changes['parameter_nullable_type_removed'] = true;

0 commit comments

Comments
 (0)