Skip to content

Commit

Permalink
fix static analysis (#554)
Browse files Browse the repository at this point in the history
* fix static analysis

* fix deprecation
  • Loading branch information
alexz707 authored Jan 28, 2025
1 parent c02cb5d commit 11c3ced
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 72 deletions.
73 changes: 2 additions & 71 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
name: "Static Analysis"

on:
pull_request:
branches:
- "[0-9]+.[0-9]+"
- "[0-9]+.x"
push:
branches:
- "[0-9]+.[0-9]+"
- "[0-9]+.x"

jobs:
static-analysis-phpstan:
name: "Static Analysis with PHPStan"
runs-on: "ubuntu-20.04"name: "Static analysis centralised"
name: "Static analysis centralised"

on:
schedule:
Expand Down Expand Up @@ -107,58 +92,4 @@ jobs:
COMPOSER_OPTIONS: ${{ matrix.matrix.composer_options }}
secrets:
SSH_PRIVATE_KEY_PIMCORE_DEPLOYMENTS_USER: ${{ secrets.SSH_PRIVATE_KEY_PIMCORE_DEPLOYMENTS_USER }}
COMPOSER_PIMCORE_REPO_PACKAGIST_TOKEN: ${{ secrets.COMPOSER_PIMCORE_REPO_PACKAGIST_TOKEN }}
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
include:
- { php-version: "8.1", dependencies: "lowest", experimental: false }
- { php-version: "8.2", dependencies: "highest", experimental: false }
- { php-version: "8.3", dependencies: "highest", pimcore_version: "11.x-dev as 11.3.9", experimental: true }
steps:
- name: "Checkout code"
uses: "actions/checkout@v4"

- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"

- name: "Setup Pimcore environment"
env:
DEPENDENCIES: "${{ matrix.dependencies }}"
run: |
.github/ci/scripts/setup-environment.sh
- name: "Update Pimcore version"
env:
PIMCORE_VERSION: "${{ matrix.pimcore_version }}"
run: |
if [ ! -z "$PIMCORE_VERSION" ]; then
composer require --no-update pimcore/pimcore:"${PIMCORE_VERSION}"
fi
- name: "Install dependencies with Composer"
uses: ramsey/composer-install@v3
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Run a static analysis with phpstan/phpstan (highest)"
if: ${{ matrix.dependencies == 'highest' }}
run: "vendor/bin/phpstan analyse --memory-limit=-1"

- name: "Run a static analysis with phpstan/phpstan (lowest)"
if: ${{ matrix.dependencies == 'lowest' }}
run: "vendor/bin/phpstan analyse --memory-limit=-1 -c phpstan-lowest.neon"

- name: "Generate baseline file"
if: ${{ failure() }}
run: "vendor/bin/phpstan analyse --memory-limit=-1 --generate-baseline"

- name: "Upload baseline file"
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: phpstan-baseline.neon
path: phpstan-baseline.neon
COMPOSER_PIMCORE_REPO_PACKAGIST_TOKEN: ${{ secrets.COMPOSER_PIMCORE_REPO_PACKAGIST_TOKEN }}
5 changes: 5 additions & 0 deletions doc/02_Installation/01_Update.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Update Notices

## Update to Version 5.0
- CustomerManagementFrameworkBundle\Newsletter\Queue\Item\/DefaultNewsletterQueueItem constructor removed default null value from $customer parameter.
-


## Update to Version 4.1.2
- CSS includes using the `pimcore_head_link` view helper are not within a deferred block anymore. If you extend the CMF `layout.html.twig` template in your custom code and embed additional CSS within your templates via the `pimcore_head_link` twig extension, check if they still are embedded correctly.

Expand Down
2 changes: 1 addition & 1 deletion src/Newsletter/Queue/Item/DefaultNewsletterQueueItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class DefaultNewsletterQueueItem implements NewsletterQueueItemInterface
*/
private $successfullyProcessed = false;

public function __construct($customerId, ?CustomerInterface $customer = null, $email, $operation, $modificationDate = null)
public function __construct($customerId, ?CustomerInterface $customer, $email, $operation, $modificationDate = null)
{
$modificationDate = !is_null($modificationDate) ? $modificationDate : round(microtime(true) * 1000);

Expand Down

0 comments on commit 11c3ced

Please sign in to comment.