Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register missing PSR interfaces to services #16696

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from
Open
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
18 changes: 18 additions & 0 deletions core/src/Revolution/modX.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@
use PDOStatement;
use Psr\Http\Client\ClientInterface;
use Psr\Http\Message\RequestFactoryInterface;
use Psr\Http\Message\ResponseFactoryInterface;
use Psr\Http\Message\ServerRequestFactoryInterface;
use Psr\Http\Message\StreamFactoryInterface;
use Psr\Http\Message\UploadedFileFactoryInterface;
use Psr\Http\Message\UriFactoryInterface;
use xPDO\Cache\xPDOFileCache;
use xPDO\xPDO;
use xPDO\xPDOException;
Expand Down Expand Up @@ -2478,7 +2481,7 @@
}

$deprecation = $this->_getDeprecatedMethod($since, $deprecatedDef, $recommendation);
$deprecation->addCaller($caller['class'] ?? '', $caller['function'] ?? '', $deprecatedMethod['file'], $deprecatedMethod['line']);

Check warning on line 2484 in core/src/Revolution/modX.php

View workflow job for this annotation

GitHub Actions / phpcs

Line exceeds 120 characters; contains 137 characters
}

/**
Expand Down Expand Up @@ -2742,11 +2745,26 @@
return new HttpFactory();
});
}
if (!$this->services->has(ResponseFactoryInterface::class)) {
$this->services->add(ResponseFactoryInterface::class, function() {
return new HttpFactory();
});
}
if (!$this->services->has(StreamFactoryInterface::class)) {
$this->services->add(StreamFactoryInterface::class, function() {
return new HttpFactory();
});
}
if (!$this->services->has(UploadedFileFactoryInterface::class)) {
$this->services->add(UploadedFileFactoryInterface::class, function() {
return new HttpFactory();
});
}
if (!$this->services->has(UriFactoryInterface::class)) {
$this->services->add(UriFactoryInterface::class, function() {
return new HttpFactory();
});
}
}

/**
Expand Down
Loading