Skip to content

Commit c83bfd1

Browse files
authored
Merge branch 'main' into documentation
2 parents 1b69438 + 32ae767 commit c83bfd1

File tree

756 files changed

+1259
-965
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

756 files changed

+1259
-965
lines changed

.ddev/commands/web/magerun

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
## Example: "ddev magerun"
66

77
if [ ! -f vendor/bin/n98-magerun ]; then
8-
read -r -p "n98-magerun is not installed. Do you want to install it? [y/N] " INSTALL_MAGE
8+
read -r -p "n98-magerun is not installed. Do you want to install it? [y/N] " INSTALL_MAGERUN
99
INSTALL_MAGERUN=${INSTALL_MAGERUN,,} # to lower
1010
if [[ "${INSTALL_MAGERUN}" =~ ^(yes|y) ]]; then
1111
composer require --dev n98/magerun:dev-develop

.ddev/commands/web/openmage-admin

100644100755
File mode changed.

.github/labeler.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,7 @@
887887
'phpstan':
888888
- changed-files:
889889
- any-glob-to-any-file: [
890+
.phpstan*,
890891
phpstan*,
891892
.github/workflows/phpstan.yml
892893
]

.github/workflows/check-files.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575

7676
- name: Get changed files
7777
id: changed-files-specific
78-
uses: tj-actions/changed-files@v44
78+
uses: tj-actions/changed-files@v45
7979
with:
8080
files: |
8181
composer.*

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,8 @@ name: "CodeQL"
1313

1414
on:
1515
workflow_call:
16+
# Allow manually triggering the workflow.
1617
workflow_dispatch:
17-
push:
18-
branches: [ "main", "next", "v19" ]
19-
pull_request:
20-
# The branches below must be a subset of the branches above
21-
branches: [ "main", "next", "v19" ]
22-
paths-ignore:
23-
- '**/*.md'
24-
- '**/*.txt'
2518

2619
jobs:
2720
analyze:

.github/workflows/phpstan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
matrix:
1414
operating-system: [ubuntu-latest]
15-
php-versions: ['7.4', '8.3']
15+
php-versions: ['7.4', '8.4']
1616

1717
steps:
1818
- name: Setup PHP

.github/workflows/syntax-php.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
strategy:
1616
matrix:
17-
php: ['7.4', '8.3']
17+
php: ['7.4', '8.4']
1818

1919
name: PHP Syntax ${{ matrix.php }}
2020

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Update Copyright
2+
3+
on:
4+
# Run automatically every month.
5+
schedule:
6+
- cron: '0 0 1 * *'
7+
workflow_call:
8+
# Allow manually triggering the workflow.
9+
workflow_dispatch:
10+
11+
jobs:
12+
update_copyright:
13+
name: Update Copyright
14+
runs-on: [ubuntu-latest]
15+
16+
steps:
17+
- name: Setup PHP
18+
uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: 7.4
21+
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
with:
25+
ref: main
26+
fetch-depth: 0
27+
28+
- name: Get composer cache directory
29+
id: composer-cache
30+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
31+
32+
- name: Cache dependencies
33+
uses: actions/cache@v4
34+
with:
35+
path: ${{ steps.composer-cache.outputs.dir }}
36+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
37+
restore-keys: ${{ runner.os }}-composer-
38+
39+
- name: Install dependencies
40+
run: composer install --prefer-dist --no-progress --ignore-platform-req=ext-*
41+
42+
- name: Update Copyright
43+
run: php -f shell/update-copyright.php
44+
45+
- name: Create Pull Request
46+
uses: peter-evans/create-pull-request@v6
47+
with:
48+
commit-message: update copyright
49+
title: Updated Copyright
50+
body: |
51+
- Updated copyright
52+
53+
Auto-generated by [openmage/dev-copyright][1]
54+
55+
[1]: https://github.com/OpenMage/dev-copyright
56+
branch: update-copyright
57+
base: main

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,11 @@
7070
.phpcs*.xml
7171
!.phpcs*.xml.dist
7272

73+
# PhpStan
74+
.phpstan*.neon
7375
phpstan*.neon
74-
!phpstan.dist.*.neon
76+
!.phpstan.dist.neon
77+
!.phpstan.dist.*.neon
7578

7679
# dev scripts loaded via composer
7780
/shell/update-copyright.php

