Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
matrix:
php:
- '8.3'
- '8.4'

steps:
- uses: actions/checkout@v5
Expand Down Expand Up @@ -90,6 +91,7 @@ jobs:
matrix:
php:
- '8.3'
- '8.4'
image:
- 'postgres:14'
- 'postgres:18'
Expand Down Expand Up @@ -141,6 +143,7 @@ jobs:
matrix:
php:
- '8.3'
- '8.4'
image:
- 'mysql:8.0'
- 'mysql:8.4'
Expand Down Expand Up @@ -192,6 +195,7 @@ jobs:
matrix:
php:
- '8.3'
- '8.4'
steps:
- uses: actions/checkout@v5
with:
Expand Down
67 changes: 67 additions & 0 deletions phpstan-baseline-8.3.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
parameters:
ignoreErrors:
-
message: '#^Dead catch \- Ibexa\\Contracts\\Core\\Repository\\Exceptions\\NotFoundException is never thrown in the try block\.$#'
identifier: catch.neverThrown
count: 1
path: src/bundle/Core/Features/Context/ContentTypeContext.php

-
message: '#^Dead catch \- Ibexa\\Contracts\\Core\\Repository\\Exceptions\\NotFoundException is never thrown in the try block\.$#'
identifier: catch.neverThrown
count: 1
path: src/bundle/Core/Features/Context/UserContext.php

-
message: '#^Dead catch \- Doctrine\\DBAL\\Exception is never thrown in the try block\.$#'
identifier: catch.neverThrown
count: 1
path: src/lib/Persistence/Legacy/Notification/Gateway/ExceptionConversion.php

-
message: '#^Dead catch \- PDOException is never thrown in the try block\.$#'
identifier: catch.neverThrown
count: 1
path: src/lib/Persistence/Legacy/Notification/Gateway/ExceptionConversion.php

-
message: '#^Dead catch \- Doctrine\\DBAL\\Exception is never thrown in the try block\.$#'
identifier: catch.neverThrown
count: 1
path: src/lib/Persistence/Legacy/URL/Gateway/ExceptionConversion.php

-
message: '#^Dead catch \- PDOException is never thrown in the try block\.$#'
identifier: catch.neverThrown
count: 1
path: src/lib/Persistence/Legacy/URL/Gateway/ExceptionConversion.php

-
message: '#^Dead catch \- Exception is never thrown in the try block\.$#'
identifier: catch.neverThrown
count: 1
path: src/lib/Repository/UserPreferenceService.php

-
message: '#^Dead catch \- Doctrine\\DBAL\\Exception is never thrown in the try block\.$#'
identifier: catch.neverThrown
count: 1
path: src/lib/Search/Legacy/Content/Gateway/ExceptionConversion.php

-
message: '#^Dead catch \- PDOException is never thrown in the try block\.$#'
identifier: catch.neverThrown
count: 1
path: src/lib/Search/Legacy/Content/Gateway/ExceptionConversion.php

-
message: '#^Dead catch \- Doctrine\\DBAL\\Exception is never thrown in the try block\.$#'
identifier: catch.neverThrown
count: 1
path: src/lib/Search/Legacy/Content/Location/Gateway/ExceptionConversion.php

-
message: '#^Dead catch \- PDOException is never thrown in the try block\.$#'
identifier: catch.neverThrown
count: 1
path: src/lib/Search/Legacy/Content/Location/Gateway/ExceptionConversion.php
37 changes: 37 additions & 0 deletions phpstan-baseline-8.4.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
parameters:
ignoreErrors:
-
message: '#^Cannot unset property Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Location\:\:\$id because it might have hooks in a subclass\.$#'
identifier: unset.possiblyHookedProperty
count: 1
path: tests/lib/Repository/Values/Content/LocationTest.php

-
message: '#^Cannot unset property Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Location\:\:\$id because it might have hooks in a subclass\.$#'
identifier: unset.possiblyHookedProperty
count: 1
path: tests/lib/Repository/Values/Content/TrashItemTest.php

-
message: '#^Cannot unset property Ibexa\\Contracts\\Core\\Repository\\Values\\User\\Policy\:\:\$id because it might have hooks in a subclass\.$#'
identifier: unset.possiblyHookedProperty
count: 1
path: tests/lib/Repository/Values/User/PolicyTest.php

-
message: '#^Cannot unset property Ibexa\\Contracts\\Core\\Repository\\Values\\User\\Role\:\:\$id because it might have hooks in a subclass\.$#'
identifier: unset.possiblyHookedProperty
count: 1
path: tests/lib/Repository/Values/User/RoleTest.php

