Skip to content

Commit

Permalink
Add PHP 8.1 Support (#6208)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Dec 2, 2021
1 parent 8dd164b commit c3a19eb
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 43 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
- node-version: '12'
- node-version: '14'

env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout project
uses: actions/checkout@v2
Expand Down Expand Up @@ -76,6 +79,7 @@ jobs:
MAILER_URL: null://localhost
SULU_ADMIN_EMAIL:
PHPCR_TRANSPORT: ${{ matrix.phpcr-transport }}
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

strategy:
fail-fast: false
Expand Down Expand Up @@ -105,6 +109,19 @@ jobs:
DATABASE_CHARSET: utf8mb4
DATABASE_COLLATE: utf8mb4_unicode_ci

- php-version: '8.1'
database: mysql
phpcr-transport: doctrinedbal
dependency-versions: 'highest'
php-extensions: 'ctype, iconv, mysql, imagick'
tools: 'composer:v2'
composer-stability: dev
env:
SYMFONY_DEPRECATIONS_HELPER: weak
DATABASE_URL: mysql://root:root@127.0.0.1:3306/sulu_test?serverVersion=5.7
DATABASE_CHARSET: utf8mb4
DATABASE_COLLATE: utf8mb4_unicode_ci

services:
mysql:
image: mysql:5.7
Expand Down Expand Up @@ -148,6 +165,14 @@ jobs:
composer remove jackalope/jackalope-doctrine-dbal --dev --no-interaction --no-update
composer require jackalope/jackalope-jackrabbit:^1.4 --no-interaction --no-update
- name: Set composer stability
if: ${{ matrix.composer-stability }}
run: composer config minimum-stability ${{ matrix.composer-stability }}

- name: Install handcraftedinthealps/goodby-csv
if: ${{ matrix.php-version }} == '8.1'
run: composer require handcraftedinthealps/goodby-csv:^1.4

- name: Install composer dependencies
uses: ramsey/composer-install@v1
with:
Expand All @@ -170,6 +195,7 @@ jobs:
APP_SECRET: a448d1dfcaa563fce56c2fd9981f662b
MAILER_URL: null://localhost
SULU_ADMIN_EMAIL:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout project
Expand Down Expand Up @@ -202,6 +228,7 @@ jobs:
SULU_ADMIN_EMAIL:
DATABASE_URL: mysql://root:root@127.0.0.1:3306/sulu_test?serverVersion=${{ matrix.mysql-version }}
PHPCR_TRANSPORT: ${{ matrix.phpcr-transport }}
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

strategy:
fail-fast: false
Expand Down
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -43885,11 +43885,6 @@ parameters:
count: 1
path: src/Sulu/Bundle/SecurityBundle/Entity/User.php

-
message: "#^Cannot use array destructuring on mixed\\.$#"
count: 1
path: src/Sulu/Bundle/SecurityBundle/Entity/User.php

-
message: "#^Else branch is unreachable because ternary operator condition is always true\\.$#"
count: 1
Expand Down
38 changes: 1 addition & 37 deletions src/Sulu/Bundle/SecurityBundle/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use JMS\Serializer\Annotation\Groups;
use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\VirtualProperty;
use Serializable;
use Sulu\Bundle\ContactBundle\Entity\ContactInterface;
use Sulu\Bundle\CoreBundle\Entity\ApiEntity;
use Sulu\Component\Security\Authentication\UserInterface;
Expand All @@ -30,7 +29,7 @@
*
* @ExclusionPolicy("all")
*/
class User extends ApiEntity implements UserInterface, Serializable, EquatableInterface, PasswordAuthenticatedUserInterface
class User extends ApiEntity implements UserInterface, EquatableInterface, PasswordAuthenticatedUserInterface
{
/**
* @var int
Expand Down Expand Up @@ -301,41 +300,6 @@ public function eraseCredentials()
{
}

/**
* Serializes the user just with the id, as it is enough.
*
* @see http://php.net/manual/en/serializable.serialize.php
*
* @return string The string representation of the object or null
*/
public function serialize()
{
return \serialize(
[
$this->id,
$this->password,
$this->salt,
$this->username,
$this->locked,
$this->enabled,
]
);
}

/**
* Constructs the object.
*
* @see http://php.net/manual/en/serializable.unserialize.php
*
* @param string $serialized The string representation of the object
*/
public function unserialize($serialized)
{
list(
$this->id, $this->password, $this->salt, $this->username, $this->locked, $this->enabled
) = \unserialize($serialized);
}

/**
* Set apiKey.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Sulu/Component/Webspace/Manager/WebspaceManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ public function getPortalInformations(?string $environment = null): array
return $this->getWebspaceCollection()->getPortalInformations($environment);
}

public function getPortalInformationsByWebspaceKey(?string $environment = null, string $webspaceKey): array
public function getPortalInformationsByWebspaceKey(?string $environment, string $webspaceKey): array
{
if (null === $environment) {
$environment = $this->environment;
Expand Down

0 comments on commit c3a19eb

Please sign in to comment.