kreait / laravel-firebase

A Laravel package for the Firebase PHP Admin SDK
https://github.com/kreait/firebase-php
MIT License
992 stars 163 forks source link

Unresolvable dependency resolving #151

Closed friedrich-henrique closed 1 year ago

friedrich-henrique commented 1 year ago

Describe the issue you are experiencing

After trying to update from Laravel 8 to 9, I had encountered a bug related to this package.

> @php artisan package:discover --ansi

Illuminate\Contracts\Container\BindingResolutionException 

Unresolvable dependency resolving [Parameter #0 [ <required> string $projectId ]] in class Kreait\Firebase\Auth\ApiClient 

Installed packages

asm89/stack-cors                   v2.1.1             Cross-origin resource sharing library and stack middleware
bacon/bacon-qr-code                2.0.7              BaconQrCode is a QR code generator for PHP.
barryvdh/laravel-debugbar          v3.7.0             PHP Debugbar integration for Laravel
barryvdh/laravel-dompdf            v2.0.0             A DOMPDF Wrapper for Laravel
barryvdh/laravel-ide-helper        v2.12.3            Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.
barryvdh/reflection-docblock       v2.0.6            
beste/clock                        2.1.0              A collection of Clock implementations
beste/json                         1.0.0              A simple JSON helper to decode and encode JSON
brick/math                         0.10.2             Arbitrary-precision arithmetic library
composer/pcre                      3.0.0              PCRE wrapping library that offers type-safe preg_* replacements.
dasprid/enum                       1.0.3              PHP 7.1 enum implementation
dflydev/dot-access-data            v3.0.1             Given a deep data structure, access data by dot notation.
doctrine/cache                     2.2.0              PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcac...
doctrine/dbal                      3.4.4              Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.
doctrine/deprecations              v1.0.0             A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or s...
doctrine/event-manager             1.1.2              The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.
doctrine/inflector                 2.0.5              PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and sing...
doctrine/instantiator              1.4.1              A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer                     1.2.3              PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.
dompdf/dompdf                      v2.0.0             DOMPDF is a CSS 2.1 compliant HTML to PDF converter
dragonmantank/cron-expression      v3.3.2             CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due
egulias/email-validator            3.2.1              A library for validating emails against several RFCs
ezyang/htmlpurifier                v4.16.0            Standards compliant HTML filter written in PHP
fideloper/proxy                    4.4.2              Set trusted proxies for Laravel
fig/http-message-util              1.1.5              Utility classes and constants for use with PSR-7 (psr/http-message)
filp/whoops                        2.14.5             php error handling for cool kids
firebase/php-jwt                   v5.5.1             A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.
fruitcake/laravel-cors             v2.2.0             Adds CORS (Cross-Origin Resource Sharing) headers support in your Laravel application
fruitcake/php-cors                 v1.2.0             Cross-origin resource sharing library for the Symfony HttpFoundation
fzaninotto/faker                   dev-master 5ffe7db Faker is a PHP library that generates fake data for you.
google/auth                        v1.22.0            Google Auth Library for PHP
google/cloud-core                  v1.47.2            Google Cloud PHP shared dependency, providing functionality useful to all components.
google/cloud-storage               v1.28.1            Cloud Storage Client for PHP
google/crc32                       v0.1.0             Various CRC32 implementations
graham-campbell/result-type        v1.1.0             An Implementation Of The Result Type
guzzlehttp/guzzle                  7.5.0              Guzzle is a PHP HTTP client library
guzzlehttp/promises                1.5.2              Guzzle promises library
guzzlehttp/psr7                    2.4.1              PSR-7 message implementation that also provides common utility methods
hamcrest/hamcrest-php              v2.0.1             This is the PHP port of Hamcrest Matchers
ichtrojan/laravel-otp              v1.4.1             A simple package to generate and validate OTPs
kreait/firebase-php                6.8.0              Firebase Admin SDK
kreait/firebase-tokens             3.0.3              A library to work with Firebase tokens
kreait/laravel-firebase            dev-main 35bdebd   A Laravel package for the Firebase PHP Admin SDK
laravel/cashier                    v13.16.0           Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.
laravel/fortify                    v1.13.3            Backend controllers and scaffolding for Laravel authentication.
laravel/framework                  v9.31.0            The Laravel Framework.
laravel/sanctum                    v2.15.1            Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs.
laravel/serializable-closure       v1.2.2             Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.
laravel/tinker                     v2.7.2             Powerful REPL for the Laravel framework.
lcobucci/clock                     2.2.0              Yet another clock abstraction
lcobucci/jwt                       4.2.1              A simple library to work with JSON Web Token and JSON Web Signature
league/commonmark                  2.3.5              Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)
league/config                      v1.1.1             Define configuration arrays with strict schemas and access values with dot notation
league/flysystem                   3.5.1              File storage abstraction for PHP
league/mime-type-detection         1.11.0             Mime-type detection for Flysystem
maatwebsite/excel                  3.1.40             Supercharged Excel exports and imports in Laravel
maennchen/zipstream-php            2.2.1              ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the s...
markbaker/complex                  3.0.1              PHP Class for working with complex numbers
markbaker/matrix                   3.0.0              PHP Class for working with matrices
masterminds/html5                  2.7.6              An HTML5 parser and serializer.
maximebf/debugbar                  v1.18.1            Debug bar in the browser for php application
mockery/mockery                    1.5.1              Mockery is a simple yet flexible PHP mock object framework
moneyphp/money                     v3.3.3             PHP implementation of Fowler's Money pattern
monolog/monolog                    2.8.0              Sends your logs to files, sockets, inboxes, databases and various web services
mtdowling/jmespath.php             2.6.1              Declaratively specify how to extract elements from a JSON document
myclabs/deep-copy                  1.11.0             Create deep copies (clones) of your objects
myclabs/php-enum                   1.8.4              PHP Enum implementation
nesbot/carbon                      2.62.1             An API extension for DateTime that supports 281 different languages.
nette/schema                       v1.2.2             📐 Nette Schema: validating data structures against a given Schema.
nette/utils                        v3.2.8             🛠  Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, ...
nikic/php-parser                   v4.15.1            A PHP parser written in PHP
nunomaduro/collision               v6.3.0             Cli error handling for console/command-line PHP applications.
nunomaduro/termwind                v1.14.0            Its like Tailwind CSS, but for the console.
paragonie/constant_time_encoding   v2.6.3             Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)
paragonie/random_compat            v9.99.100          PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
paragonie/sodium_compat            v1.18.0            Pure PHP implementation of libsodium; uses the PHP extension if it exists
phar-io/manifest                   2.0.3              Component for reading phar.io manifest information from a PHP Archive (PHAR)
phar-io/version                    3.2.1              Library for handling version information and constraints
phenx/php-font-lib                 0.5.4              A library to read, parse, export and make subsets of different types of font files.
phenx/php-svg-lib                  0.4.1              A library to read, parse and export to PDF SVG files.
phpdocumentor/reflection-common    2.2.0              Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/type-resolver        1.6.1              A PSR-5 based resolver of Class names, Types and Structural Element Names
phpoffice/phpspreadsheet           1.24.1             PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine
phpoption/phpoption                1.9.0              Option Type for PHP
phpunit/php-code-coverage          9.2.17             Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator          3.0.6              FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-invoker                3.1.1              Invoke callables with a timeout
phpunit/php-text-template          2.0.4              Simple template engine.
phpunit/php-timer                  5.0.3              Utility class for timing
phpunit/phpunit                    9.5.24             The PHP Unit Testing framework.
pragmarx/google2fa                 v8.0.1             A One Time Password Authentication package, compatible with Google Authenticator.
psr/cache                          3.0.0              Common interface for caching libraries
psr/container                      2.0.2              Common Container Interface (PHP FIG PSR-11)
psr/event-dispatcher               1.0.0              Standard interfaces for event handling.
psr/http-client                    1.0.1              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/log                            3.0.0              Common interface for logging libraries
psr/simple-cache                   2.0.0              Common interfaces for simple caching
psy/psysh                          v0.11.8            An interactive shell for modern PHP.
pusher/pusher-php-server           7.0.2              Library for interacting with the Pusher REST API
ralouphie/getallheaders            3.0.3              A polyfill for getallheaders.
ramsey/collection                  1.2.2              A PHP library for representing and manipulating collections.
ramsey/uuid                        4.5.1              A PHP library for generating and working with universally unique identifiers (UUIDs).
riverline/multipart-parser         2.0.9              One class library to parse multipart content with encoding and charset support.
rize/uri-template                  0.3.4              PHP URI Template (RFC 6570) supports both expansion & extraction
sabberworm/php-css-parser          8.4.0              Parser for CSS Files written in PHP
sebastian/cli-parser               1.0.1              Library for parsing CLI options
sebastian/code-unit                1.0.8              Collection of value objects that represent the PHP code units
sebastian/code-unit-reverse-lookup 2.0.3              Looks up which function or method a line of code belongs to
sebastian/comparator               4.0.8              Provides the functionality to compare PHP values for equality
sebastian/complexity               2.0.2              Library for calculating the complexity of PHP code units
sebastian/diff                     4.0.4              Diff implementation
sebastian/environment              5.1.4              Provides functionality to handle HHVM/PHP environments
sebastian/exporter                 4.0.5              Provides the functionality to export PHP variables for visualization
sebastian/global-state             5.0.5              Snapshotting of global state
sebastian/lines-of-code            1.0.3              Library for counting the lines of code in PHP source code
sebastian/object-enumerator        4.0.4              Traverses array structures and object graphs to enumerate all referenced objects
sebastian/object-reflector         2.0.4              Allows reflection of object attributes, including inherited and non-public ones
sebastian/recursion-context        4.0.4              Provides functionality to recursively process PHP variables
sebastian/resource-operations      3.0.3              Provides a list of PHP built-in functions that operate on resources
sebastian/type                     3.2.0              Collection of value objects that represent the types of the PHP type system
sebastian/version                  3.0.2              Library that helps with managing the version number of Git-hosted PHP projects
spatie/backtrace                   1.2.1              A better backtrace
spatie/flare-client-php            1.3.0              Send PHP errors to Flare
spatie/ignition                    1.4.1              A beautiful error page for PHP applications.
spatie/laravel-ignition            1.5.0              A beautiful error page for Laravel applications.
spatie/laravel-permission          5.5.5              Permission handling for Laravel 6.0 and up
stella-maris/clock                 0.1.5              A pre-release of the proposed PSR-20 Clock-Interface
stripe/stripe-php                  v7.128.0           Stripe PHP Library
symfony/cache                      v6.1.3             Provides an extended PSR-6, PSR-16 (and tags) implementation
symfony/cache-contracts            v3.1.1             Generic abstractions related to caching
symfony/console                    v6.1.4             Eases the creation of beautiful and testable command line interfaces
symfony/css-selector               v6.1.3             Converts CSS selectors to XPath expressions
symfony/deprecation-contracts      v3.1.1             A generic function and convention to trigger deprecation notices
symfony/error-handler              v6.1.3             Provides tools to manage errors and ease debugging PHP code
symfony/event-dispatcher           v6.1.0             Provides tools that allow your application components to communicate with each other by dispatching events and listenin...
symfony/event-dispatcher-contracts v3.1.1             Generic abstractions related to dispatching event
symfony/finder                     v6.1.3             Finds files and directories via an intuitive fluent interface
symfony/http-foundation            v6.1.4             Defines an object-oriented layer for the HTTP specification
symfony/http-kernel                v6.1.4             Provides a structured process for converting a Request into a Response
symfony/mailer                     v6.1.4             Helps sending emails
symfony/mime                       v6.1.4             Allows manipulating MIME messages
symfony/polyfill-ctype             v1.26.0            Symfony polyfill for ctype functions
symfony/polyfill-intl-grapheme     v1.26.0            Symfony polyfill for intl's grapheme_* functions
symfony/polyfill-intl-icu          v1.26.0            Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-intl-idn          v1.26.0            Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions
symfony/polyfill-intl-normalizer   v1.26.0            Symfony polyfill for intl's Normalizer class and related functions
symfony/polyfill-mbstring          v1.26.0            Symfony polyfill for the Mbstring extension
symfony/polyfill-php72             v1.26.0            Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
symfony/polyfill-php80             v1.26.0            Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
symfony/polyfill-php81             v1.26.0            Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions
symfony/polyfill-uuid              v1.26.0            Symfony polyfill for uuid functions
symfony/process                    v6.1.3             Executes commands in sub-processes
symfony/routing                    v6.1.3             Maps an HTTP request to a set of configuration variables
symfony/service-contracts          v3.1.1             Generic abstractions related to writing services
symfony/string                     v6.1.4             Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way
symfony/translation                v6.1.4             Provides tools to internationalize your application
symfony/translation-contracts      v3.1.1             Generic abstractions related to translation
symfony/uid                        v6.1.3             Provides an object-oriented API to generate and represent UIDs
symfony/var-dumper                 v6.1.3             Provides mechanisms for walking through any arbitrary PHP variable
symfony/var-exporter               v6.1.3             Allows exporting any serializable PHP data structure to plain PHP code
theseer/tokenizer                  1.2.1              A small library for converting tokenized PHP source code into XML and potentially other formats
tijsverkoyen/css-to-inline-styles  2.2.5              CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. Thi...
vlucas/phpdotenv                   v5.4.1             Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.
voku/portable-ascii                2.0.1              Portable ASCII library - performance optimized (ascii) string functions for php.
webmozart/assert                   1.11.0             Assertions to validate method input/output with nice error messages.

