Skip to content

Commit 3b569b8

Browse files
Merge branch '4.3.0-develop' of github.com:magento/magento2-phpstorm-plugin into 613-diff-overridden-template
2 parents bf34014 + 3c6721b commit 3b569b8

File tree

32 files changed

+441
-186
lines changed

32 files changed

+441
-186
lines changed

resources/fileTemplates/internal/Magento CLI Command Class.php.ft

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use Symfony\Component\Console\Output\OutputInterface;
1212
class ${NAME} extends Command
1313
{
1414
/**
15-
* @inheritDoc
15+
* Initialization of the command.
1616
*/
1717
protected function configure()
1818
{
@@ -22,7 +22,7 @@ class ${NAME} extends Command
2222
}
2323

2424
/**
25-
* CLI command description
25+
* CLI command description.
2626
*
2727
* @param InputInterface $input
2828
* @param OutputInterface $output

resources/fileTemplates/internal/Magento Collection Class.php.ft

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class ${NAME}#if (${EXTENDS}) extends ${EXTENDS}#end#if (${IMPLEMENTS}) implemen
1717
protected $_eventPrefix = '${DB_NAME}_collection';
1818

1919
/**
20-
* @inheritdoc
20+
* Initialize collection model.
2121
*/
2222
protected function _construct()
2323
{

resources/fileTemplates/internal/Magento Data Model.php.ft

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ${NAME} #if (${EXTENDS})extends ${EXTENDS} #end #if (${IMPLEMENTS} && $has
1919
{
2020
#if (${PROPERTIES} && !$hasInterface)
2121
/**
22-
* String constants for property names
22+
* String constants for property names.
2323
*/
2424
#set ($properties = ${PROPERTIES})
2525
#foreach ($property in $properties.split(","))
@@ -41,17 +41,11 @@ class ${NAME} #if (${EXTENDS})extends ${EXTENDS} #end #if (${IMPLEMENTS} && $has
4141
#if(!($foreach.first))
4242

4343
#end
44-
#if ($hasInterface)
45-
/**
46-
* @inheritDoc
47-
*/
48-
#else
4944
/**
5045
* Getter for $propertyUpperCamel.
5146
*
5247
* @return $propertyType|null
5348
*/
54-
#end
5549
public function get$propertyUpperCamel(): ?$propertyType
5650
{
5751
#if($propertyType == 'string')
@@ -62,19 +56,13 @@ class ${NAME} #if (${EXTENDS})extends ${EXTENDS} #end #if (${IMPLEMENTS} && $has
6256
#end
6357
}
6458

65-
#if ($hasInterface)
66-
/**
67-
* @inheritDoc
68-
*/
69-
#else
7059
/**
7160
* Setter for $propertyUpperCamel.
7261
*
7362
* @param $propertyType|null $$propertyLowerCamel
7463
*
7564
* @return void
7665
*/
77-
#end
7866
public function set$propertyUpperCamel(?$propertyType $$propertyLowerCamel): void
7967
{
8068
$this->setData(self::$propertyUpperSnake, $$propertyLowerCamel);

resources/fileTemplates/internal/Magento Entity Search Results.php.ft

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,21 @@ use $use;
1414
class ${CLASS_NAME} extends ${PARENT_CLASS_NAME} implements ${INTERFACE_NAME}
1515
{
1616
/**
17-
* @inheritDoc
17+
* Set items list.
18+
*
19+
* @param array $items
20+
*
21+
* @return ${INTERFACE_NAME}
1822
*/
1923
public function setItems(array $items): ${INTERFACE_NAME}
2024
{
2125
return parent::setItems($items);
2226
}
2327

2428
/**
25-
* @inheritDoc
29+
* Get items list.
30+
*
31+
* @return array
2632
*/
2733
public function getItems(): array
2834
{

resources/fileTemplates/internal/Magento Grid Ui Component Action Column Class.php.ft

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@ class ${CLASS_NAME} extends ${PARENT_CLASS}
2020

2121
/**
2222
* Url paths.
23-
* #@+
2423
*/
2524
private const EDIT_URL_PATH = '${EDIT_URL_PATH}';
2625
private const DELETE_URL_PATH = '${DELETE_URL_PATH}';
27-
/** #@- */
2826

2927
/**
3028
* @var ${URL}
@@ -55,7 +53,11 @@ class ${CLASS_NAME} extends ${PARENT_CLASS}
5553
}
5654

5755
/**
58-
* @inheritDoc
56+
* Prepare data source.
57+
*
58+
* @param array $dataSource
59+
*
60+
* @return array
5961
*/
6062
public function prepareDataSource(array $dataSource): array
6163
{

resources/fileTemplates/internal/Magento Model Class.php.ft

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ class ${NAME}#if (${EXTENDS}) extends ${EXTENDS}#end#if (${IMPLEMENTS}) implemen
1717
protected $_eventPrefix = '${DB_NAME}_model';
1818

1919
/**
20-
* @inheritdoc
20+
* Initialize magento model.
21+
*
22+
* @return void
2123
*/
2224
protected function _construct()
2325
{

resources/fileTemplates/internal/Magento Resource Model Class.php.ft

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class ${NAME}#if (${EXTENDS}) extends ${EXTENDS}#end#if (${IMPLEMENTS}) implemen
1717
protected $_eventPrefix = '${DB_NAME}_resource_model';
1818

1919
/**
20-
* @inheritdoc
20+
* Initialize resource model.
2121
*/
2222
protected function _construct()
2323
{

resources/fileTemplates/internal/Magento UI Component Custom Data Provider Class.php.ft

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ class ${CLASS_NAME} extends ${EXTENDS}
7676
}
7777

7878
/**
79-
* @inheritDoc
79+
* Returns searching result.
80+
*
81+
* @return ${SEARCH_RESULT_FACTORY}
8082
*/
8183
public function getSearchResult()
8284
{
@@ -119,7 +121,9 @@ class ${CLASS_NAME} extends ${EXTENDS}
119121
}
120122
#else
121123
/**
122-
* @inheritDoc
124+
* Get data.
125+
*
126+
* @return array
123127
*/
124128
public function getData()
125129
{

src/com/magento/idea/magento2plugin/magento/packages/ComponentType.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
@SuppressWarnings({"PMD.FieldNamingConventions"})
1111
public enum ComponentType {
1212
module,
13-
theme;
13+
theme,
14+
library;
1415

1516
/**
1617
* Get component type by value.

src/com/magento/idea/magento2uct/execution/GenerateUctReportCommand.java

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import com.magento.idea.magento2uct.util.inspection.FilterDescriptorResultsUtil;
3838
import com.magento.idea.magento2uct.util.inspection.SortDescriptorResultsUtil;
3939
import java.nio.file.Paths;
40+
import java.util.ArrayList;
4041
import java.util.List;
4142
import org.jetbrains.annotations.NotNull;
4243
import org.jetbrains.annotations.Nullable;
@@ -84,7 +85,7 @@ public void processTerminated(final @NotNull ProcessEvent event) {
8485
@SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.AvoidInstantiatingObjectsInLoops"})
8586
public void execute() {
8687
output.write("Upgrade compatibility tool\n");
87-
final PsiDirectory rootDirectory = getTargetPsiDirectory();
88+
final PsiDirectory rootDirectory = getTargetPsiDirectory(settingsService.getModulePath());
8889

8990
if (rootDirectory == null) {
9091
output.print(
@@ -93,8 +94,21 @@ public void execute() {
9394
process.destroyProcess();
9495
return;
9596
}
97+
final List<PsiDirectory> directoriesToScan = new ArrayList<>();
98+
directoriesToScan.add(rootDirectory);
99+
100+
if (settingsService.getHasAdditionalPath()) {
101+
final PsiDirectory additionalDirectory = getTargetPsiDirectory(
102+
settingsService.getAdditionalPath()
103+
);
104+
105+
if (additionalDirectory != null) {
106+
directoriesToScan.add(additionalDirectory);
107+
}
108+
}
109+
96110
final ModuleScanner scanner = new ModuleScanner(
97-
rootDirectory,
111+
directoriesToScan,
98112
new ExcludeMagentoBundledFilter()
99113
);
100114
final Summary summary = new Summary(
@@ -136,7 +150,7 @@ public void execute() {
136150

137151
if (fileProblemsHolder.hasResults()) {
138152
if (!isModuleHeaderPrinted) {
139-
outputUtil.printModuleName(componentData.getName());
153+
outputUtil.printModuleName(componentData);
140154
isModuleHeaderPrinted = true;
141155
}
142156
outputUtil.printProblemFile(filename);
@@ -165,9 +179,10 @@ public void execute() {
165179
}
166180
summary.trackProcessFinished();
167181
summary.setProcessedModules(scanner.getModuleCount());
182+
summary.setProcessedThemes(scanner.getThemeCount());
168183
outputUtil.printSummary(summary, resolvedEdition);
169184

170-
if (summary.getProcessedModules() == 0) {
185+
if (summary.getProcessedModules() == 0 && summary.getProcessedThemes() == 0) {
171186
process.destroyProcess();
172187
return;
173188
}
@@ -196,11 +211,11 @@ public void execute() {
196211
/**
197212
* Get target psi directory.
198213
*
214+
* @param targetDirPath String
215+
*
199216
* @return PsiDirectory
200217
*/
201-
private @Nullable PsiDirectory getTargetPsiDirectory() {
202-
final String targetDirPath = settingsService.getModulePath();
203-
218+
private @Nullable PsiDirectory getTargetPsiDirectory(final String targetDirPath) {
204219
if (targetDirPath == null) {
205220
return null;
206221
}

0 commit comments

Comments
 (0)