Skip to content

Commit 7cf1732

Browse files
committed
Merge branch 'v1-develop' into v1
2 parents 68dbf98 + 8d0681c commit 7cf1732

File tree

13 files changed

+1103
-1101
lines changed

13 files changed

+1103
-1101
lines changed

.php_cs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,27 @@ $finder = PhpCsFixer\Finder::create()
88
return PhpCsFixer\Config::create()
99
->setRules([
1010
'@Symfony' => true,
11+
'@PSR12' => true,
1112
'array_syntax' => ['syntax' => 'short'],
12-
'binary_operator_spaces' => ['default' => null],
13+
'binary_operator_spaces' => ['default' => null, 'operators' => ['=>' => 'align']],
1314
'concat_space' => ['spacing' => 'one'],
1415
'declare_strict_types' => true,
15-
'ordered_imports' => ['sort_algorithm' => 'alpha'],
16-
'phpdoc_align' => false,
17-
'phpdoc_separation' => false,
16+
'no_alias_functions' => true,
17+
'no_useless_sprintf' => true,
18+
'ordered_imports' => [
19+
'imports_order' => [
20+
'class',
21+
'function',
22+
'const',
23+
],
24+
'sort_algorithm' => 'alpha'
25+
],
26+
'phpdoc_align' => ['align' => 'left'],
1827
'phpdoc_summary' => false,
19-
'yoda_style' => null,
28+
'self_accessor' => true,
2029
'single_line_throw' => false,
30+
'visibility_required' => ['property', 'method'], // removed 'const' since we still support PHP 7.0 for now
31+
'yoda_style' => null,
2132
])
2233
->setFinder($finder)
2334
;

Checker/Catalog/Category/UrlKey/EmptyUrlKey.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ private function checkForEmptyUrlKeyAttributeValues(): array
6464
->addAttributeToFilter([
6565
[
6666
'attribute' => UrlKeyChecker::URL_KEY_ATTRIBUTE,
67-
'null' => true,
67+
'null' => true,
6868
],
6969
[
7070
'attribute' => UrlKeyChecker::URL_KEY_ATTRIBUTE,
71-
'eq' => '',
71+
'eq' => '',
7272
],
7373
], null, $joinType)
7474
;

Checker/Catalog/Product/UrlKey.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use Baldwin\UrlDataIntegrityChecker\Checker\Catalog\Product\UrlKey\DuplicateUrlKey as DuplicateUrlKeyChecker;
88
use Baldwin\UrlDataIntegrityChecker\Checker\Catalog\Product\UrlKey\EmptyUrlKey as EmptyUrlKeyChecker;
9-
use Baldwin\UrlDataIntegrityChecker\Console\Progress;
109

1110
class UrlKey
1211
{
@@ -15,16 +14,13 @@ class UrlKey
1514

1615
private $duplicateUrlKeyChecker;
1716
private $emptyUrlKeyChecker;
18-
private $progress;
1917

2018
public function __construct(
2119
DuplicateUrlKeyChecker $duplicateUrlKeyChecker,
22-
EmptyUrlKeyChecker $emptyUrlKeyChecker,
23-
Progress $progress
20+
EmptyUrlKeyChecker $emptyUrlKeyChecker
2421
) {
2522
$this->duplicateUrlKeyChecker = $duplicateUrlKeyChecker;
2623
$this->emptyUrlKeyChecker = $emptyUrlKeyChecker;
27-
$this->progress = $progress;
2824
}
2925

3026
/**

Checker/Catalog/Product/UrlKey/EmptyUrlKey.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ private function checkForEmptyUrlKeyAttributeValues(): array
7575
->addAttributeToFilter([
7676
[
7777
'attribute' => UrlKeyChecker::URL_KEY_ATTRIBUTE,
78-
'null' => true,
78+
'null' => true,
7979
],
8080
[
8181
'attribute' => UrlKeyChecker::URL_KEY_ATTRIBUTE,
82-
'eq' => '',
82+
'eq' => '',
8383
],
8484
], null, $joinType)
8585
;

Cron/ScheduleJob.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ public function schedule(string $jobCode): bool
4242
$schedule
4343
->setJobCode($jobCode)
4444
->setStatus(CronScheduleModel::STATUS_PENDING)
45-
->setCreatedAt(strftime('%Y-%m-%d %H:%M:%S', $createdAtTime))
46-
->setScheduledAt(strftime('%Y-%m-%d %H:%M', $scheduledAtTime))
45+
->setCreatedAt(strftime('%Y-%m-%d %H:%M:%S', $createdAtTime) ?: '')
46+
->setScheduledAt(strftime('%Y-%m-%d %H:%M', $scheduledAtTime) ?: '')
4747
->save();
4848

4949
return true;

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ checkstyle:
1818

1919
.PHONY: checkquality
2020
checkquality:
21+
vendor/bin/phpstan analyse
22+
vendor/bin/psalm
23+
2124
xmllint --noout --schema vendor/magento/module-backend/etc/menu.xsd etc/adminhtml/menu.xml
2225
xmllint --noout --schema vendor/magento/framework/App/etc/routes.xsd etc/adminhtml/routes.xml
2326
xmllint --noout --schema vendor/magento/framework/Acl/etc/acl.xsd etc/acl.xml
@@ -35,9 +38,6 @@ checkquality:
3538
xmllint --noout view/adminhtml/ui_component/baldwin_urldataintegritychecker_grid_catalog_product_urlkey.xml # schema validation doesn't work here since the xsd includes another xsd ..
3639
xmllint --noout view/adminhtml/ui_component/baldwin_urldataintegritychecker_grid_catalog_product_urlpath.xml # schema validation doesn't work here since the xsd includes another xsd ..
3740

38-
vendor/bin/phpstan analyse
39-
vendor/bin/psalm
40-
4141
.PHONY: test
4242
test:
4343
vendor/bin/phpunit Test/

Model/ResourceModel/Catalog/Category/UrlKeyCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function createDataObject(array $arguments = []): DataObject
8585
foreach ($arguments as $key => $value) {
8686
$attribute = new AttributeValue([
8787
AttributeInterface::ATTRIBUTE_CODE => $key,
88-
AttributeInterface::VALUE => $value,
88+
AttributeInterface::VALUE => $value,
8989
]);
9090

9191
$attributes[] = $attribute;

Model/ResourceModel/Catalog/Category/UrlPathCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function createDataObject(array $arguments = []): DataObject
8585
foreach ($arguments as $key => $value) {
8686
$attribute = new AttributeValue([
8787
AttributeInterface::ATTRIBUTE_CODE => $key,
88-
AttributeInterface::VALUE => $value,
88+
AttributeInterface::VALUE => $value,
8989
]);
9090

9191
$attributes[] = $attribute;

Model/ResourceModel/Catalog/Product/UrlKeyCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function createDataObject(array $arguments = []): DataObject
8585
foreach ($arguments as $key => $value) {
8686
$attribute = new AttributeValue([
8787
AttributeInterface::ATTRIBUTE_CODE => $key,
88-
AttributeInterface::VALUE => $value,
88+
AttributeInterface::VALUE => $value,
8989
]);
9090

9191
$attributes[] = $attribute;

Model/ResourceModel/Catalog/Product/UrlPathCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function createDataObject(array $arguments = []): DataObject
8585
foreach ($arguments as $key => $value) {
8686
$attribute = new AttributeValue([
8787
AttributeInterface::ATTRIBUTE_CODE => $key,
88-
AttributeInterface::VALUE => $value,
88+
AttributeInterface::VALUE => $value,
8989
]);
9090

9191
$attributes[] = $attribute;

0 commit comments

Comments
 (0)