PHP version and extensions

composer-plugin-api    2.1.0    The Composer Plugin API
composer-runtime-api   2.1.0    The Composer Runtime API
ext-calendar           8.1.10   The calendar PHP extension
ext-ctype              8.1.10   The ctype PHP extension
ext-curl               8.1.10   The curl PHP extension
ext-date               8.1.10   The date PHP extension
ext-dom                20031129 The dom PHP extension
ext-exif               8.1.10   The exif PHP extension
ext-ffi                8.1.10   The FFI PHP extension
ext-fileinfo           8.1.10   The fileinfo PHP extension
ext-filter             8.1.10   The filter PHP extension
ext-ftp                8.1.10   The ftp PHP extension
ext-gd                 8.1.10   The gd PHP extension
ext-gettext            8.1.10   The gettext PHP extension
ext-hash               8.1.10   The hash PHP extension
ext-iconv              8.1.10   The iconv PHP extension
ext-json               8.1.10   The json PHP extension
ext-libxml             8.1.10   The libxml PHP extension
ext-mbstring           8.1.10   The mbstring PHP extension
ext-mysqli             8.1.10   The mysqli PHP extension
ext-mysqlnd            0        The mysqlnd PHP extension (actual version: mysqlnd 8.1.10)
ext-openssl            8.1.10   The openssl PHP extension
ext-pcntl              8.1.10   The pcntl PHP extension
ext-pcre               8.1.10   The pcre PHP extension
ext-pdo                8.1.10   The PDO PHP extension
ext-pdo_mysql          8.1.10   The pdo_mysql PHP extension
ext-pdo_pgsql          8.1.10   The pdo_pgsql PHP extension
ext-pgsql              8.1.10   The pgsql PHP extension
ext-phar               8.1.10   The Phar PHP extension
ext-posix              8.1.10   The posix PHP extension
ext-readline           8.1.10   The readline PHP extension
ext-reflection         8.1.10   The Reflection PHP extension
ext-session            8.1.10   The session PHP extension
ext-shmop              8.1.10   The shmop PHP extension
ext-simplexml          8.1.10   The SimpleXML PHP extension
ext-sockets            8.1.10   The sockets PHP extension
ext-sodium             8.1.10   The sodium PHP extension
ext-spl                8.1.10   The SPL PHP extension
ext-sysvmsg            8.1.10   The sysvmsg PHP extension
ext-sysvsem            8.1.10   The sysvsem PHP extension
ext-sysvshm            8.1.10   The sysvshm PHP extension
ext-tokenizer          8.1.10   The tokenizer PHP extension
ext-xml                8.1.10   The xml PHP extension
ext-xmlreader          8.1.10   The xmlreader PHP extension
ext-xmlwriter          8.1.10   The xmlwriter PHP extension
ext-xsl                8.1.10   The xsl PHP extension
ext-zend-opcache       8.1.10   The Zend OPcache PHP extension
ext-zip                1.19.5   The zip PHP extension
ext-zlib               8.1.10   The zlib PHP extension
lib-curl               7.68.0   The curl library
lib-curl-libssh        0.9.3    curl libssh version
lib-curl-openssl       1.1.1.6  curl OpenSSL version (1.1.1.6)
lib-curl-zlib          1.2.11   curl zlib version
lib-date-timelib       2021.16  date timelib version
lib-date-zoneinfo      0        zoneinfo ("Olson") database for date
lib-fileinfo-libmagic  540      fileinfo libmagic version
lib-gd                 2.3.3    The gd library
lib-iconv              2.31     The iconv library
lib-libsodium          1.0.18   The libsodium library
lib-libxml             2.9.14   libxml library version
lib-libxslt            1.1.34   The libxslt library
lib-libxslt-libxml     2.9.10   libxml version libxslt is compiled against
lib-mbstring-libmbfl   1.3.2    mbstring libmbfl version
lib-mbstring-oniguruma 6.9.4    mbstring oniguruma version
lib-openssl            1.1.1.6  OpenSSL 1.1.1f  31 Mar 2020
lib-pcre               10.40    The pcre library
lib-pcre-unicode       14.0.0   PCRE Unicode version support
lib-pdo_pgsql-libpq    14.5     libpq for pdo_pgsql
lib-zip-libzip         1.7.3    The zip-libzip library
lib-zlib               1.2.11   The zlib library
php                    8.1.10   The PHP interpreter
php-64bit              8.1.10   The PHP interpreter, 64bit
php-ipv6               8.1.10   The PHP interpreter, with IPv6 support

