1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Sugarcrm\UpgradeSpec\Element\Section; |
4
|
|
|
|
5
|
|
|
use Sugarcrm\UpgradeSpec\Data\DataAwareInterface; |
6
|
|
|
use Sugarcrm\UpgradeSpec\Data\DataAwareTrait; |
7
|
|
|
use Sugarcrm\UpgradeSpec\Element\ElementInterface; |
8
|
|
|
use Sugarcrm\UpgradeSpec\Context\Upgrade; |
9
|
|
|
use Sugarcrm\UpgradeSpec\Template\RendererAwareInterface; |
10
|
|
|
use Sugarcrm\UpgradeSpec\Template\RendererAwareTrait; |
11
|
|
|
use Symfony\Component\Finder\Finder; |
12
|
|
|
|
13
|
|
|
class UpgradeChanges implements ElementInterface, RendererAwareInterface, DataAwareInterface |
14
|
|
|
{ |
15
|
|
|
use RendererAwareTrait, DataAwareTrait; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* @return string |
19
|
|
|
*/ |
20
|
|
|
public function getTitle() |
21
|
|
|
{ |
22
|
|
|
return 'Review upgrade changes and fix possible customization conflicts'; |
23
|
|
|
} |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @return int |
27
|
|
|
*/ |
28
|
|
|
public function getOrder() |
29
|
|
|
{ |
30
|
|
|
return 3; |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @param Upgrade $context |
35
|
|
|
* |
36
|
|
|
* @return bool |
|
|
|
|
37
|
|
|
*/ |
38
|
|
|
public function isRelevantTo(Upgrade $context) |
39
|
|
|
{ |
40
|
|
|
return $context->getTargetPath(); |
|
|
|
|
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @param Upgrade $context |
45
|
|
|
* |
46
|
|
|
* @return string |
47
|
|
|
*/ |
48
|
|
|
public function getBody(Upgrade $context) |
49
|
|
|
{ |
50
|
|
|
$customizations = $this->dataManager->getPotentiallyBrokenCustomizations($context); |
51
|
|
|
|
52
|
|
|
return $this->renderer->render('upgrade_changes', [ |
53
|
|
|
'upgrade_steps' => $this->dataManager->getUpgradeSteps($context), |
54
|
|
|
'upgrade_to' => $context->getTargetVersion(), |
55
|
|
|
'upgrade_source' => $context->getTargetPath(), |
56
|
|
|
'modified_files' => $customizations['modified_files'], |
57
|
|
|
'deleted_files' => $customizations['deleted_files'], |
58
|
|
|
]); |
59
|
|
|
} |
60
|
|
|
} |
61
|
|
|
|
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.