jolicode / slack-php-api

:hash: PHP Slack Client based on the official OpenAPI specification
https://jolicode.github.io/slack-php-api/
MIT License
222 stars 56 forks source link

php-http/discovery fails to find PSR18ClientDiscovery #70

Closed Root3287 closed 4 years ago

Root3287 commented 4 years ago

Code:

<?php 
namespace Spine\Slack\classes;
class UserUpdateEvent{
    public function updated($model){
        $token = \Root3287\models\Settings::where("key", "slack.oauth")->first()->value;
        $client = \JoliCode\Slack\ClientFactory::create($token);
        // $form, Headers
        $error = $client->usersProfileSet([
            "profile" => json_encode([
                "status_text" => $model->status,
                "status_emoji" => $model->status_text,
                "status_expire" => 0
            ]),
        ]);
    }
}?>

Stacktrace:

Details
Type: Http\Discovery\Exception\ClassInstantiationFailedException
Code: 0
Message: Unexpected exception when instantiating class.
File: /home/timothy/git/Spine/vendor/php-http/discovery/src/ClassDiscovery.php
Line: 210
Trace

#0 /home/timothy/git/Spine/vendor/php-http/discovery/src/Psr18ClientDiscovery.php(30): Http\Discovery\ClassDiscovery::instantiateClass(Array)
#1 /home/timothy/git/Spine/vendor/jolicode/slack-php-api/src/ClientFactory.php(30): Http\Discovery\Psr18ClientDiscovery::find()
#2 /home/timothy/git/Spine/modules/Slack/classes/UserUpdateEvent.php(6): JoliCode\Slack\ClientFactory::create('xoxb-7615521273...')
#3 [internal function]: Spine\Slack\classes\UserUpdateEvent->updated(Object(Root3287\models\Users))

Installed Packages:

