lundi 9 décembre 2019

Declaration of Symfony\Component\Translation\TranslatorInterface::setLocale($locale) must be compatible

Lately, just clone my new Laravel project.

I amn on

php artisan Laravel Framework 5.7.28

Even after rm -rf vendor/ & composer install 5 times, I kept getting

Declaration of Symfony\Component\Translation\TranslatorInterface::setLocale($locale) must be compatible with Symfony\Contracts\Translation\LocaleAwareInterface::setLocale(string $locale)

I even tried

⚡️  bheng  php artisan cache:clear
Application cache cleared!
⚡️  bheng  php artisan config:cache
Configuration cache cleared!
Configuration cached successfully!
⚡️  bheng  php artisan config:clear
Configuration cache cleared!
⚡️  bheng  php artisan view:clear
Compiled views cleared!
⚡️  bheng  php artisan route:cache
Route cache cleared!
Routes cached successfully!

My PHP version

php --version PHP 7.3.8 (cli) (built: Aug 11 2019 20:50:16) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.8, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.3.8, Copyright (c) 1999-2018, by Zend Technologies with Xdebug v2.7.2, Copyright (c) 2002-2019, by Derick Rethans

composer.json

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "laravel/framework": "5.7.*",
        "intervention/image": "^2.3",
        "laravelcollective/remote": "5.7.*",
        "doctrine/dbal": "^2.3",
        "symfony/translation": "4.3.8",
        "league/flysystem-sftp": "^1.0",
        "laravelcollective/html": "^5.4.0",
        "phpseclib/phpseclib": "~2.0",
        "htmlmin/htmlmin": "^5.0",
        "league/flysystem-aws-s3-v3": "~1.0",
        "vinkla/instagram": "^8.0",
        "php-http/message": "^1.6",
        "php-http/guzzle6-adapter": "^1.1",
        "pusher/pusher-php-server": "~4.0",
        "anhskohbo/no-captcha": "^3.1"

    },
    "require-dev": {
        "phpunit/phpunit": "~7.0",
        "phpspec/phpspec": "~5.0",
        "symfony/dom-crawler": "~3.1",
        "symfony/css-selector": "~3.1",
        "filp/whoops" : "~2.0"
    },
    "autoload": {
        "classmap": [ "database" ],

        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
        ]
    },
    "scripts": {
        "post-install-cmd": [
        "php artisan clear-compiled",
        "php artisan optimize"
        ],
        "post-update-cmd": [
        "php artisan clear-compiled",
        "php artisan optimize"
        ],
        "post-create-project-cmd": [
        "php -r \"copy('.env.example', '.env');\"",
        "php artisan key:generate"
        ],
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}

Any helps on this will be much appreciated !



via Chebli Mohamed

1 commentaire:

  1. https://stackoverflow.com/questions/58975559/symfony-component-debug-exception-fatalerrorexception-laravel-error

    RépondreSupprimer