.php-cs-fixer.dist.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
*/
77
$config = new PhpCsFixer\Config();
88
return $config
9+
->setRiskyAllowed(true)
910
->setRules([
11+
// PHP arrays should be declared using the configured syntax.
12+
'array_syntax' => ['syntax' => 'short'],
1013
// There MUST be one blank line after the namespace declaration.
1114
'blank_line_after_namespace' => true,
1215
// Ensure there is no code on the same line as the PHP open tag and it is followed by a blank line.
@@ -17,6 +20,8 @@
1720
'class_definition' => true,
1821
// Remove extra spaces in a nullable typehint.
1922
'compact_nullable_typehint' => true,
23+
// Concatenation should be spaced according to configuration.
24+
'concat_space' => ['spacing' => 'one'],
2025
// The PHP constants `true`, `false`, and `null` MUST be written using the correct casing.
2126
'constant_case' => true,
2227
// Equal sign in declare statement should be surrounded by spaces or not following configuration.
@@ -33,6 +38,8 @@
3338
'indentation_type' => true,
3439
// All PHP files must use same line ending.
3540
'line_ending' => true,
41+
// Use && and || logical operators instead of and and or.
42+
'logical_operators' => true,
3643
// Cast should be written in lower case.
3744
'lowercase_cast' => true,
3845
// PHP keywords MUST be in lower case.
@@ -41,6 +48,8 @@
4148
'lowercase_static_reference' => true,
4249
// In method arguments and method call, there MUST NOT be a space before each comma and there MUST be one space after each comma. Argument lists MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one argument per line.
4350
'method_argument_space' => true,
51+
// Replaces intval, floatval, doubleval, strval and boolval function calls with according type casting operator.
52+
'modernize_types_casting' => true,
4453
// All instances created with new keyword must be followed by braces.
4554
'new_with_braces' => true,
4655
// There should be no empty lines after class opening brace.
@@ -100,6 +109,7 @@
100109
PhpCsFixer\Finder::create()
101110
->in([
102111
'app/code/core/Mage/',
112+
'errors/',
103113
'lib/Mage/',
104114
'lib/Magento/',
105115
'lib/Varien/',

.phpcs.ecg.xml.dist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<file>install.php</file>
88
<file>app/Mage.php</file>
99
<file>app/code/core/Mage/</file>
10+
<file>errors/</file>
1011
<file>lib/Mage/</file>
1112
<file>lib/Magento/</file>
1213
<file>lib/Varien/</file>
@@ -66,6 +67,7 @@
6667
<exclude-pattern>*/core/Mage/Catalog/Model/Resource/Product/Compare/Item.php*</exclude-pattern>
6768
<exclude-pattern>*/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php*</exclude-pattern>
6869
<exclude-pattern>*/core/Mage/Catalog/Model/Resource/Product/Option/Value.php*</exclude-pattern>
70+
<exclude-pattern>*/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute.php*</exclude-pattern>
6971
<exclude-pattern>*/core/Mage/CatalogIndex/Model/Indexer.php*</exclude-pattern>
7072
<exclude-pattern>*/core/Mage/CatalogInventory/Model/Observer.php*</exclude-pattern>
7173
<exclude-pattern>*/core/Mage/CatalogInventory/Model/Api2/Stock/Item/Rest.php*</exclude-pattern>
@@ -111,6 +113,7 @@
111113
<exclude-pattern>*/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Grouped.php*</exclude-pattern>
112114
<exclude-pattern>*/core/Mage/ImportExport/Model/Import/Proxy/Product/Resource.php*</exclude-pattern>
113115
<exclude-pattern>*/core/Mage/Index/controllers/Adminhtml/ProcessController.php*</exclude-pattern>
116+
<exclude-pattern>*/core/Mage/Index/Model/Observer.php*</exclude-pattern>
114117
<exclude-pattern>*/core/Mage/Index/Model/Process.php*</exclude-pattern>
115118
<exclude-pattern>*/core/Mage/Index/Model/Resource/Event.php*</exclude-pattern>
116119
<exclude-pattern>*/core/Mage/Log/Model/Resource/Log.php*</exclude-pattern>
@@ -148,6 +151,7 @@
148151
<exclude-pattern>*/core/Mage/Sales/Model/Order/Shipment.php*</exclude-pattern>
149152
<exclude-pattern>*/core/Mage/SalesRule/Model/Observer.php*</exclude-pattern>
150153
<exclude-pattern>*/core/Mage/SalesRule/Model/Rule.php*</exclude-pattern>
154+
<exclude-pattern>*/core/Mage/SalesRule/Model/Coupon/Massgenerator.php*</exclude-pattern>
151155
<exclude-pattern>*/core/Mage/Tag/controllers/IndexController.php*</exclude-pattern>
152156
<exclude-pattern>*/core/Mage/Tag/Model/Api.php*</exclude-pattern>
153157
<exclude-pattern>*/core/Mage/Tag/Model/Resource/Product/Collection.php*</exclude-pattern>
@@ -163,6 +167,7 @@
163167
<exclude-pattern>*/lib/Varien/Cache/Backend/Memcached.php*</exclude-pattern>
164168
<exclude-pattern>*/lib/Varien/Convert/Parser/Csv.php*</exclude-pattern>
165169
<exclude-pattern>*/lib/Varien/Object/Cache.php*</exclude-pattern>
170+
<exclude-pattern>*/shell/indexer.php*</exclude-pattern>
166171
<exclude-pattern>*/core/Mage/*/data/*</exclude-pattern>
167172
<exclude-pattern>*/core/Mage/*/sql/*</exclude-pattern>
168173
</rule>

.phpcs.php.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<file>install.php</file>
88
<file>app/Mage.php</file>
99
<file>app/code/core/Mage/</file>
10+
<file>errors/</file>
1011
<file>lib/Mage/</file>
1112
<file>lib/Magento/</file>
1213
<file>lib/Varien/</file>

.phpcs.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<file>install.php</file>
88
<file>app/Mage.php</file>
99
<file>app/code/core/Mage/</file>
10+
<file>errors/</file>
1011
<file>lib/Mage/</file>
1112
<file>lib/Magento/</file>
1213
<file>lib/Varien/</file>

phpstan.dist.baseline.neon renamed to .phpstan.dist.baseline.neon

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3290,11 +3290,6 @@ parameters:
32903290
count: 1
32913291
path: app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php
32923292

3293-
-
3294-
message: "#^Offset int\\|string on non\\-empty\\-array\\<int\\|string, non\\-empty\\-array\\> in isset\\(\\) always exists and is not nullable\\.$#"
3295-
count: 2
3296-
path: app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php
3297-
32983293
-
32993294
message: "#^Variable \\$collection might not be defined\\.$#"
33003295
count: 1
@@ -3490,11 +3485,6 @@ parameters:
34903485
count: 1
34913486
path: app/code/core/Mage/Payment/Model/Method/Abstract.php
34923487

3493-
-
3494-
message: "#^Loose comparison using \\!\\= between ''\\|'OT' and 'SS' will always evaluate to true\\.$#"
3495-
count: 1
3496-
path: app/code/core/Mage/Payment/Model/Method/Cc.php
3497-
34983488
-
34993489
message: "#^Method Mage_Payment_Model_Recurring_Profile\\:\\:exportStartDatetime\\(\\) should return string\\|Zend_Date but empty return statement found\\.$#"
35003490
count: 1
@@ -3970,6 +3960,11 @@ parameters:
39703960
count: 1
39713961
path: app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Tax.php
39723962

3963+
-
3964+
message: "#^Negated boolean expression is always true\\.$#"
3965+
count: 1
3966+
path: app/code/core/Mage/Sales/Model/Order.php
3967+
39733968
-
39743969
message: "#^Variable \\$oldArea might not be defined\\.$#"
39753970
count: 1

phpstan.dist.neon renamed to .phpstan.dist.neon

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
includes:
22
- vendor/macopedia/phpstan-magento1/extension.neon
3-
- phpstan.dist.baseline.neon
3+
- .phpstan.dist.baseline.neon
44
- phar://phpstan.phar/conf/bleedingEdge.neon
55
parameters:
66
magentoRootPath: %currentWorkingDirectory%
@@ -12,6 +12,7 @@ parameters:
1212
- install.php
1313
- app/Mage.php
1414
- app/code/core/Mage
15+
- errors
1516
- lib/Mage
1617
- lib/Magento
1718
- lib/Varien
@@ -50,9 +51,6 @@ parameters:
5051
- app/code/core/Mage/Paypal/Model/Report/Settlement.php
5152
- lib/Varien/Io/Sftp.php
5253

53-
# Class backup/db was not found while trying to analyse it
54-
- app/code/core/Mage/Adminhtml/controllers/System/BackupController.php
55-
5654
# Dataflow/Model/Convert/Iterator.php
5755
- app/code/core/Mage/Dataflow/Model/Convert/Iterator.php
5856

@@ -70,6 +68,9 @@ parameters:
7068
checkFunctionNameCase: true
7169
checkInternalClassCaseSensitivity: true
7270
treatPhpDocTypesAsCertain: false
73-
71+
# For v1.12+ with "bleeding edge"
72+
ignoreErrors:
73+
-
74+
identifier: missingType.iterableValue
7475
# universalObjectCratesClasses:
7576
# - Varien_Object

app/Mage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* @category Mage
1010
* @package Mage
1111
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
12-
* @copyright Copyright (c) 2017-2023 The OpenMage Contributors (https://www.openmage.org)
12+
* @copyright Copyright (c) 2017-2024 The OpenMage Contributors (https://www.openmage.org)
1313
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1414
*/
1515

@@ -433,7 +433,7 @@ public static function getStoreConfigAsInt(string $path, $store = null): int
433433
* Retrieve config flag for store by path
434434
*
435435
* @param string $path
436-
* @param mixed $store
436+
* @param null|string|bool|int|Mage_Core_Model_Store $store
437437
* @return bool
438438
*/
439439
public static function getStoreConfigFlag($path, $store = null)

app/code/core/Mage/Admin/Model/Acl/Assert/Ip.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* @category Mage
1010
* @package Mage_Admin
1111
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
12-
* @copyright Copyright (c) 2020-2023 The OpenMage Contributors (https://www.openmage.org)
12+
* @copyright Copyright (c) 2020-2024 The OpenMage Contributors (https://www.openmage.org)
1313
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1414
*/
1515

app/code/core/Mage/Admin/Model/Acl/Assert/Time.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* @category Mage
1010
* @package Mage_Admin
1111
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
12-
* @copyright Copyright (c) 2020-2023 The OpenMage Contributors (https://www.openmage.org)
12+
* @copyright Copyright (c) 2020-2024 The OpenMage Contributors (https://www.openmage.org)
1313
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1414
*/
1515

app/code/core/Mage/Admin/Model/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* @category Mage
1010
* @package Mage_Admin
1111
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
12-
* @copyright Copyright (c) 2019-2023 The OpenMage Contributors (https://www.openmage.org)
12+
* @copyright Copyright (c) 2019-2024 The OpenMage Contributors (https://www.openmage.org)
1313
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1414
*/
1515

app/code/core/Mage/Admin/Model/Observer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* @category Mage
1010
* @package Mage_Admin
1111
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
12-
* @copyright Copyright (c) 2020-2023 The OpenMage Contributors (https://www.openmage.org)
12+
* @copyright Copyright (c) 2020-2024 The OpenMage Contributors (https://www.openmage.org)
1313
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1414
*/
1515

app/code/core/Mage/Admin/Model/Redirectpolicy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* @category Mage
1010
* @package Mage_Admin
1111
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
12-
* @copyright Copyright (c) 2020-2023 The OpenMage Contributors (https://www.openmage.org)
12+
* @copyright Copyright (c) 2020-2024 The OpenMage Contributors (https://www.openmage.org)
1313
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1414
*/
1515

app/code/core/Mage/Admin/Model/Resource/Acl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* @category Mage
1010
* @package Mage_Admin
1111
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
12-
* @copyright Copyright (c) 2019-2023 The OpenMage Contributors (https://www.openmage.org)
12+
* @copyright Copyright (c) 2019-2024 The OpenMage Contributors (https://www.openmage.org)
1313
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1414
*/
1515

app/code/core/Mage/Admin/Model/Resource/Roles/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* @category Mage
1010
* @package Mage_Admin
1111
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
12-
* @copyright Copyright (c) 2019-2023 The OpenMage Contributors (https://www.openmage.org)
12+
* @copyright Copyright (c) 2019-2024 The OpenMage Contributors (https://www.openmage.org)
1313
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1414
*/
1515

app/code/core/Mage/Admin/Model/Resource/Roles/User/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* @category Mage
1010
* @package Mage_Admin
1111
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
12-
* @copyright Copyright (c) 2019-2023 The OpenMage Contributors (https://www.openmage.org)
12+
* @copyright Copyright (c) 2019-2024 The OpenMage Contributors (https://www.openmage.org)
1313
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1414
*/
1515

0 commit comments

Comments
 (0)