Skip to content

Commit 272fd0f

Browse files
authored
Add laminas-servicemanager:v4 compatibility (#65)
1 parent 421ae11 commit 272fd0f

File tree

5 files changed

+21
-24
lines changed

5 files changed

+21
-24
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
DOCKER_PHP_EXEC := docker compose run php
1+
DOCKER_PHP_EXEC := docker compose run --rm php
22
PHP_BIN=php -d zend.assertions=1
33

44
all: csfix static-analysis test

composer.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
],
2020
"require": {
2121
"php": "~8.2.0 || ~8.3.0",
22-
"phpstan/phpstan": "^1.11.9"
22+
"phpstan/phpstan": "^1.11.10"
2323
},
2424
"require-dev": {
2525
"laminas/laminas-cache": "^3.12.2",
2626
"laminas/laminas-cache-storage-adapter-memory": "^2.3.0",
27-
"laminas/laminas-filter": "^2.36.0",
27+
"laminas/laminas-filter": "^2.37.0",
2828
"laminas/laminas-form": "^3.20.0",
2929
"laminas/laminas-hydrator": "^4.15.0",
3030
"laminas/laminas-i18n": "^2.28.0",
@@ -39,17 +39,17 @@
3939
"slam/php-cs-fixer-extensions": "^3.11.1"
4040
},
4141
"conflict": {
42-
"laminas/laminas-cache": "<3.9",
43-
"laminas/laminas-filter": "<2.29",
44-
"laminas/laminas-form": "<3.8",
45-
"laminas/laminas-hydrator": "<4.10",
46-
"laminas/laminas-i18n": "<2.21",
47-
"laminas/laminas-inputfilter": "<2.22",
42+
"laminas/laminas-cache": "<3.12",
43+
"laminas/laminas-filter": "<2.37",
44+
"laminas/laminas-form": "<3.20",
45+
"laminas/laminas-hydrator": "<4.15",
46+
"laminas/laminas-i18n": "<2.28",
47+
"laminas/laminas-inputfilter": "<2.30",
4848
"laminas/laminas-log": "<2.16",
49-
"laminas/laminas-mail": "<2.21",
50-
"laminas/laminas-mvc": "<3.6",
51-
"laminas/laminas-paginator": "<2.17",
52-
"laminas/laminas-validator": "<2.28"
49+
"laminas/laminas-mail": "<2.25",
50+
"laminas/laminas-mvc": "<3.7",
51+
"laminas/laminas-paginator": "<2.18",
52+
"laminas/laminas-validator": "<2.64"
5353
},
5454
"autoload": {
5555
"psr-4": {

src/UnmappedAliasServiceLocatorProxy.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,18 @@ public function get($id)
3333
return $this->serviceLocator->get($this->knownUnmappedAliasToClassServices[$id] ?? $id);
3434
}
3535

36-
public function has($id)
36+
public function has($id): bool
3737
{
3838
return $this->serviceLocator->has($id)
3939
|| $this->serviceLocator->has($this->knownUnmappedAliasToClassServices[$id] ?? $id);
4040
}
4141

4242
/**
43-
* @param string $name
44-
* @param null|array<mixed> $options
45-
*
46-
* @return mixed|void
43+
* {@inheritDoc}
4744
*
4845
* @throws ShouldNotHappenException
4946
*/
50-
public function build($name, ?array $options = null)
47+
public function build($name, ?array $options = null): mixed
5148
{
5249
throw new ShouldNotHappenException(\sprintf('Why did you call %s?', __METHOD__));
5350
}

tests/LaminasIntegration/data/stdlibAbstractOptionsProperties.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function mainLibrary(): void
2424

2525
public function custom(): void
2626
{
27-
$class = new class() extends AbstractOptions {
27+
$class = new class extends AbstractOptions {
2828
private string $myxyz = 'foo';
2929

3030
public function getMyxyz(string $var): string
@@ -42,7 +42,7 @@ public function getMyxyz(string $var): string
4242

4343
public function notAbstractOptionsImplementation(): void
4444
{
45-
$class = new class() {
45+
$class = new class {
4646
public function getMyxyz(string $var): string
4747
{
4848
return $var;

tests/LaminasIntegration/servicemanagerloader.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
$app = Application::init([
1717
'modules' => [
1818
'Laminas\Router',
19-
'LaminasPhpStan' => new class() implements ConfigProviderInterface {
19+
'LaminasPhpStan' => new class implements ConfigProviderInterface {
2020
/** @return array<string, array<string, array<string, array<string, string>|Closure|string>>> */
2121
public function getConfig(): array
2222
{
@@ -33,10 +33,10 @@ public function getConfig(): array
3333
'factories' => [
3434
HeavyService::class => InvokableFactory::class,
3535
'foo_proxy' => static function (): FooService {
36-
return new class() extends FooService {};
36+
return new class extends FooService {};
3737
},
3838
'foo_impl' => static function (): FooInterface {
39-
return new class() implements FooInterface {
39+
return new class implements FooInterface {
4040
public function isFoo(): bool
4141
{
4242
return true;

0 commit comments

Comments
 (0)