prooph / psr7-middleware

Consume prooph messages with a PSR7 middleware
http://getprooph.org/
BSD 3-Clause "New" or "Revised" License
14 stars 8 forks source link

Service Prooph\Psr7Middleware\CommandMiddleware did not to resolve to a Psr\Http\Server\MiddlewareInterface #36

Closed manuakasam closed 6 years ago

manuakasam commented 6 years ago

Hey guys,

I've just been following the prooph video tutorial over on youtube. Inside he's using the Psr7Middleware.

While using the most current Expressive default installation I'm running into the issue that the CommandMiddleware cannot be instantiated properly as it does not comform with the most current standard that is Psr\Http\Server\MiddlewareInterface.

Upon further inspection I assume this requires an update of the underlying package webimpress/http-middleware-compatibility as I do not see him handling the case inside the package.

Locally this can be solved by class_alias the CommandMiddleware to have the proper interface and structure but I suppose an update either here or on the side of webimpress should be done. If I am overlooking something please let me know, I'll gladly provide more info or PRs where required :)

basz commented 6 years ago

as far as I'm aware the webimpress/http-middleware-compatibility is now deprecated. We have update our dependencies to use the now stable releasee of psr/http-message:^1.0.

What does compose show tell us version wise?

I suspect you simply need to upgrade...

manuakasam commented 6 years ago

I might be looking at the wrong places but current master here suggests otherwise 🤔

https://github.com/prooph/psr7-middleware/blob/master/composer.json#L49 and https://github.com/prooph/psr7-middleware/blob/master/src/CommandMiddleware.php#L22

Aside from that this is my composer output

