I am working on Symfony 6.1.12 after updating dependencies with the composer update command, I receive the above error when I do the symfony console make:entity command.
My composer.json file below
I tried to downgrade the doctrine/orm bundle as shown in this example but it don't work
{
"require": {
"php": ">=8.1",
"ext-ctype": "*",
"ext-iconv": "*",
"doctrine/annotations": "^1.0",
"doctrine/doctrine-bundle": "^2.7",
"doctrine/doctrine-migrations-bundle": "^3.2",
"doctrine/orm": "^2.14.1",
},
"conflict": {
"symfony/symfony": "*"
}
Could it be you dont have the Repository annotation above your entity definition?
#[ORM\Entity(repositoryClass: ProductRepository::class)]
class Product
{
}
Related
I want to use Bcrypt of Laminas-Crypt package in one of my files. After running
composer require laminas/laminas-crypt,
composer dump-autoload,
composer update
I declared a use statement in my controller:
use Laminas\Crypt\Password\Bcrypt;
The application loaded without any errors, but as far as I am concerned, all namespaces should be registered in config/modules.config.php for the autoloader to load the namespaces accordingly. After adding Laminas\Crypt namespace to the folder the application threw an exception:
Uncaught Laminas\ModuleManager\Exception\RuntimeException: Module (Laminas\Crypt) could not be initialized. in C:\xampp\htdocs\phpLessons\Shortly\vendor\laminas\laminas-modulemanager\src\ModuleManager.php:180
My question is:
Can the application function properly without the namespace of the used package being defined in the config/modules.config.php of root directory?
How can the exception be handled?
Edit:
Here is the relevant part of composer.json
"require": {
"php": ">=8.1.0",
"laminas/laminas-component-installer": "^3.0",
"laminas/laminas-development-mode": "^3.2",
"laminas/laminas-skeleton-installer": "^1.0",
"laminas/laminas-mvc": "^3.3.4",
"laminas/laminas-db": "^2.12.0",
"laminas/laminas-mvc-form": "^2.0.0",
"laminas/laminas-json": "^3.2",
"laminas/laminas-log": "^2.13.1",
"laminas/laminas-cli": "^1.1.1",
"laminas/laminas-mvc-i18n": "^1.2.0",
"laminas/laminas-mvc-plugins": "^1.1.0",
"laminas/laminas-mvc-middleware": "^2.0.0",
"laminas/laminas-session": "^2.10.0",
"laminas/laminas-di": "^3.2.2",
"laminas/laminas-view": "^2.25",
"laminas/laminas-form": "3.7",
"laminas/laminas-crypt": "^3.9",
"ext-pdo": "*",
"laminas/laminas-mail": "^2.20",
"doctrine/orm": "^2.14",
"doctrine/dbal": "^3.2",
"symfony/yaml": "^5.4",
"symfony/cache": "^5.4",
"doctrine/common": "^3.4",
"doctrine/doctrine-orm-module": "^5.3"
},
and modules.config.php from config/autoload:
return [
'Laminas\Cache',
'Laminas\Paginator',
'Laminas\Mail',
'Laminas\Mvc\Plugin\FilePrg',
'Laminas\Mvc\Plugin\FlashMessenger',
'Laminas\Mvc\Plugin\Identity',
'Laminas\Mvc\Plugin\Prg',
'Laminas\Session',
'Laminas\Mvc\Middleware',
'Laminas\Mvc\I18n',
'Laminas\Form',
'Laminas\I18n',
'Laminas\Log',
'Laminas\InputFilter',
'Laminas\Filter',
'Laminas\Hydrator',
'Laminas\Di',
'Laminas\Db',
'Laminas\Router',
'Laminas\Validator',
'Laminas\DeveloperTools',
'Laminas\Diactoros',
'DoctrineModule',
'DoctrineORMModule',
'Application',
'User',
'Pages',
];
i have added LIB yookassa to laravel/vendor/omnipay/yookassa, but after call
$gateway = Omnipay::create('YooKassa');
it was error Class '\Omnipay\YooKassa\Gateway' not found
The main composer.json (require section)
"omnipay/paypal": "*",
"omnipay/stripe": "*",
"omnipay/yookassa": "*",
"yoomoney/yookassa-sdk-php": "^2.4",
"hiqdev/omnipay-yandex-kassa": "^3.0",
"igor-tv/omnipay-yookassa": "^4.0",
Try first clear the cache
php artisan optimize:clear
after you need
composer install
I just installed fresh Symfony framework skeleton with annotations and Doctrine and it not works. I have got an error
Argument 1 passed to Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter::__construct()
must be an instance of Doctrine\Common\Persistence\ManagerRegistry or null,
instance of Doctrine\Bundle\DoctrineBundle\Registry given, called in
my composer file
{
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"composer/package-versions-deprecated": "^1.11",
"doctrine/doctrine-bundle": "^2.1",
"doctrine/doctrine-migrations-bundle": "^2.2",
"doctrine/orm": "^2.7",
"sensio/framework-extra-bundle": "^5.5",
"symfony/console": "4.4.*",
"symfony/dotenv": "4.4.*",
"symfony/flex": "^1.3.1",
"symfony/framework-bundle": "4.4.*",
"symfony/yaml": "4.4.*"
},
"require-dev": {
"symfony/web-server-bundle": "4.4.*"
},
Please help.
I got the exact same problem today after installing the new symfony binary, composer update worked for me.
I have added to the config/packages/sensio_framework_extra.yaml
this lines and it working
sensio_framework_extra:
router:
annotations: false
request:
converters: true
disable: ['doctrine.orm']
I think my question may be stupid, but I can’t figure out how to upgrade my Symfony project from version 4.1. * to version 4.3. *.
I tried to touch the composer.json. But it sends me an error message... Does anyone have the solution?
composer.json
I had this :
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.1.*"
}
}
I changed by that:
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.3.*"
}
}
Version 4.4 does not download or update...
extra.symfony.require is for performance reasons, as symfony has too many versions and update may take a long time. To update project you also need to add 4.3.* constraint to the require section:
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"symfony/console": "4.3.*",
"symfony/dotenv": "4.3.*",
"symfony/flex": "^1.1",
"symfony/framework-bundle": "4.3.*",
"symfony/yaml": "4.3.*"
},
I get the following error when executing Behat:
PHP Fatal error: Class 'Symfony\Component\Process\PhpExecutableFinder' not found
I don't know if its normal, but the PhpExecutableFinder is located within my composer.phar after php composer.phar update is called.
{
"require": {
"php": ">=5.4",
"ext-mcrypt": "*",
"slim/slim": "~2.0",
"slim/views": "0.1.*",
"twig/twig": "1.18.*",
"propel/propel": "~2.0#dev",
"zeflasher/propel2-geocodable-behavior": "dev-master",
"behat/behat": "3.0.*#stable",
"behat/mink": "1.6.*#stable",
"behat/mink-extension": "#stable",
"behat/mink-goutte-driver": "#stable",
"behat/mink-selenium2-driver": "#stable",
"peridot-php/leo": "~1.0"
},
"autoload": {
"classmap": ["website/", "vendor/"]
}
}
Is my current composer.json. Can anybody reproduce it? composer.phar is self-updated.
composer require symfony/process
That solved the issue. I don't know why its not included in behat.