On which operating system(s) does the issue occur?

Steps to reproduce the issue.

  1. composer install
  2. ...
  3. ...
use Kreait\Firebase;

$factory = (new Firebase\Factory())
    ->withServiceAccount('/path/to/firebase_credentials.com')
    ->withDatabaseUri('https://my-project.firebaseio.com')
;

// ...

Error message/Stack trace

PHP Deprecated:  Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/vendor/symfony/console/Helper/HelperSet.php on line 112

Deprecated: Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/vendor/symfony/console/Helper/HelperSet.php on line 112
Deprecation Notice: strlen(): Passing null to parameter kreait/firebase-php#1 ($string) of type string is deprecated in phar:///usr/local/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:48
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/src/Composer/Repository/ArrayRepository.php:286
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/src/Composer/Repository/ArrayRepository.php:286
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/src/Composer/Repository/ArrayRepository.php:286
Deprecation Notice: Return type of Symfony\Component\Finder\Finder::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/vendor/symfony/finder/Finder.php:675
Deprecation Notice: Return type of Symfony\Component\Finder\Finder::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/vendor/symfony/finder/Finder.php:732
Deprecation Notice: Return type of Symfony\Component\Finder\Iterator\FilterIterator::rewind() should either be compatible with FilterIterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/vendor/symfony/finder/Iterator/FilterIterator.php:30
Deprecation Notice: Return type of Symfony\Component\Finder\Iterator\FileTypeFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php:42
Deprecation Notice: Return type of Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator::getChildren() should either be compatible with RecursiveDirectoryIterator::getChildren(): RecursiveDirectoryIterator, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php:85
Deprecation Notice: Return type of Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator::rewind() should either be compatible with FilesystemIterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php:113
Deprecation Notice: Return type of Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator::current() should either be compatible with FilesystemIterator::current(): SplFileInfo|FilesystemIterator|string, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php:65
Deprecation Notice: Return type of Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php:55
Deprecation Notice: Return type of Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator::hasChildren() should either be compatible with RecursiveIterator::hasChildren(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php:71
Deprecation Notice: Return type of Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator::getChildren() should either be compatible with RecursiveIterator::getChildren(): ?RecursiveIterator, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php:76
Deprecation Notice: Return type of Symfony\Component\Finder\Iterator\FilterIterator::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/vendor/symfony/finder/Iterator/FilterIterator.php:30
Deprecation Notice: Return type of Symfony\Component\Finder\Iterator\DateRangeFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php:41
Deprecation Notice: Return type of Symfony\Component\Finder\Iterator\PathFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/vendor/symfony/finder/Iterator/PathFilterIterator.php:27
Generating optimized autoload files
Deprecation Notice: Return type of Symfony\Component\Finder\Iterator\FilenameFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/vendor/symfony/finder/Iterator/FilenameFilterIterator.php:28
Deprecation Notice: preg_replace(): Passing null to parameter kreait/firebase-php#3 ($subject) of type array|string is deprecated in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:251
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   Illuminate\Contracts\Container\BindingResolutionException 

  Unresolvable dependency resolving [Parameter #0 [ <required> string $projectId ]] in class Kreait\Firebase\Auth\ApiClient

  at vendor/laravel/framework/src/Illuminate/Container/Container.php:1106
    1102▕     protected function unresolvablePrimitive(ReflectionParameter $parameter)
    1103▕     {
    1104▕         $message = "Unresolvable dependency resolving [$parameter] in class {$parameter->getDeclaringClass()->getName()}";
    1105▕ 
  ➜ 1106▕         throw new BindingResolutionException($message);
    1107▕     }
    1108▕ 
    1109▕     /**
    1110▕      * Register a new before resolving callback for all types.

      +27 vendor frames 
  28  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

Additional information

No response

jeromegamez commented 1 year ago

Unfortunately I can't reproduce the issue without knowing how you are using the package. Do you inject the API client directly into a service/controller (if yes, you shouldn't 😅). Have you published and changed the Firebase config? If so, what does the config look like? Did you have the same version of the Firebase Laravel Package before the upgrade from Laravel 8 to 9? Why are you using the dev-branch of this package instead of the latest release?

Please help me help you by giving me enough information to reproduce the issue.

You can test if the issue lies in this package or the SDK by performing the following steps:

$ composer create-project laravel/laravel laravel9-with-firebase
$ cd laravel9-with-firebase
$ composer require -W kreait/laravel-firebase
$ php artisan vendor:publish --provider="Kreait\Laravel\Firebase\ServiceProvider" --tag=config
$ composer update -W

If this works (and it should), some other dependency in your project likely interferes. The multiple Deprecation warnings are an additional sign that something has not been updated. One reason could be that your composer binary is not on the latest version. A composer self-update should bring you to version 2.4.2.

Let me know how it goes!

friedrich-henrique commented 1 year ago

Thanks for the polite and complete reply. I will perform those actions and post here back again later.

friedrich-henrique commented 1 year ago

Doing your steps really work indeed.

I was trying to upgrade Laravel from 8 to 9 and did not change the Firebase Laravel Package initially, but this error happened and then I ended up changing it too, the dev branch was a despairing act.

I did not publish the configs and I use the Firebase credentials as recommended on the documentation.

jeromegamez commented 1 year ago

Does perhaps a composer update -W in your project work, in case you haven't already tried that? The deprecation warnings "worry" me, I usually try to address everything else when I tackle such problems, even if it doesn't look directly related. Sometimes this fixes other problems at the same time, but at least everything else is out of the way and it helps focusing on the actual problem better.

You could also try to call the package's ProjectManager directly from within artisan tinker or create a simple controller starting with the simplest use cas and then continue to build it up until it breaks.

Just to be sure: if you inject components of the SDK into your services/controllers, you need to use the contracts, not the implementations.

friedrich-henrique commented 1 year ago

Everything is working seamlessly with Laravel 8, but when trying to upgrade to 9 this error happens.

The good news is given your last message I checked the injection throughout the project, and there were some injections of the implementations instead of the contracts.

Thanks for all the support.

ben-cheng565 commented 1 year ago

Hi @oqfs06 , have you worked it out? I have encountered the same issue when upgrading Laravel from 8 to 9.

wislert commented 1 year ago

I got this problem in my sending job:

use Kreait\Firebase\Messaging;

public function handle(Messaging $firebase)
{
    $response = $firebase->sendMulticast($this->message, $this->pushProfile->Token);
}

to fix that I just change the dependency:


use Kreait\Laravel\Firebase\Facades\Firebase;

public function handle()
{
    $response = Firebase::messaging()->sendMulticast($this->message, $this->pushProfile->Token);
}
jeromegamez commented 1 year ago

@wislert It should work by using

use Kreait\Firebase\Contract\Messaging;

instead of

use Kreait\Firebase\Messaging;