beberlei/assert                                v2.9.6             Thin assertion library for input validation in business models.
container-interop/container-interop            1.2.0              Promoting the interoperability of container objects (DIC, SL, etc.)
doctrine/instantiator                          1.1.0              A small, lightweight utility to instantiate objects in PHP without invoking their constructors
fig/http-message-util                          1.1.2              Utility classes and constants for use with PSR-7 (psr/http-message)
filp/whoops                                    2.2.0              php error handling for cool kids
http-interop/http-middleware                   0.5.0              Common interface for HTTP server-side middleware
marc-mabe/php-enum                             v3.0.1             Simple and fast implementation of enumerations with native PHP>=5.6
myclabs/deep-copy                              1.8.1              Create deep copies (clones) of your objects
nikic/fast-route                               v1.3.0             Fast request router for PHP
ocramius/package-versions                      1.3.0              Composer plugin that provides efficient querying for installed package versions (no runtime IO)
paragonie/random_compat                        v9.99.99           PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
phar-io/manifest                               1.0.3              Component for reading phar.io manifest information from a PHP Archive (PHAR)
phar-io/version                                2.0.1              Library for handling version information and constraints
phpdocumentor/reflection-common                1.0.1              Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock              4.3.0              With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded i...
phpdocumentor/type-resolver                    0.4.0
phpspec/prophecy                               1.7.6              Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage                      6.0.7              Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator                      2.0.1              FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-text-template                      1.2.1              Simple template engine.
phpunit/php-timer                              2.0.0              Utility class for timing
phpunit/php-token-stream                       3.0.0              Wrapper around PHP's tokenizer extension.
phpunit/phpunit                                7.2.7              The PHP Unit Testing framework.
prooph/common                                  v4.2.2             Common classes used across prooph packages
prooph/event-sourcing                          v5.6.0             PHP EventSourcing library
prooph/event-store                             v7.3.7             PHP EventStore Implementation
prooph/event-store-bus-bridge                  v3.2.0             Marry CQRS with Event Sourcing
prooph/pdo-event-store                         v1.9.0             Prooph PDO EventStore
prooph/pdo-snapshot-store                      v1.5.1             PDO Snapshot Store Implementation
prooph/psr7-middleware                         v0.8               PSR-7 Middleware for prooph components
prooph/service-bus                             v6.2.2             PHP Enterprise Service Bus Implementation supporting CQRS and DDD
prooph/snapshot-store                          v1.3.0             Prooph Snapshot Store
prooph/snapshotter                             v2.1.0             snapshot tool for prooph event-store
psr/container                                  1.0.0              Common Container Interface (PHP FIG PSR-11)
psr/http-message                               1.0.1              Common interface for HTTP messages
psr/http-server-handler                        1.0.0              Common interface for HTTP server-side request handler
psr/http-server-middleware                     1.0.0              Common interface for HTTP server-side middleware
psr/log                                        1.0.2              Common interface for logging libraries
ramsey/uuid                                    3.8.0              Formerly rhumsaa/uuid. A PHP 5.4+ library for generating RFC 4122 version 1, 3, 4, and 5 universally unique identifiers (UUID).
react/promise                                  v2.7.0             A lightweight implementation of CommonJS Promises/A for PHP
roave/security-advisories                      dev-master 053766d Prevents installation of composer packages with known security vulnerabilities: no API, simply require it
sandrokeil/interop-config                      2.1.0              Provides interfaces and a concrete implementation to create instances depending on configuration via factory classes and ensures a va...
sebastian/code-unit-reverse-lookup             1.0.1              Looks up which function or method a line of code belongs to
sebastian/comparator                           3.0.2              Provides the functionality to compare PHP values for equality
sebastian/diff                                 3.0.1              Diff implementation
sebastian/environment                          3.1.0              Provides functionality to handle HHVM/PHP environments
sebastian/exporter                             3.1.0              Provides the functionality to export PHP variables for visualization
sebastian/global-state                         2.0.0              Snapshotting of global state
sebastian/object-enumerator                    3.0.3              Traverses array structures and object graphs to enumerate all referenced objects
sebastian/object-reflector                     1.1.1              Allows reflection of object attributes, including inherited and non-public ones
sebastian/recursion-context                    3.0.0              Provides functionality to recursively process PHP variables
sebastian/resource-operations                  1.0.0              Provides a list of PHP built-in functions that operate on resources
sebastian/version                              2.0.1              Library that helps with managing the version number of Git-hosted PHP projects
squizlabs/php_codesniffer                      2.9.1              PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.
symfony/console                                v4.1.1             Symfony Console Component
symfony/polyfill-ctype                         v1.8.0             Symfony polyfill for ctype functions
symfony/polyfill-mbstring                      v1.8.0             Symfony polyfill for the Mbstring extension
theseer/tokenizer                              1.1.0              A small library for converting tokenized PHP source code into XML and potentially other formats
webimpress/composer-extra-dependency           0.2.2              Composer plugin to require extra dependencies
webimpress/http-middleware-compatibility       0.1.4              Compatibility library for Draft PSR-15 HTTP Middleware
webmozart/assert                               1.3.0              Assertions to validate method input/output with nice error messages.
zendframework/zend-code                        3.3.0              provides facilities to generate arbitrary code using an object oriented interface
zendframework/zend-component-installer         2.1.1              Composer plugin for automating component registration in zend-mvc and Expressive applications
zendframework/zend-config-aggregator           1.1.1              Lightweight library for collecting and merging configuration from different sources
zendframework/zend-diactoros                   1.8.2              PSR HTTP Message implementations
zendframework/zend-escaper                     2.6.0              Securely and safely escape HTML, HTML attributes, JavaScript, CSS, and URLs
zendframework/zend-eventmanager                3.2.1              Trigger and listen to events within a PHP application
zendframework/zend-expressive                  3.0.2              PSR-15 Middleware Microframework
zendframework/zend-expressive-fastroute        3.0.1              FastRoute integration for Expressive
zendframework/zend-expressive-helpers          5.1.0              Helper/Utility classes for Expressive
zendframework/zend-expressive-router           3.1.0              Router subcomponent for Expressive
zendframework/zend-expressive-template         2.0.0              Template subcomponent for Expressive
zendframework/zend-expressive-tooling          1.0.1              Migration and development tooling for Expressive
zendframework/zend-expressive-zendviewrenderer 2.0.0              zend-view PhpRenderer integration for Expressive
zendframework/zend-httphandlerrunner           1.0.1              Execute PSR-15 RequestHandlerInterface instances and emit responses they generate.
zendframework/zend-loader                      2.6.0              Autoloading and plugin loading strategies
zendframework/zend-servicemanager              3.3.2              Factory-Driven Dependency Injection Container
zendframework/zend-stdlib                      3.2.0              SPL extensions, array utilities, error handlers, and more
zendframework/zend-stratigility                3.0.1              PSR-7 middleware foundation for building and dispatching middleware pipelines
zendframework/zend-view                        2.10.0             provides a system of helpers, output filters, and variable escaping
zfcampus/zf-composer-autoloading               2.1.0              Sets up Composer-based autoloading for your Zend Framework modules
zfcampus/zf-development-mode                   3.2.0              Zend Framework development mode script
basz commented 6 years ago

did you see this https://github.com/prooph/psr7-middleware#deprecated ?

manuakasam commented 6 years ago

Nope. As I haven't checked that readme by following the tutorial. That's been the whole issue. Thanks again for the guidance :-*