kreait / laravel-firebase

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

Bug - String must be of Type String #232

Open eshbanbahadur opened 1 day ago

eshbanbahadur commented 1 day ago

Describe the bug

I am using Laravel 11 with PHP 8.2.18 on Windows 11 with Wamp Server 3.3.5. I have created a Laravel project with Command line and after that whenever I run a command: `composer require kreait/laravel-firebase:^5.5 --with-all-dependencies

` I got following error: Running composer update kreait/laravel-firebase Loading composer repositories with package information Updating dependencies

In Problem.php line 652:

[TypeError] substr(): Argument #1 ($string) must be of type string, null given

I have tried with Fresh Laravel Installations and new composer installations but it cannot go?

Could you please help on that?

Installed packages

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The skeleton application for the Laravel framework.",
    "keywords": ["laravel", "framework"],
    "license": "MIT",
    "require": {
        "php": "^8.2",
        "kreait/laravel-firebase": "5.5",
        "laravel/framework": "^11.9",
        "laravel/tinker": "^2.9"
    },
    "require-dev": {
        "fakerphp/faker": "^1.23",
        "laravel/pint": "^1.13",
        "laravel/sail": "^1.26",
        "mockery/mockery": "^1.6",
        "nunomaduro/collision": "^8.1",
        "phpunit/phpunit": "^11.0.1"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi",
            "@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
            "@php artisan migrate --graceful --ansi"
        ]
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true,
        "allow-plugins": {
            "pestphp/pest-plugin": true,
            "php-http/discovery": true
        }
    },
    "minimum-stability": "stable",
    "prefer-stable": true
}

PHP version and extensions

composer               2.8.1     Composer package
composer-plugin-api    2.6.0     The Composer Plugin API
composer-runtime-api   2.2.2     The Composer Runtime API
ext-bcmath             8.2.18    The bcmath PHP extension
ext-calendar           8.2.18    The calendar PHP extension
ext-com_dotnet         8.2.18    The com_dotnet PHP extension
ext-ctype              8.2.18    The ctype PHP extension
ext-curl               8.2.18    The curl PHP extension
ext-date               8.2.18    The date PHP extension
ext-dom                20031129  The dom PHP extension
ext-exif               8.2.18    The exif PHP extension
ext-fileinfo           8.2.18    The fileinfo PHP extension
ext-filter             8.2.18    The filter PHP extension
ext-gd                 8.2.18    The gd PHP extension
ext-gettext            8.2.18    The gettext PHP extension
ext-gmp                8.2.18    The gmp PHP extension
ext-hash               8.2.18    The hash PHP extension
ext-iconv              8.2.18    The iconv PHP extension
ext-imap               8.2.18    The imap PHP extension
ext-intl               8.2.18    The intl PHP extension
ext-json               8.2.18    The json PHP extension
ext-ldap               8.2.18    The ldap PHP extension
ext-libxml             8.2.18    The libxml PHP extension
ext-mbstring           8.2.18    The mbstring PHP extension
ext-mysqli             8.2.18    The mysqli PHP extension
ext-mysqlnd            0         The mysqlnd PHP extension (actual version: mysqlnd 8.2.18)
ext-openssl            8.2.18    The openssl PHP extension
ext-pcre               8.2.18    The pcre PHP extension
ext-pdo                8.2.18    The PDO PHP extension
ext-pdo_mysql          8.2.18    The pdo_mysql PHP extension
ext-pdo_sqlite         8.2.18    The pdo_sqlite PHP extension
ext-phar               8.2.18    The Phar PHP extension
ext-random             8.2.18    The random PHP extension
ext-readline           8.2.18    The readline PHP extension
ext-reflection         8.2.18    The Reflection PHP extension
ext-session            8.2.18    The session PHP extension
ext-simplexml          8.2.18    The SimpleXML PHP extension
ext-soap               8.2.18    The soap PHP extension
ext-sockets            8.2.18    The sockets PHP extension
ext-spl                8.2.18    The SPL PHP extension
ext-sqlite3            8.2.18    The sqlite3 PHP extension
ext-tokenizer          8.2.18    The tokenizer PHP extension
ext-xdebug             3.3.2     The xdebug PHP extension
ext-xml                8.2.18    The xml PHP extension
ext-xmlreader          8.2.18    The xmlreader PHP extension
ext-xmlwriter          8.2.18    The xmlwriter PHP extension
ext-xsl                8.2.18    The xsl PHP extension
ext-zend-opcache       8.2.18    The Zend OPcache PHP extension
ext-zip                1.21.1    The zip PHP extension
ext-zlib               8.2.18    The zlib PHP extension
lib-curl               8.7.0-DEV The curl library
lib-curl-libssh2       1.10.0    curl libssh2 version
lib-curl-openssl       3.0.13    curl OpenSSL version (3.0.13)
lib-curl-zlib          1.2.12    curl zlib version
lib-date-timelib       2022.10   date timelib version
lib-date-zoneinfo      2024.1    zoneinfo ("Olson") database for date
lib-fileinfo-libmagic  540       fileinfo libmagic version
lib-gd                 2.0.35    The gd library
lib-gd-freetype        2.11.1    freetype version for gd
lib-gd-libjpeg         8.0       libjpeg version for gd
lib-gd-libpng          1.6.34    libpng version for gd
lib-gd-libxpm          3.5.12    libxpm version for gd
lib-gmp                6.0.0     The gmp library
lib-iconv              1.16      The iconv library
lib-icu                71.1      The ICU unicode and globalization support library
lib-icu-cldr           41        ICU CLDR project version
lib-icu-unicode        14.0.0    ICU unicode version
lib-icu-zoneinfo       2022.1    zoneinfo ("Olson") database for icu
lib-ldap-openldap      2.4.47    OpenLDAP version of ldap
lib-libxml             2.10.3    libxml library version
lib-libxslt            1.1.37    The libxslt library
lib-libxslt-libxml     2.10.2    libxml version libxslt is compiled against
lib-mbstring-libmbfl   1.3.2     mbstring libmbfl version
lib-mbstring-oniguruma 6.9.8     mbstring oniguruma version
lib-openssl            3.0.13    OpenSSL 3.0.13 30 Jan 2024
lib-pcre               10.40     The pcre library
lib-pcre-unicode       14.0.0    PCRE Unicode version support
lib-pdo_sqlite-sqlite  3.39.2    The pdo_sqlite-sqlite library
lib-sqlite3-sqlite     3.39.2    The sqlite3-sqlite library
lib-zip-libzip         1.7.1     The zip-libzip library
lib-zlib               1.2.12    The zlib library
php                    8.2.18    The PHP interpreter
php-64bit              8.2.18    The PHP interpreter, 64bit
php-ipv6               8.2.18    The PHP interpreter, with IPv6 support
php-zts                8.2.18    The PHP interpreter, with Zend Thread Safety

Steps to reproduce the issue.

# Insert the commands issued in the terminal if they are needed
# to reproduce the issue. Otherwise, delete this code block.
// Insert the PHP code to reproduce the issue. Please ensure that it is code that
// can be copy pasted to reproduce it.
`composer require kreait/laravel-firebase:^5.5 --with-all-dependencies
`composer require kreait/laravel-firebase

Error message/Stack trace

substr(): Argument #1 ($string) must be of type string, null given

Additional information

No response

jeromegamez commented 1 day ago

Your composer.json has "5.5" instead of "^5.5" for the package, could you please change this to get the latest release and do a composer update -W, just to be sure that that's not the reason?

jeromegamez commented 1 day ago

Also, neither the package nor the SDK use the substr() function, so I think, at the moment, that the problem must be somewhere else.