almasaeed2010/adminlte                dev-master 0e48302 AdminLTE - admin control panel and dashboard that's based on Bootstrap 4
clue/stream-filter                    v1.4.1             A simple and modern approach to stream filtering in PHP
composer/installers                   v1.7.0             A multi-framework Composer library installer
doctrine/inflector                    1.3.1              Common String Manipulations with regard to casing and singular/plural rules.
duosecurity/duo_php                   1.0.1              A PHP implementation of the Duo Web SDK.
fgrosse/phpasn1                       v2.1.1             A PHP Framework that allows you to encode and decode arbitrary ASN.1 structures using the ITU-T X.690 Encoding Rules.
fig/http-message-util                 1.1.3              Utility classes and constants for use with PSR-7 (psr/http-message)
firebase/php-jwt                      v5.0.0             A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.
illuminate/container                  v6.11.0            The Illuminate Container package.
illuminate/contracts                  v6.11.0            The Illuminate Contracts package.
illuminate/database                   v6.11.0            The Illuminate Database package.
illuminate/events                     v6.11.0            The Illuminate Events package.
illuminate/support                    v6.11.0            The Illuminate Support package.
jane-php/json-schema-runtime          v4.5.4             Jane runtime Library
jane-php/open-api-runtime             v4.5.4             Jane OpenAPI Runtime Library, dependencies and utility class for a library generated by jane/openapi
jeremeamia/superclosure               2.4.0              Serialize Closure objects, including their context and binding
jolicode/slack-php-api                2.3.0              An up to date PHP client for Slack's API
kanellov/slim-twig-flash              0.2.0              A Twig extension to access Slim Flash messages in templates
league/uri                            5.3.0              URI manipulation library
league/uri-components                 1.8.2              URI components manipulation library
league/uri-hostname-parser            1.1.1              ICANN base hostname parsing implemented in PHP.
league/uri-interfaces                 1.1.1              Common interface for URI representation
league/uri-manipulations              1.5.0              URI manipulation library
league/uri-parser                     1.4.1              userland URI parser RFC 3986 compliant
league/uri-schemes                    1.2.1              URI manipulation library
nesbot/carbon                         2.28.0             An API extension for DateTime that supports 281 different languages.
nikic/fast-route                      v1.3.0             Fast request router for PHP
nikic/php-parser                      v4.3.0             A PHP parser written in PHP
npm-asset/bootstrap                   4.4.1             
npm-asset/bootstrap-icons             1.0.0-alpha2      
npm-asset/bootswatch                  4.4.1             
npm-asset/chart.js                    2.9.3             
npm-asset/chartjs-color               2.4.1             
npm-asset/chartjs-color-string        0.6.0             
npm-asset/color-convert               1.9.3             
npm-asset/color-name                  1.1.3             
npm-asset/font-awesome                5.12.0            
npm-asset/ionicons                    5.0.0-patch15     
npm-asset/jquery                      3.4.1             
npm-asset/moment                      2.24.0            
npm-asset/popper.js                   v2.0.0-patch.17   
npm-asset/toastr                      2.1.4             
oomphinc/composer-installers-extender v1.1.2             Extend the composer/installers plugin to accept any arbitrary package type.
php-di/invoker                        2.0.0              Generic and extensible callable invoker
php-di/php-di                         6.0.11             The dependency injection container for humans
php-di/phpdoc-reader                  2.1.1              PhpDocReader parses @var and @param values in PHP docblocks (supports namespaced class names with the same resolution rules as PHP)
php-http/client-common                2.1.0              Common HTTP Client implementations and tools for HTTPlug
php-http/curl-client                  2.1.0              PSR-18 and HTTPlug Async client with cURL
php-http/discovery                    1.7.4              Finds installed HTTPlug implementations and PSR-7 message factories
php-http/httplug                      2.1.0              HTTPlug, the HTTP client abstraction for PHP
php-http/message                      1.8.0              HTTP Message related tools
php-http/message-factory              v1.0.2             Factory interfaces for PSR-7 HTTP Message
php-http/multipart-stream-builder     1.1.0              A builder class that help you create a multipart stream
php-http/promise                      v1.0.0             Promise used for asynchronous HTTP requests
php-jsonpointer/php-jsonpointer       v3.0.2             Implementation of JSON Pointer (http://tools.ietf.org/html/rfc6901)
psr/cache                             1.0.1              Common interface for caching libraries
psr/container                         1.0.0              Common Container Interface (PHP FIG PSR-11)
psr/event-dispatcher                  1.0.0              Standard interfaces for event handling.
psr/http-client                       1.0.0              Common interface for HTTP clients
psr/http-factory                      1.0.1              Common interfaces for PSR-7 HTTP message factories
psr/http-message                      1.0.1              Common interface for HTTP messages
psr/http-server-handler               1.0.1              Common interface for HTTP server-side request handler
psr/http-server-middleware            1.0.1              Common interface for HTTP server-side middleware
psr/log                               1.1.2              Common interface for logging libraries
psr/simple-cache                      1.0.1              Common interfaces for simple caching
ralouphie/getallheaders               3.0.3              A polyfill for getallheaders.
slim/csrf                             1.0.0              Slim Framework 4 CSRF protection PSR-15 middleware
slim/flash                            0.4.0              Slim Framework Flash message service provider
slim/psr7                             0.6                Strict PSR-7 implementation
slim/slim                             4.0.0              Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs
slim/twig-view                        3.x-dev 46bc497    Slim Framework 4 view helper built on top of the Twig (2 and 3) templating component
spomky-labs/aes-key-wrap              v5.0.0             AES Key Wrap for PHP.
spomky-labs/base64url                 v2.0.1             Base 64 URL Safe Encoding/Decoding PHP Library
symfony/cache                         v5.0.2             Symfony Cache component with PSR-6, PSR-16, and tags
symfony/cache-contracts               v2.0.1             Generic abstractions related to caching
symfony/config                        v5.0.2             Symfony Config Component
symfony/console                       v5.0.2             Symfony Console Component
symfony/dependency-injection          v5.0.2             Symfony DependencyInjection Component
symfony/error-handler                 v5.0.2             Symfony ErrorHandler Component
symfony/event-dispatcher              v5.0.2             Symfony EventDispatcher Component
symfony/event-dispatcher-contracts    v2.0.1             Generic abstractions related to dispatching event
symfony/filesystem                    v5.0.2             Symfony Filesystem Component
symfony/finder                        v5.0.2             Symfony Finder Component
symfony/framework-bundle              v5.0.2             Symfony FrameworkBundle
symfony/http-client                   v5.0.2             Symfony HttpClient component
symfony/http-client-contracts         v2.0.1             Generic abstractions related to HTTP clients
symfony/http-foundation               v5.0.2             Symfony HttpFoundation Component
symfony/http-kernel                   v5.0.2             Symfony HttpKernel Component
symfony/mime                          v5.0.2             A library to manipulate MIME messages
symfony/options-resolver              v5.0.2             Symfony OptionsResolver Component
symfony/polyfill-ctype                v1.13.1            Symfony polyfill for ctype functions
symfony/polyfill-intl-idn             v1.13.1            Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions
symfony/polyfill-mbstring             v1.13.1            Symfony polyfill for the Mbstring extension
symfony/polyfill-php56                v1.13.1            Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-php72                v1.13.1            Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
symfony/polyfill-php73                v1.13.1            Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions
symfony/polyfill-util                 v1.13.1            Symfony utilities for portability of PHP codes
symfony/routing                       v5.0.2             Symfony Routing Component
symfony/serializer                    v5.0.2             Symfony Serializer Component
symfony/service-contracts             v2.0.1             Generic abstractions related to writing services
symfony/translation                   v5.0.2             Symfony Translation Component
symfony/translation-contracts         v2.0.1             Generic abstractions related to translation
symfony/var-dumper                    v5.0.2             Symfony mechanism for exploring and dumping PHP variables
symfony/var-exporter                  v5.0.2             A blend of var_export() + serialize() to turn any serializable data structure to plain PHP code
symfony/yaml                          v5.0.2             Symfony Yaml Component
twig/extensions                       v1.5.4             Common additional features for Twig that do not directly belong in core
twig/twig                             v2.12.3            Twig, the flexible, fast, and secure template language for PHP
web-token/jwt-framework               v2.1.4             JSON Object Signing and Encryption library for PHP and Symfony Bundle.
wikimedia/composer-merge-plugin       v1.4.1             Composer plugin to merge multiple composer.json files
Root3287 commented 4 years ago

Probably doesn't belong here, as it's a PSR issue... But I'll just leave this here for others.