-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
T12295 psr 11 #13681
T12295 psr 11 #13681
Conversation
* 4.0.x: (33 commits) [4.0.x] - Another correction to the test Corrected test Fixed tests Removed obsolete file Fixed the method signature PHPCS fix Fixed tabs Corrected tests [#12833] - Updated the changelog [#12833] - Deleted obsolete tests [#12833] - PHPCS fixes [#12833] - Corrections to the manager and test (cleanup superglobal on destroy) [#12833] - Fixes and corrections to the tests [#12833] - Corrections to the tests and files adapter [#12833] - Fixed tests; Added exception in session for non valid handler [#12833] - Full tests for Session\Adapter; Adjustments to the environment; Test stubs [#12833] - Corrections and adding files adapter tests [#12833] - Correction to the redis session adapter; Work on the test traits [#12833] - Setup default session_save path to /tmp [#12833] - Cleanup for tests ...
cc @sergeyklay |
$container = new Di(); | ||
$class = ContainerInterface::class; | ||
$actual = new Container($container); | ||
$I->assertInstanceOf($class, $actual); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be simplified, eg
$I->assertInstanceOf(ContainerInterface::class, new Container(new Di));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like to keep things separate in the test; It makes reading a bit easier and discourages people writing an assertion that is long and difficult to understand.
phalcon/container.zep
Outdated
use Psr\Container\ContainerInterface; | ||
use Phalcon\DiInterface; | ||
|
||
final class Container implements ContainerInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need this as final
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, Let me correct that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hello!
In raising this pull request, I confirm the following (please check boxes):
Created a new "proxy" class
Phalcon\Container
. This class implements PSR-11 and can be used instead of theDI
container. Note that you still have to create the DI container and set all services into it and then inject that container in this container (I got dizzy writing this).This is not the full implementation, a "proxy" for now - more on that in a future version.
Thanks