-
message: '#^Cannot unset property Ibexa\\Contracts\\Core\\Repository\\Values\\User\\UserGroup\:\:\$parentId because it might have hooks in a subclass\.$#'
identifier: unset.possiblyHookedProperty
count: 1
path: tests/lib/Repository/Values/User/UserGroupTest.php

-
message: '#^Cannot unset property Ibexa\\Contracts\\Core\\Repository\\Values\\User\\User\:\:\$login because it might have hooks in a subclass\.$#'
identifier: unset.possiblyHookedProperty
count: 1
path: tests/lib/Repository/Values/User/UserTest.php
66 changes: 0 additions & 66 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2292,12 +2292,6 @@ parameters:
count: 1
path: src/bundle/Core/Features/Context/ContentTypeContext.php

-
message: '#^Dead catch \- Ibexa\\Contracts\\Core\\Repository\\Exceptions\\NotFoundException is never thrown in the try block\.$#'
identifier: catch.neverThrown
count: 1
path: src/bundle/Core/Features/Context/ContentTypeContext.php

-
message: '#^Method Ibexa\\Bundle\\Core\\Features\\Context\\ContentTypeContext\:\:assertContentTypeDoesntExistsByIdentifier\(\) has no return type specified\.$#'
identifier: missingType.return
Expand Down Expand Up @@ -2748,12 +2742,6 @@ parameters:
count: 1
path: src/bundle/Core/Features/Context/RoleContext.php

-
message: '#^Dead catch \- Ibexa\\Contracts\\Core\\Repository\\Exceptions\\NotFoundException is never thrown in the try block\.$#'
identifier: catch.neverThrown
count: 1
path: src/bundle/Core/Features/Context/UserContext.php

-
message: '#^Method Ibexa\\Bundle\\Core\\Features\\Context\\UserContext\:\:assertUserWithNameDoesntExist\(\) has no return type specified\.$#'
identifier: missingType.return
Expand Down Expand Up @@ -15000,18 +14988,6 @@ parameters:
count: 1
path: src/lib/Persistence/Legacy/Notification/Gateway/DoctrineDatabase.php

-
message: '#^Dead catch \- Doctrine\\DBAL\\Exception is never thrown in the try block\.$#'
identifier: catch.neverThrown
count: 1
path: src/lib/Persistence/Legacy/Notification/Gateway/ExceptionConversion.php

-
message: '#^Dead catch \- PDOException is never thrown in the try block\.$#'
identifier: catch.neverThrown
count: 1
path: src/lib/Persistence/Legacy/Notification/Gateway/ExceptionConversion.php

-
message: '#^Method Ibexa\\Core\\Persistence\\Legacy\\Notification\\Mapper\:\:extractNotificationFromRow\(\) has parameter \$row with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
Expand Down Expand Up @@ -15240,18 +15216,6 @@ parameters:
count: 1
path: src/lib/Persistence/Legacy/URL/Gateway/DoctrineDatabase.php

-
message: '#^Dead catch \- Doctrine\\DBAL\\Exception is never thrown in the try block\.$#'
identifier: catch.neverThrown
count: 1
path: src/lib/Persistence/Legacy/URL/Gateway/ExceptionConversion.php

-
message: '#^Dead catch \- PDOException is never thrown in the try block\.$#'
identifier: catch.neverThrown
count: 1
path: src/lib/Persistence/Legacy/URL/Gateway/ExceptionConversion.php

-
message: '#^Method Ibexa\\Core\\Persistence\\Legacy\\URL\\Gateway\\ExceptionConversion\:\:findUsages\(\) return type has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
Expand Down Expand Up @@ -17916,12 +17880,6 @@ parameters:
count: 1
path: src/lib/Repository/User/PasswordValidator.php

-
message: '#^Dead catch \- Exception is never thrown in the try block\.$#'
identifier: catch.neverThrown
count: 1
path: src/lib/Repository/UserPreferenceService.php

-
message: '#^Call to an undefined method Ibexa\\Contracts\\Core\\Repository\\ContentService\:\:internalLoadContentById\(\)\.$#'
identifier: method.notFound
Expand Down Expand Up @@ -19434,18 +19392,6 @@ parameters:
count: 1
path: src/lib/Search/Legacy/Content/Gateway/DoctrineDatabase.php

-
message: '#^Dead catch \- Doctrine\\DBAL\\Exception is never thrown in the try block\.$#'
identifier: catch.neverThrown
count: 1
path: src/lib/Search/Legacy/Content/Gateway/ExceptionConversion.php

-
message: '#^Dead catch \- PDOException is never thrown in the try block\.$#'
identifier: catch.neverThrown
count: 1
path: src/lib/Search/Legacy/Content/Gateway/ExceptionConversion.php

-
message: '#^Method Ibexa\\Core\\Search\\Legacy\\Content\\Gateway\\ExceptionConversion\:\:find\(\) has parameter \$languageFilter with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
Expand Down Expand Up @@ -19722,18 +19668,6 @@ parameters:
count: 1
path: src/lib/Search/Legacy/Content/Location/Gateway/DoctrineDatabase.php

-
message: '#^Dead catch \- Doctrine\\DBAL\\Exception is never thrown in the try block\.$#'
identifier: catch.neverThrown
count: 1
path: src/lib/Search/Legacy/Content/Location/Gateway/ExceptionConversion.php

-
message: '#^Dead catch \- PDOException is never thrown in the try block\.$#'
identifier: catch.neverThrown
count: 1
path: src/lib/Search/Legacy/Content/Location/Gateway/ExceptionConversion.php

-
message: '#^Method Ibexa\\Core\\Search\\Legacy\\Content\\Location\\Gateway\\ExceptionConversion\:\:find\(\) has parameter \$languageFilter with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
Expand Down
19 changes: 19 additions & 0 deletions phpstan-baseline.neon.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

$includes = [];
if (PHP_VERSION_ID < 80400) {
$includes[] = __DIR__ . '/phpstan-baseline-8.3.neon';
} else {
$includes[] = __DIR__ . '/phpstan-baseline-8.4.neon';
}

$config = [];
$config['includes'] = $includes;

return $config;
1 change: 1 addition & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ includes:
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-symfony/extension.neon
- phpstan-baseline.neon
- phpstan-baseline.neon.php
- phpstan-baseline.pagerfanta.neon

parameters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@ protected function setUp(): void
);
}

protected function tearDown(): void
{
unset($this->persistenceMock, $this->searchMock, $this->listener);
parent::tearDown();
}

public function testGetSubscribedEvents()
{
self::assertSame(
Expand Down
20 changes: 0 additions & 20 deletions tests/lib/Persistence/Cache/AbstractBaseHandlerTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,26 +127,6 @@ static function ($key, $value, $isHit, $defaultLifetime = 0) {
);
}

/**
* Tear down test (properties).
*/
protected function tearDown(): void
{
unset(
$this->cacheMock,
$this->persistenceHandlerMock,
$this->persistenceCacheHandler,
$this->loggerMock,
$this->cacheItemsClosure,
$this->inMemoryMock,
$this->cacheIdentifierGeneratorMock,
$this->cacheIdentifierSanitizer,
$this->locationPathConverter
);

parent::tearDown();
}

/**
* @param $key
* @param null $value If null the cache item will be assumed to be a cache miss here.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,6 @@ static function ($key, $value, $isHit, $defaultLifetime = 0, $tags = []) {
);
}

/**
* Tear down test (properties).
*/
protected function tearDown(): void
{
unset($this->cache);
unset($this->innerPool);
unset($this->inMemory);

parent::tearDown();
}

public function testGetItem()
{
$item = $this->createCacheItem('first');
Expand Down
1 change: 0 additions & 1 deletion tests/lib/Persistence/Cache/InMemory/InMemoryCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ protected function tearDown(): void
{
$this->cache->clear();

unset($this->cache);
unset($GLOBALS['override_time']);
parent::tearDown();
}
Expand Down
6 changes: 0 additions & 6 deletions tests/lib/Persistence/Cache/PersistenceLoggerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ protected function setUp(): void
$this->logger = new PersistenceLogger();
}

protected function tearDown(): void
{
unset($this->logger);
parent::tearDown();
}

public function testGetName(): void
{
self::assertEquals(PersistenceLogger::NAME, $this->logger->getName());
Expand Down
5 changes: 0 additions & 5 deletions tests/lib/Persistence/Legacy/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,6 @@ protected function setUp(): void
}
}

protected function tearDown(): void
{
unset($this->connection);
}

/**
* Get a text representation of a result set.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@ protected function setUp(): void
);
}

protected function tearDown(): void
{
unset($this->service);
unset($this->languageResolverMock);
unset($this->innerApiServiceMock);
parent::tearDown();
}

/**
* @return array See signature on {@link testForPassTrough} for arguments and their type.
*/
Expand Down
Loading