Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all 3916 articles
Browse latest View live

loop for in type querybuilder symfony 4 (select - option choice)

$
0
0

Hello i would like get max value in form since db and i have success it but i have only max value in my listbox exemple 4 and i would like in my list box [1,2,3,4] if max value get in DB is 1 i have only one and exemple is 2 i would like [1,2]

DBlistbox and would like :

<select>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>

since of

<select>
<option value="4">4</option>
</select>

Controller :

$form = $this->createForm(ReservationType::class, $booking, ['id_service' => $service]);

Repository :

public function findOneById($service)
    {
        return $this->createQueryBuilder('t')
            ->andWhere('t.service = :service')
            ->setParameter('service', $service)
            ;
   }

Type :

public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $id_service = $options['id_service'];
        $builder
            ->add('nbPlaces', EntityType::class, [
                'class' => Transport::class,
                'label' => 'Nombre de places',
                'attr' => [
                    'placeholder' => "Nombre de places",
                ],
                'query_builder' => function (TransportRepository $transportRepository) use ($id_service) {
                    $req = $transportRepository->findOneById($id_service);
                    return $req;

                },
                'choice_label' => 'nbPlaces',
                'choice_value' => 'nbPlaces'

            ]);
    }

    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'data_class' => Reservation::class,
            'id_service' => null
        ]);
    }

initial subject for more detail : GET max value form since DB symfony 4

Thank's a lot


ObjectManager isn't recognized (Declaration must be compatible with FixtureInterface->load)

$
0
0

I have tried to create DataFixtures, I think that my code is correct because if I tried on another project it's worked. So I don't understand why just in that my actual project , the Object Manager isn't working and my IDE is underlying Object Manager.

My error:

Declaration must be compatible with FixtureInterface->load(manager: \Doctrine\Persistence\ObjectManager)

My code:

<?php

namespace App\DataFixtures;

use App\Entity\User;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;

class UserFixtures extends Fixture
{
    public function __construct(UserPasswordEncoderInterface $passwordEncoder)
    {
        $this->passwordEncoder =$passwordEncoder;
    }

    public function load(ObjectManager $manager)
    {
        foreach ($this->getUserData() as [$email,$password,$lastname,$firstname,$company,$language,$enabled,$pictures])
        {
            $user = new User();
            $user->setEmail($email);
            $user->setPassword($this->passwordEncoder->encodePassword($user,$password));
            $user->setLastname($lastname);
            $user->setFirstname($firstname);
            $user->setCompany($company);
            $user->setLanguage($language);
            $user->setEnabled($enabled);
            $user->setPictures($pictures);

        }
        $manager->flush();
    }

    private function getUserData() : array {
        return [
            ['test@gmail.com','test','paul','marc','WKCompany','BE',1,'https://media.istockphoto.com/photos/businessman-silhouette-as-avatar-or-default-profile-picture-picture-id476085198?k=6&m=476085198&s=612x612&w=0&h=5cDQxXHFzgyz8qYeBQu2gCZq1_TN0z40e_8ayzne0X0=']
        ];
    }
}

Symfony 4 Recaptcha bundle "public_key" at path "ewz_recaptcha" must be configured

$
0
0

I'm using symfony 4 and recaptcha bundle from https://packagist.org/packages/excelwebzone/recaptcha-bundle#v1.5.11, but i don't know why it doesn't work. Below is the error i got. I configured env google recaptcha variables.

The file "C:\xampp\htdocs\projects\symfony-template\config/packages/ewz_recaptcha.yaml" does not contain valid YAML in C:\xampp\htdocs\projects\symfony-template\config/packages/ewz_recaptcha.yaml (which is loaded in resource "C:\xampp\htdocs\projects\symfony-template\config/packages/ewz_recaptcha.yaml").

yaml file:

    ewz_recaptcha:
      public_key:  HIDDEN
      private_key:  HIDDEN
      # Not needed as "%kernel.default_locale%" is the default value for the locale key
      locale_key:  %kernel.default_locale%

HIDDEN equals keys from google, but i covered it here for security reasons.

[Symfony][LexikJWT] Prevent user from logging in if his status is inactive

$
0
0

I am trying to block user from logging in his status is inactive. I am using API-Platform with LexikJWT bundle.

I have tried to make a JWTAuthentication guard by extending JWTTokenAuthenticator->checkCredentials but the problem is that this works after user already logged in.

What I want to achieve is to return user a message that he needs to activate his account first, or any other message, preferably any custom message on any custom condition.

My security YAML looks like this:

security:
    encoders:
        App\Entity\User:
            algorithm: bcrypt
    providers:
        app_user_provider:
            entity:
                class: App\Entity\User
                property: email
    firewalls:
        dev:
            pattern: ^/_(profiler|wdt)
            security: false
        api:
            pattern: ^/api/
            stateless: true
            anonymous: true
            provider: app_user_provider
            json_login:
                check_path: /api/authentication_token
                username_path: email
                password_path: password
                success_handler: lexik_jwt_authentication.handler.authentication_success
                failure_handler: lexik_jwt_authentication.handler.authentication_failure
            guard:
                authenticators:
                    - app.jwt_token_authenticator
        main:
            anonymous: true
    access_control:
        - { path: ^/api/authentication_token,   roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/api/graphql,                roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/public-api,                 roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/api/,                       roles: [ROLE_MANAGER, ROLE_LEADER] }
        - { path: ^/,                           roles: IS_AUTHENTICATED_ANONYMOUSLY }

Services:

services:
    # default configuration for services in *this* file
    _defaults:
        autowire: true      # Automatically injects dependencies in your services.
        autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.

    # makes classes in src/ available to be used as services
    # this creates a service per class whose id is the fully-qualified class name
    App\:
        resource: '../src/*'
        exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'

    # controllers are imported separately to make sure services can be injected
    # as action arguments even if you don't extend any base controller class
    App\Controller\:
        resource: '../src/Controller'
        tags: ['controller.service_arguments']

    # add more service definitions when explicit configuration is needed
    # please note that last definitions always *replace* previous ones
    gedmo.listener.softdeleteable:
        class: Gedmo\SoftDeleteable\SoftDeleteableListener
        tags:
            - { name: doctrine.event_subscriber, connection: default }
        calls:
            - [ setAnnotationReader, [ '@annotation_reader' ] ]

    acme_api.event.authentication_success_listener:
        class: App\EventListener\AuthenticationSuccessListener
        tags:
            - { name: kernel.event_listener, event: lexik_jwt_authentication.on_authentication_success, method: onAuthenticationSuccessResponse }

    app.jwt_token_authenticator:
        autowire: false
        autoconfigure: false
        class: App\Security\Guard\JWTTokenAuthenticator
        parent: lexik_jwt_authentication.security.guard.jwt_token_authenticator

    'App\Serializer\ApiNormalizer':
        decorates: 'api_platform.serializer.normalizer.item'
        arguments: ['@App\Serializer\ApiNormalizer.inner', '@doctrine.orm.entity_manager']

    'App\Serializer\HydraApiNormalizer':
        decorates: 'api_platform.jsonld.normalizer.item'
        arguments: ['@App\Serializer\ApiNormalizer.inner', '@doctrine.orm.entity_manager']

    'App\Voter\ModifyUserVoter':
        public: false
        tags:
            - { name: security.voter }

Authenticator guard

class JWTTokenAuthenticator extends BaseAuthenticator
{
    /**
     * {@inheritdoc}
     */
    public function checkCredentials($credentials, UserInterface $user)
    {
        if (!$user->getRoles() || !in_array($user->getRoles()[0], ['ROLE_MANAGER', 'ROLE_LEADER'])) {
            throw new UnauthorizedHttpException(rand(10000, 99999), 'Unauthorized');
        }

        if (!$user->getStatus() != "active") {
            throw new UnauthorizedHttpException(rand(10000, 99999), 'Unauthorized');
        }

        return true;
    }
}

How to disable "verify_peer" with Symfony Mailer component?

$
0
0

I'm configuring a mail server (postfix), with a self signed certificate, and it seems this self signed certificate is a problem for the Symfony Mailer component.

On Swiftmailer, using some configuration such as:

transport:
    stream_options:
        ssl:
            allow_self_signed: true

or

stream_options:
    ssl:
        verify_peer: false
        verify_peer_name: false

might fix it, but I can't find a way to do that on mailer (I want to use the YAML configuration files if possible).

GET max value form since DB symfony 4

$
0
0

Sorry to disturb you but I would like to obtain a max value for a form validation for example it can be a numeric field but the validation of type range MaxValue will have to be retrieved in the database I explain myself for example I wish to reserve a transport the max value by default is 4 for 4 remaining places but if for this vehicle there are 3 places left, the validation would have to pass to 3

I tried to go through entitytype with events but it didn't change anything to my problem it returned in the drop down list all the number of places for each vehicle.

The goal is to make a simple form a reservation button with just a way to choose the number of places while not being able to exceed the value of the database.

For example the URL is /transport/6/book

We must find a way to pass the value of id number 6 and the validation would be between 1 and 3 for example or create a list that puts 1 2 3

If transport 7 to 1 place of availability it would have to be 1 only.

Excuse me if I misspoke but I've been working on it for more than a week and I can't get it to work so I've moved to an old commit to keep the application working. I'm a beginner in this area so I don't know the advanced features of the form but I'm very good at the twig repository etc. It's just this part that is blocking, thanks in advance for your help.

public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('nbPlaces', EntityType::class, [
                'class' => Transport::class,
                'label' => 'Nombre de places',
                'attr' => [
                    'placeholder' => "Nombre de places",
                ],
                'query_builder' => function (TransportRepository $transportRepository) use ($id_service) {
                    return $transportRepository->findOneByIdPlace($id_service);
                },
                'choice_label' => 'nbPlaces'
            ]);
    }

public function configureOptions(OptionsResolver $resolver)
{
    $resolver->setDefaults([
        'data_class' => Reservation::class,
        'id_service' => null
    ]);
}

and controller

$booking = new Reservation();
        $form = $this->createForm(ReservationType::class, $booking, ['id_service' => $service]);

and $id_service is undefined variable in use

Symfony i18n routes: partial language support

$
0
0

I have a few dozen routes defined as follows:

services:
    path:
        en: /en/services
        de: /de/dienstleistungen
    controller: App\Controller\SimplePageController::page

This is using the Localized routing which I believe was introduced in Symfony 4.1.

The routes all have paths for both English and German. Now I want to translate a few specific pages in some other languages. For instance my homepage. The problem is that is I add another language to the route of my homepage, it will not load since it can't create links to other pages that do not have a route defined in this new language.

How can I tell Symfony to create links to the English routes if the current language does not have a route for it? Or even better, specify some dynamic path along the lines of:

services:
    path:
        en: /en/services
        de: /de/dienstleistungen
        default: /$1/services
    controller: App\Controller\SimplePageController::page

Prevent user from logging in if his status is inactive

$
0
0

I am trying to block user from logging in his status is inactive. I am using API-Platform with LexikJWT bundle.

I have tried to make a JWTAuthentication guard by extending JWTTokenAuthenticator->checkCredentials but the problem is that this works after user already logged in.

What I want to achieve is to return user a message that he needs to activate his account first, or any other message, preferably any custom message on any custom condition.

My security YAML looks like this:

security:
    encoders:
        App\Entity\User:
            algorithm: bcrypt
    providers:
        app_user_provider:
            entity:
                class: App\Entity\User
                property: email
    firewalls:
        dev:
            pattern: ^/_(profiler|wdt)
            security: false
        api:
            pattern: ^/api/
            stateless: true
            anonymous: true
            provider: app_user_provider
            json_login:
                check_path: /api/authentication_token
                username_path: email
                password_path: password
                success_handler: lexik_jwt_authentication.handler.authentication_success
                failure_handler: lexik_jwt_authentication.handler.authentication_failure
            guard:
                authenticators:
                    - app.jwt_token_authenticator
        main:
            anonymous: true
    access_control:
        - { path: ^/api/authentication_token,   roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/api/graphql,                roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/public-api,                 roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/api/,                       roles: [ROLE_MANAGER, ROLE_LEADER] }
        - { path: ^/,                           roles: IS_AUTHENTICATED_ANONYMOUSLY }

Services:

services:
    # default configuration for services in *this* file
    _defaults:
        autowire: true      # Automatically injects dependencies in your services.
        autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.

    # makes classes in src/ available to be used as services
    # this creates a service per class whose id is the fully-qualified class name
    App\:
        resource: '../src/*'
        exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'

    # controllers are imported separately to make sure services can be injected
    # as action arguments even if you don't extend any base controller class
    App\Controller\:
        resource: '../src/Controller'
        tags: ['controller.service_arguments']

    # add more service definitions when explicit configuration is needed
    # please note that last definitions always *replace* previous ones
    gedmo.listener.softdeleteable:
        class: Gedmo\SoftDeleteable\SoftDeleteableListener
        tags:
            - { name: doctrine.event_subscriber, connection: default }
        calls:
            - [ setAnnotationReader, [ '@annotation_reader' ] ]

    acme_api.event.authentication_success_listener:
        class: App\EventListener\AuthenticationSuccessListener
        tags:
            - { name: kernel.event_listener, event: lexik_jwt_authentication.on_authentication_success, method: onAuthenticationSuccessResponse }

    app.jwt_token_authenticator:
        autowire: false
        autoconfigure: false
        class: App\Security\Guard\JWTTokenAuthenticator
        parent: lexik_jwt_authentication.security.guard.jwt_token_authenticator

    'App\Serializer\ApiNormalizer':
        decorates: 'api_platform.serializer.normalizer.item'
        arguments: ['@App\Serializer\ApiNormalizer.inner', '@doctrine.orm.entity_manager']

    'App\Serializer\HydraApiNormalizer':
        decorates: 'api_platform.jsonld.normalizer.item'
        arguments: ['@App\Serializer\ApiNormalizer.inner', '@doctrine.orm.entity_manager']

    'App\Voter\ModifyUserVoter':
        public: false
        tags:
            - { name: security.voter }

Authenticator guard

class JWTTokenAuthenticator extends BaseAuthenticator
{
    /**
     * {@inheritdoc}
     */
    public function checkCredentials($credentials, UserInterface $user)
    {
        if (!$user->getRoles() || !in_array($user->getRoles()[0], ['ROLE_MANAGER', 'ROLE_LEADER'])) {
            throw new UnauthorizedHttpException(rand(10000, 99999), 'Unauthorized');
        }

        if (!$user->getStatus() != "active") {
            throw new UnauthorizedHttpException(rand(10000, 99999), 'Unauthorized');
        }

        return true;
    }
}

Symfony Dynamic Dependent Dropdown using Ajax

$
0
0

I'm trying to make depend dropdown lists using ajax on Symfony project, I tried the following but it's not working, I think the problem is in the request call in the Controller because the value is NULL (When using var_dump()). What I'm doing wrong ? The form in Twig file:

<form method="GET" class="search-jobs-form" id="form" 
             name="form">
          <div class="row mb-5">
            <div class="col-12 col-sm-6 col-md-6 col-lg-3 mb-4 
            mb-lg-0">
              <select class="selectpicker dynamic" data-dependent="element" name="category" id="category" data-style="btn-white btn-lg" data-width="100%" data-live-search="true" title="Séléctionner une catégorie">
                {% for category in categories %}     
                <option>{{category}}</option>
                {% endfor %}
              </select> 

             </div>
            <div class="col-12 col-sm-6 col-md-6 col-lg-3 mb-4 mb-lg-0">
              <select class="selectpicker" name="element" id="element" data-style="btn-white btn-lg" data-width="100%" data-live-search="true" title="Séléctionner un élément">

              </select>
            </div>
           </div>
         </form>

The Controller function:

    /**
 * @Route("/site", name="site", methods="GET")
 */
   public function getObjects(Request $request)
       {
          $entityManager =$this->getDoctrine()->getManager();

         $productRepository = $entityManager->getRepository(Category::class);
         $categories_list = $productRepository->findAll();

        foreach ($categories_list as $category) {
            $categories[] =  $category->getName();
        }

      $slct = $request->query->get('select');
      var_dump($slct);
      $val = $request->get('value');
      $dpnt = $request->get('dependent');
      $em = $this->getDoctrine()->getManager();
      $q= $em->createQuery(
             "SELECT ce
             FROM App\Entity\CategoryElements ce WHERE ce.category=:slct AND 
             ce.element=:val"
            );
        $q->setParameter('slct', $slct);
        $q->setParameter('val', $val);
        $data=$q->getResult();

    $output = '<option value="">Select '.ucfirst($dpnt).'</option>';
    foreach($data as $row)
      {
         $output .= '<option value="'.$row->$dpnt.'">'.$row->$dpnt.'</option>';
        }
      echo $output;

        return  $this->render('site/index.html.twig', [
            'categories' => $categories,
            'wilayas' => $wilayas
            ]);
             }

The ajax code:

<script>
  $(document).ready(function(){

  $("#category").change(function(){
  if($(this).val() != '')
   {
      var select = $(this).attr("id");
      var value = $(this).val();
      var dependent = $(this).data('dependent');
      var _token = $('input[name="_token"]').val();
        $.ajax({
           url:"{{path('site')}}",
           method:"GET",
           data:{select:select, value:value, _token:_token, dependent:dependent},
           success:function(result)
             {
               $('#'+dependent).html(result);
              }

               })
            }
          });

       $('#category').change(function(){
       $('#element').val('');
       });
      });
   </script>

How to configure Symfony 5 service parameters during functional test?

$
0
0

How do I set the value of a Symfony 5 Service parameter during a functional test?

One of my routes under test uses a Service and this Service has a parameter set in services.yml.

In production mode everything works as expected but I would like to change the value of $my_arg during a test.

How can I do this? This is an extract from my services.yml:

parameters:
    app.my_param: 'foo'

services:
    ...
    App\Service\MyService:
        arguments:
            $my_arg: '%app.my_param%'

How to enable profiler in symfony 4

$
0
0

Solved:

I re-install it all over again and now it contains the web_profiler.yalm inside. Thanks to all.


The original question was:

I´m just starting to learn Symfony so I downloaded the free videos at KnpUniversity to get started. When I reached the video "Web Debug Toolbar & the Profiler!" I excecuted the next command:

> composer require profiler --dev

it installed OK.

Then, when I opened my app in the browser the "(...)slick black bar at the bottom..." didn't show up.

I read somewhere that maybe is due to I haven't installed symfony/debug but look at my composer.json:

"require-dev": {
        "sensiolabs/security-checker": "^4.1",
        "symfony/debug": "^4.0",
        "symfony/dotenv": "^4.0",
        "symfony/profiler-pack": "^1.0",
        "symfony/web-server-bundle": "^4.0"
    },

so I have it installed.

I excecuted the following command which give me the profiler configuration in my project:

> php bin/console debug:config web_profiler                   

Current configuration for extension with alias "web_profiler" 
============================================================= 

web_profiler:                                                 
    toolbar: false                                            
    intercept_redirects: false                                
    excluded_ajax_paths: '^/((index|app(_[\w]+)?)\.php/)?_wdt'

As you see above, the toolbar is set to false, How can I activate it? or How can I get the profiler bar showed up?

I'm using:

  • Composer version 1.6.5,
  • Symfony 4.1.1 and
  • PHP 7.2.7

Thanks in advance.

Solution:

I created a new project and it worked, it appears to be an error when composer was downloading the packages.

Problems with fos_user configuration

$
0
0

got my first symfony project ready for publishing but cannot get it running on my remote server (production).

My DEV server is a LINUX MINT 19.* and on remote I got Ubuntu 18.10. I made a checkout, enabled mod_rewrite, did a composer install to 1.7 and used composer install. It drawed me to update flex, which I did with "composer update symfony/flex". Now on composer install or composer update I get this error:

"There is no extension able to load the configuration for "fos_user" (in /var/www/web.tools.de/symfony/config/packages/fos_user.yaml). Looked for namespace "fos_user", found "framework", "twig", "swiftmailer", "security", "doctrine_cache", "doctrine", "doctrine_migrations", "monolog", "sensio_framework_extra", "web_profiler", "debug", "maker", "web_server" in /var/www/web.tools.de/symfony/config/packages/fos_user.yaml (which is loaded in resource "/var/www/web.tools.de/symfony/config/packages/fos_user.yaml")."

Could not find a solution on the web. Any hint?

Regards n00n

After some more search I found out that my FOS-user-bundle is not available. Composer install did not install ist. Tried it manually, but got this:

composer require friendsofsymfony/user-bundle Using version ^2.1 for friendsofsymfony/user-bundle ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages.

Problem 1 - Conclusion: don't install friendsofsymfony/user-bundle v2.1.2 - Conclusion: don't install friendsofsymfony/user-bundle v2.1.1 - Conclusion: remove symfony/swiftmailer-bundle v3.4.0 - Conclusion: don't install symfony/swiftmailer-bundle v3.4.0 - twig/twig v1.35.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.35.1 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.35.2 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.35.3 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.35.4 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.36.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.37.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.37.1 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.38.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.38.1 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.38.2 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.38.3 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.38.4 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.39.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.39.1 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.40.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.40.1 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.41.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.42.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.42.1 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.42.2 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.42.3 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.42.4 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.42.5 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.4.4 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.4.5 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.4.6 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.4.7 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.4.8 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.5.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.6.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.6.1 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.6.2 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.7.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.7.1 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.7.2 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.7.3 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.7.4 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.8.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.8.1 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.9.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.28.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.28.1 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.28.2 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.29.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.30.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.31.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.32.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.33.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.33.1 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.33.2 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.34.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.34.1 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.34.2 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.34.3 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v1.34.4 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.0.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.1.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.2.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.3.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.3.1 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.3.2 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.4.0 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.4.1 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.4.2 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - twig/twig v2.4.3 conflicts with symfony/swiftmailer-bundle[v3.4.0]. - Conclusion: don't install twig/twig v3.0.3|install twig/twig v1.28.0|install twig/twig v1.28.1|install twig/twig v1.28.2|install twig/twig v1.29.0|install twig/twig v1.30.0|install twig/twig v1.31.0|install twig/twig v1.32.0|install twig/twig v1.33.0|install twig/twig v1.33.1|install twig/twig v1.33.2|install twig/twig v1.34.0|install twig/twig v1.34.1|install twig/twig v1.34.2|install twig/twig v1.34.3|install twig/twig v1.34.4|install twig/twig v1.35.0|install twig/twig v1.35.1|install twig/twig v1.35.2|install twig/twig v1.35.3|install twig/twig v1.35.4|install twig/twig v1.36.0|install twig/twig v1.37.0|install twig/twig v1.37.1|install twig/twig v1.38.0|install twig/twig v1.38.1|install twig/twig v1.38.2|install twig/twig v1.38.3|install twig/twig v1.38.4|install twig/twig v1.39.0|install twig/twig v1.39.1|install twig/twig v1.40.0|install twig/twig v1.40.1|install twig/twig v1.41.0|install twig/twig v1.42.0|install twig/twig v1.42.1|install twig/twig v1.42.2|install twig/twig v1.42.3|install twig/twig v1.42.4|install twig/twig v1.42.5|install twig/twig v2.0.0|install twig/twig v2.1.0|install twig/twig v2.2.0|install twig/twig v2.3.0|install twig/twig v2.3.1|install twig/twig v2.3.2|install twig/twig v2.4.0|install twig/twig v2.4.1|install twig/twig v2.4.2|install twig/twig v2.4.3|install twig/twig v2.4.4|install twig/twig v2.4.5|install twig/twig v2.4.6|install twig/twig v2.4.7|install twig/twig v2.4.8|install twig/twig v2.5.0|install twig/twig v2.6.0|install twig/twig v2.6.1|install twig/twig v2.6.2|install twig/twig v2.7.0|install twig/twig v2.7.1|install twig/twig v2.7.2|install twig/twig v2.7.3|install twig/twig v2.7.4|install twig/twig v2.8.0|install twig/twig v2.8.1|install twig/twig v2.9.0 - Conclusion: don't install friendsofsymfony/user-bundle v2.1.2|remove twig/twig v3.0.3|install twig/twig v1.28.0|install twig/twig v1.28.1|install twig/twig v1.28.2|install twig/twig v1.29.0|install twig/twig v1.30.0|install twig/twig v1.31.0|install twig/twig v1.32.0|install twig/twig v1.33.0|install twig/twig v1.33.1|install twig/twig v1.33.2|install twig/twig v1.34.0|install twig/twig v1.34.1|install twig/twig v1.34.2|install twig/twig v1.34.3|install twig/twig v1.34.4|install twig/twig v1.35.0|install twig/twig v1.35.1|install twig/twig v1.35.2|install twig/twig v1.35.3|install twig/twig v1.35.4|install twig/twig v1.36.0|install twig/twig v1.37.0|install twig/twig v1.37.1|install twig/twig v1.38.0|install twig/twig v1.38.1|install twig/twig v1.38.2|install twig/twig v1.38.3|install twig/twig v1.38.4|install twig/twig v1.39.0|install twig/twig v1.39.1|install twig/twig v1.40.0|install twig/twig v1.40.1|install twig/twig v1.41.0|install twig/twig v1.42.0|install twig/twig v1.42.1|install twig/twig v1.42.2|install twig/twig v1.42.3|install twig/twig v1.42.4|install twig/twig v1.42.5|install twig/twig v2.0.0|install twig/twig v2.1.0|install twig/twig v2.2.0|install twig/twig v2.3.0|install twig/twig v2.3.1|install twig/twig v2.3.2|install twig/twig v2.4.0|install twig/twig v2.4.1|install twig/twig v2.4.2|install twig/twig v2.4.3|install twig/twig v2.4.4|install twig/twig v2.4.5|install twig/twig v2.4.6|install twig/twig v2.4.7|install twig/twig v2.4.8|install twig/twig v2.5.0|install twig/twig v2.6.0|install twig/twig v2.6.1|install twig/twig v2.6.2|install twig/twig v2.7.0|install twig/twig v2.7.1|install twig/twig v2.7.2|install twig/twig v2.7.3|install twig/twig v2.7.4|install twig/twig v2.8.0|install twig/twig v2.8.1|install twig/twig v2.9.0 - Conclusion: don't install friendsofsymfony/user-bundle v2.1.2|don't install twig/twig v3.0.3|install twig/twig v1.28.0|install twig/twig v1.28.1|install twig/twig v1.28.2|install twig/twig v1.29.0|install twig/twig v1.30.0|install twig/twig v1.31.0|install twig/twig v1.32.0|install twig/twig v1.33.0|install twig/twig v1.33.1|install twig/twig v1.33.2|install twig/twig v1.34.0|install twig/twig v1.34.1|install twig/twig v1.34.2|install twig/twig v1.34.3|install twig/twig v1.34.4|install twig/twig v1.35.0|install twig/twig v1.35.1|install twig/twig v1.35.2|install twig/twig v1.35.3|install twig/twig v1.35.4|install twig/twig v1.36.0|install twig/twig v1.37.0|install twig/twig v1.37.1|install twig/twig v1.38.0|install twig/twig v1.38.1|install twig/twig v1.38.2|install twig/twig v1.38.3|install twig/twig v1.38.4|install twig/twig v1.39.0|install twig/twig v1.39.1|install twig/twig v1.40.0|install twig/twig v1.40.1|install twig/twig v1.41.0|install twig/twig v1.42.0|install twig/twig v1.42.1|install twig/twig v1.42.2|install twig/twig v1.42.3|install twig/twig v1.42.4|install twig/twig v1.42.5|install twig/twig v2.0.0|install twig/twig v2.1.0|install twig/twig v2.2.0|install twig/twig v2.3.0|install twig/twig v2.3.1|install twig/twig v2.3.2|install twig/twig v2.4.0|install twig/twig v2.4.1|install twig/twig v2.4.2|install twig/twig v2.4.3|install twig/twig v2.4.4|install twig/twig v2.4.5|install twig/twig v2.4.6|install twig/twig v2.4.7|install twig/twig v2.4.8|install twig/twig v2.5.0|install twig/twig v2.6.0|install twig/twig v2.6.1|install twig/twig v2.6.2|install twig/twig v2.7.0|install twig/twig v2.7.1|install twig/twig v2.7.2|install twig/twig v2.7.3|install twig/twig v2.7.4|install twig/twig v2.8.0|install twig/twig v2.8.1|install twig/twig v2.9.0 - Conclusion: don't install friendsofsymfony/user-bundle v2.1.2|remove twig/twig v3.0.3|install twig/twig v1.28.0|install twig/twig v1.28.1|install twig/twig v1.28.2|install twig/twig v1.29.0|install twig/twig v1.30.0|install twig/twig v1.31.0|install twig/twig v1.32.0|install twig/twig v1.33.0|install twig/twig v1.33.1|install twig/twig v1.33.2|install twig/twig v1.34.0|install twig/twig v1.34.1|install twig/twig v1.34.2|install twig/twig v1.34.3|install twig/twig v1.34.4|install twig/twig v1.35.0|install twig/twig v1.35.1|install twig/twig v1.35.2|install twig/twig v1.35.3|install twig/twig v1.35.4|install twig/twig v1.36.0|install twig/twig v1.37.0|install twig/twig v1.37.1|install twig/twig v1.38.0|install twig/twig v1.38.1|install twig/twig v1.38.2|install twig/twig v1.38.3|install twig/twig v1.38.4|install twig/twig v1.39.0|install twig/twig v1.39.1|install twig/twig v1.40.0|install twig/twig v1.40.1|install twig/twig v1.41.0|install twig/twig v1.42.0|install twig/twig v1.42.1|install twig/twig v1.42.2|install twig/twig v1.42.3|install twig/twig v1.42.4|install twig/twig v1.42.5|install twig/twig v2.0.0|install twig/twig v2.1.0|install twig/twig v2.2.0|install twig/twig v2.3.0|install twig/twig v2.3.1|install twig/twig v2.3.2|install twig/twig v2.4.0|install twig/twig v2.4.1|install twig/twig v2.4.2|install twig/twig v2.4.3|install twig/twig v2.4.4|install twig/twig v2.4.5|install twig/twig v2.4.6|install twig/twig v2.4.7|install twig/twig v2.4.8|install twig/twig v2.5.0|install twig/twig v2.6.0|install twig/twig v2.6.1|install twig/twig v2.6.2|install twig/twig v2.7.0|install twig/twig v2.7.1|install twig/twig v2.7.2|install twig/twig v2.7.3|install twig/twig v2.7.4|install twig/twig v2.8.0|install twig/twig v2.8.1|install twig/twig v2.9.0 - Conclusion: don't install friendsofsymfony/user-bundle v2.1.2|don't install twig/twig v3.0.3|install twig/twig v1.28.0|install twig/twig v1.28.1|install twig/twig v1.28.2|install twig/twig v1.29.0|install twig/twig v1.30.0|install twig/twig v1.31.0|install twig/twig v1.32.0|install twig/twig v1.33.0|install twig/twig v1.33.1|install twig/twig v1.33.2|install twig/twig v1.34.0|install twig/twig v1.34.1|install twig/twig v1.34.2|install twig/twig v1.34.3|install twig/twig v1.34.4|install twig/twig v1.35.0|install twig/twig v1.35.1|install twig/twig v1.35.2|install twig/twig v1.35.3|install twig/twig v1.35.4|install twig/twig v1.36.0|install twig/twig v1.37.0|install twig/twig v1.37.1|install twig/twig v1.38.0|install twig/twig v1.38.1|install twig/twig v1.38.2|install twig/twig v1.38.3|install twig/twig v1.38.4|install twig/twig v1.39.0|install twig/twig v1.39.1|install twig/twig v1.40.0|install twig/twig v1.40.1|install twig/twig v1.41.0|install twig/twig v1.42.0|install twig/twig v1.42.1|install twig/twig v1.42.2|install twig/twig v1.42.3|install twig/twig v1.42.4|install twig/twig v1.42.5|install twig/twig v2.0.0|install twig/twig v2.1.0|install twig/twig v2.2.0|install twig/twig v2.3.0|install twig/twig v2.3.1|install twig/twig v2.3.2|install twig/twig v2.4.0|install twig/twig v2.4.1|install twig/twig v2.4.2|install twig/twig v2.4.3|install twig/twig v2.4.4|install twig/twig v2.4.5|install twig/twig v2.4.6|install twig/twig v2.4.7|install twig/twig v2.4.8|install twig/twig v2.5.0|install twig/twig v2.6.0|install twig/twig v2.6.1|install twig/twig v2.6.2|install twig/twig v2.7.0|install twig/twig v2.7.1|install twig/twig v2.7.2|install twig/twig v2.7.3|install twig/twig v2.7.4|install twig/twig v2.8.0|install twig/twig v2.8.1|install twig/twig v2.9.0 - Conclusion: don't install friendsofsymfony/user-bundle v2.1.1|remove twig/twig v3.0.3|install twig/twig v1.28.0|install twig/twig v1.28.1|install twig/twig v1.28.2|install twig/twig v1.29.0|install twig/twig v1.30.0|install twig/twig v1.31.0|install twig/twig v1.32.0|install twig/twig v1.33.0|install twig/twig v1.33.1|install twig/twig v1.33.2|install twig/twig v1.34.0|install twig/twig v1.34.1|install twig/twig v1.34.2|install twig/twig v1.34.3|install twig/twig v1.34.4|install twig/twig v1.35.0|install twig/twig v1.35.1|install twig/twig v1.35.2|install twig/twig v1.35.3|install twig/twig v1.35.4|install twig/twig v1.36.0|install twig/twig v1.37.0|install twig/twig v1.37.1|install twig/twig v1.38.0|install twig/twig v1.38.1|install twig/twig v1.38.2|install twig/twig v1.38.3|install twig/twig v1.38.4|install twig/twig v1.39.0|install twig/twig v1.39.1|install twig/twig v1.40.0|install twig/twig v1.40.1|install twig/twig v1.41.0|install twig/twig v1.42.0|install twig/twig v1.42.1|install twig/twig v1.42.2|install twig/twig v1.42.3|install twig/twig v1.42.4|install twig/twig v1.42.5|install twig/twig v2.0.0|install twig/twig v2.1.0|install twig/twig v2.2.0|install twig/twig v2.3.0|install twig/twig v2.3.1|install twig/twig v2.3.2|install twig/twig v2.4.0|install twig/twig v2.4.1|install twig/twig v2.4.2|install twig/twig v2.4.3|install twig/twig v2.4.4|install twig/twig v2.4.5|install twig/twig v2.4.6|install twig/twig v2.4.7|install twig/twig v2.4.8|install twig/twig v2.5.0|install twig/twig v2.6.0|install twig/twig v2.6.1|install twig/twig v2.6.2|install twig/twig v2.7.0|install twig/twig v2.7.1|install twig/twig v2.7.2|install twig/twig v2.7.3|install twig/twig v2.7.4|install twig/twig v2.8.0|install twig/twig v2.8.1|install twig/twig v2.9.0 - Conclusion: don't install friendsofsymfony/user-bundle v2.1.1|don't install twig/twig v3.0.3|install twig/twig v1.28.0|install twig/twig v1.28.1|install twig/twig v1.28.2|install twig/twig v1.29.0|install twig/twig v1.30.0|install twig/twig v1.31.0|install twig/twig v1.32.0|install twig/twig v1.33.0|install twig/twig v1.33.1|install twig/twig v1.33.2|install twig/twig v1.34.0|install twig/twig v1.34.1|install twig/twig v1.34.2|install twig/twig v1.34.3|install twig/twig v1.34.4|install twig/twig v1.35.0|install twig/twig v1.35.1|install twig/twig v1.35.2|install twig/twig v1.35.3|install twig/twig v1.35.4|install twig/twig v1.36.0|install twig/twig v1.37.0|install twig/twig v1.37.1|install twig/twig v1.38.0|install twig/twig v1.38.1|install twig/twig v1.38.2|install twig/twig v1.38.3|install twig/twig v1.38.4|install twig/twig v1.39.0|install twig/twig v1.39.1|install twig/twig v1.40.0|install twig/twig v1.40.1|install twig/twig v1.41.0|install twig/twig v1.42.0|install twig/twig v1.42.1|install twig/twig v1.42.2|install twig/twig v1.42.3|install twig/twig v1.42.4|install twig/twig v1.42.5|install twig/twig v2.0.0|install twig/twig v2.1.0|install twig/twig v2.2.0|install twig/twig v2.3.0|install twig/twig v2.3.1|install twig/twig v2.3.2|install twig/twig v2.4.0|install twig/twig v2.4.1|install twig/twig v2.4.2|install twig/twig v2.4.3|install twig/twig v2.4.4|install twig/twig v2.4.5|install twig/twig v2.4.6|install twig/twig v2.4.7|install twig/twig v2.4.8|install twig/twig v2.5.0|install twig/twig v2.6.0|install twig/twig v2.6.1|install twig/twig v2.6.2|install twig/twig v2.7.0|install twig/twig v2.7.1|install twig/twig v2.7.2|install twig/twig v2.7.3|install twig/twig v2.7.4|install twig/twig v2.8.0|install twig/twig v2.8.1|install twig/twig v2.9.0 - Installation request for symfony/swiftmailer-bundle (locked at v3.4.0, required as ^3.1) -> satisfiable by symfony/swiftmailer-bundle[v3.4.0]. - Conclusion: don't install friendsofsymfony/user-bundle v2.1.1|remove twig/twig v3.0.3|install twig/twig v1.28.0|install twig/twig v1.28.1|install twig/twig v1.28.2|install twig/twig v1.29.0|install twig/twig v1.30.0|install twig/twig v1.31.0|install twig/twig v1.32.0|install twig/twig v1.33.0|install twig/twig v1.33.1|install twig/twig v1.33.2|install twig/twig v1.34.0|install twig/twig v1.34.1|install twig/twig v1.34.2|install twig/twig v1.34.3|install twig/twig v1.34.4|install twig/twig v1.35.0|install twig/twig v1.35.1|install twig/twig v1.35.2|install twig/twig v1.35.3|install twig/twig v1.35.4|install twig/twig v1.36.0|install twig/twig v1.37.0|install twig/twig v1.37.1|install twig/twig v1.38.0|install twig/twig v1.38.1|install twig/twig v1.38.2|install twig/twig v1.38.3|install twig/twig v1.38.4|install twig/twig v1.39.0|install twig/twig v1.39.1|install twig/twig v1.40.0|install twig/twig v1.40.1|install twig/twig v1.41.0|install twig/twig v1.42.0|install twig/twig v1.42.1|install twig/twig v1.42.2|install twig/twig v1.42.3|install twig/twig v1.42.4|install twig/twig v1.42.5|install twig/twig v2.0.0|install twig/twig v2.1.0|install twig/twig v2.2.0|install twig/twig v2.3.0|install twig/twig v2.3.1|install twig/twig v2.3.2|install twig/twig v2.4.0|install twig/twig v2.4.1|install twig/twig v2.4.2|install twig/twig v2.4.3|install twig/twig v2.4.4|install twig/twig v2.4.5|install twig/twig v2.4.6|install twig/twig v2.4.7|install twig/twig v2.4.8|install twig/twig v2.5.0|install twig/twig v2.6.0|install twig/twig v2.6.1|install twig/twig v2.6.2|install twig/twig v2.7.0|install twig/twig v2.7.1|install twig/twig v2.7.2|install twig/twig v2.7.3|install twig/twig v2.7.4|install twig/twig v2.8.0|install twig/twig v2.8.1|install twig/twig v2.9.0 - Conclusion: don't install friendsofsymfony/user-bundle v2.1.1|don't install twig/twig v3.0.3|install twig/twig v1.28.0|install twig/twig v1.28.1|install twig/twig v1.28.2|install twig/twig v1.29.0|install twig/twig v1.30.0|install twig/twig v1.31.0|install twig/twig v1.32.0|install twig/twig v1.33.0|install twig/twig v1.33.1|install twig/twig v1.33.2|install twig/twig v1.34.0|install twig/twig v1.34.1|install twig/twig v1.34.2|install twig/twig v1.34.3|install twig/twig v1.34.4|install twig/twig v1.35.0|install twig/twig v1.35.1|install twig/twig v1.35.2|install twig/twig v1.35.3|install twig/twig v1.35.4|install twig/twig v1.36.0|install twig/twig v1.37.0|install twig/twig v1.37.1|install twig/twig v1.38.0|install twig/twig v1.38.1|install twig/twig v1.38.2|install twig/twig v1.38.3|install twig/twig v1.38.4|install twig/twig v1.39.0|install twig/twig v1.39.1|install twig/twig v1.40.0|install twig/twig v1.40.1|install twig/twig v1.41.0|install twig/twig v1.42.0|install twig/twig v1.42.1|install twig/twig v1.42.2|install twig/twig v1.42.3|install twig/twig v1.42.4|install twig/twig v1.42.5|install twig/twig v2.0.0|install twig/twig v2.1.0|install twig/twig v2.2.0|install twig/twig v2.3.0|install twig/twig v2.3.1|install twig/twig v2.3.2|install twig/twig v2.4.0|install twig/twig v2.4.1|install twig/twig v2.4.2|install twig/twig v2.4.3|install twig/twig v2.4.4|install twig/twig v2.4.5|install twig/twig v2.4.6|install twig/twig v2.4.7|install twig/twig v2.4.8|install twig/twig v2.5.0|install twig/twig v2.6.0|install twig/twig v2.6.1|install twig/twig v2.6.2|install twig/twig v2.7.0|install twig/twig v2.7.1|install twig/twig v2.7.2|install twig/twig v2.7.3|install twig/twig v2.7.4|install twig/twig v2.8.0|install twig/twig v2.8.1|install twig/twig v2.9.0 - Installation request for friendsofsymfony/user-bundle ^2.1 -> satisfiable by friendsofsymfony/user-bundle[v2.1.0, v2.1.1, v2.1.2]. - Conclusion: remove twig/twig v3.0.3|install twig/twig v1.28.0|install twig/twig v1.28.1|install twig/twig v1.28.2|install twig/twig v1.29.0|install twig/twig v1.30.0|install twig/twig v1.31.0|install twig/twig v1.32.0|install twig/twig v1.33.0|install twig/twig v1.33.1|install twig/twig v1.33.2|install twig/twig v1.34.0|install twig/twig v1.34.1|install twig/twig v1.34.2|install twig/twig v1.34.3|install twig/twig v1.34.4|install twig/twig v1.35.0|install twig/twig v1.35.1|install twig/twig v1.35.2|install twig/twig v1.35.3|install twig/twig v1.35.4|install twig/twig v1.36.0|install twig/twig v1.37.0|install twig/twig v1.37.1|install twig/twig v1.38.0|install twig/twig v1.38.1|install twig/twig v1.38.2|install twig/twig v1.38.3|install twig/twig v1.38.4|install twig/twig v1.39.0|install twig/twig v1.39.1|install twig/twig v1.40.0|install twig/twig v1.40.1|install twig/twig v1.41.0|install twig/twig v1.42.0|install twig/twig v1.42.1|install twig/twig v1.42.2|install twig/twig v1.42.3|install twig/twig v1.42.4|install twig/twig v1.42.5|install twig/twig v2.0.0|install twig/twig v2.1.0|install twig/twig v2.2.0|install twig/twig v2.3.0|install twig/twig v2.3.1|install twig/twig v2.3.2|install twig/twig v2.4.0|install twig/twig v2.4.1|install twig/twig v2.4.2|install twig/twig v2.4.3|install twig/twig v2.4.4|install twig/twig v2.4.5|install twig/twig v2.4.6|install twig/twig v2.4.7|install twig/twig v2.4.8|install twig/twig v2.5.0|install twig/twig v2.6.0|install twig/twig v2.6.1|install twig/twig v2.6.2|install twig/twig v2.7.0|install twig/twig v2.7.1|install twig/twig v2.7.2|install twig/twig v2.7.3|install twig/twig v2.7.4|install twig/twig v2.8.0|install twig/twig v2.8.1|install twig/twig v2.9.0 - friendsofsymfony/user-bundle v2.1.0 requires twig/twig ^1.28 || ^2.0 -> satisfiable by twig/twig[v1.28.0, v1.28.1, v1.28.2, v1.29.0, v1.30.0, v1.31.0, v1.32.0, v1.33.0, v1.33.1, v1.33.2, v1.34.0, v1.34.1, v1.34.2, v1.34.3, v1.34.4, v1.35.0, v1.35.1, v1.35.2, v1.35.3, v1.35.4, v1.36.0, v1.37.0, v1.37.1, v1.38.0, v1.38.1, v1.38.2, v1.38.3, v1.38.4, v1.39.0, v1.39.1, v1.40.0, v1.40.1, v1.41.0, v1.42.0, v1.42.1, v1.42.2, v1.42.3, v1.42.4, v1.42.5, v2.0.0, v2.1.0, v2.10.0, v2.11.0, v2.11.1, v2.11.2, v2.11.3, v2.12.0, v2.12.1, v2.12.2, v2.12.3, v2.12.4, v2.12.5, v2.2.0, v2.3.0, v2.3.1, v2.3.2, v2.4.0, v2.4.1, v2.4.2, v2.4.3, v2.4.4, v2.4.5, v2.4.6, v2.4.7, v2.4.8, v2.5.0, v2.6.0, v2.6.1, v2.6.2, v2.7.0, v2.7.1, v2.7.2, v2.7.3, v2.7.4, v2.8.0, v2.8.1, v2.9.0]. - Can only install one of: twig/twig[v2.10.0, v3.0.3]. - Can only install one of: twig/twig[v2.11.0, v3.0.3]. - Can only install one of: twig/twig[v2.11.1, v3.0.3]. - Can only install one of: twig/twig[v2.11.2, v3.0.3]. - Can only install one of: twig/twig[v2.11.3, v3.0.3]. - Can only install one of: twig/twig[v2.12.0, v3.0.3]. - Can only install one of: twig/twig[v2.12.1, v3.0.3]. - Can only install one of: twig/twig[v2.12.2, v3.0.3]. - Can only install one of: twig/twig[v2.12.3, v3.0.3]. - Can only install one of: twig/twig[v2.12.4, v3.0.3]. - Can only install one of: twig/twig[v2.12.5, v3.0.3]. - Installation request for twig/twig (locked at v3.0.3) -> satisfiable by twig/twig[v3.0.3].

Installation failed, reverting ./composer.json to its original content.

validate embedded model in api platform

$
0
0

I have this Order model:

<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use Symfony\Component\Serializer\Annotation\Groups;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\SerializedName;
use Symfony\Component\Validator\Constraints as Assert;
/**
 * @ApiResource(
 *     itemOperations={
 *          "get"={
 *              "normalization_context"={
 *                  "groups"={"order:view"}
 *              }
 *          },
 *          "patch"={
 *              "normalization_context"={
 *                  "groups"={"order:view"}
 *              },
 *              "denormalization_context"={
 *                  "groups"={"upsert"}
 *              }
 *          },
 *          "delete"
 *     },
 *     collectionOperations={
 *          "get"={
 *              "normalization_context"={
 *                  "groups"={"order:index"}
 *              }
 *          },
 *          "post"={
 *              "normalization_context"={
 *                  "groups"={"order:view"}
 *              },
 *              "denormalization_context"={
 *                  "groups"={"order:create"}
 *              }
 *          }
 *     }
 * )
 * @ORM\Entity(repositoryClass="App\Repository\OrderRepository")
 * @ORM\Table(name="`order`")
 */
class Order
{
    /**
     * @ORM\Id()
     * @ORM\GeneratedValue()
     * @ORM\Column(type="integer")
     * @Groups({"order:index", "order:view"})
     */
    private $id;
    /**
     * @ORM\Column(type="integer")
     * @Assert\PositiveOrZero()
     * @Groups({"order:index", "order:view"})
     */
    private $amount;
    /**
     * @ORM\OneToMany(targetEntity="App\Entity\OrderItem", mappedBy="orderId")
     * @Groups({"order:index", "order:view", "order:create"})
     */
    private $orderItems;
    /**
     * @ORM\ManyToOne(targetEntity="App\Entity\Merchant", inversedBy="orders")
     * @ORM\JoinColumn(nullable=false)
     * @Groups({"order:index", "order:view"})
     */
    private $merchant;
    /**
     * Order constructor.
     */
    public function __construct()
    {
        $this->orderItems = new ArrayCollection();
    }
    /**
     * @return string
     */
    public function __toString(): string {
        return $this->id;
    }
    /**
     * @return int|null
     */
    public function getId(): ?int
    {
        return $this->id;
    }
    /**
     * @return int|null
     */
    public function getAmount(): ?int
    {
        return $this->amount;
    }
    /**
     * @param int $amount
     * @return Order
     */
    public function setAmount(int $amount): self
    {
        $this->amount = $amount;
        return $this;
    }
    /**
     * @Assert\Valid
     */
    public function getOrderItems()
    {
        return $this->orderItems->getValues();
    }
    /**
     * @param OrderItem $orderItem
     * @return Order
     */
    public function addOrderItem(OrderItem $orderItem): self
    {
        if (!$this->orderItems->contains($orderItem)) {
            $this->orderItems[] = $orderItem;
            $orderItem->setOrderId($this);
        }
        return $this;
    }
    /**
     * @param OrderItem $orderItem
     * @return Order
     */
    public function removeOrderItem(OrderItem $orderItem): self
    {
        if ($this->orderItems->contains($orderItem)) {
            $this->orderItems->removeElement($orderItem);
            // set the owning side to null (unless already changed)
            if ($orderItem->getOrderId() === $this) {
                $orderItem->setOrderId(null);
            }
        }
        return $this;
    }
    /**
     * @return Merchant|null
     */
    public function getMerchant(): ?Merchant
    {
        return $this->merchant;
    }
    /**
     * @param Merchant|null $merchant
     * @return Order
     */
    public function setMerchant(?Merchant $merchant): self
    {
        $this->merchant = $merchant;
        return $this;
    }
}

and this OrderItem model

<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use Symfony\Component\Serializer\Annotation\Groups;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\SerializedName;
use Symfony\Component\Validator\Constraints as Assert;
/**
 * @ApiResource()
 * @ORM\Entity(repositoryClass="App\Repository\OrderItemRepository")
 */
class OrderItem
{
    /**
     * @ORM\Id()
     * @ORM\GeneratedValue()
     * @ORM\Column(type="integer")
     * @Groups({"view", "order:view", "order:index"})
     */
    private $id;
    /**
     * @ORM\ManyToOne(targetEntity="App\Entity\Product")
     * @ORM\JoinColumn(nullable=false)
     * @SerializedName("product")
     * @Assert\NotBlank()
     * @Groups({"view", "order:view", "order:index", "order:create"})
     */
    private $productId;
    /**
     * @ORM\ManyToOne(targetEntity="App\Entity\Order", inversedBy="orderItems")
     * @SerializedName("order")
     * @ORM\JoinColumn(nullable=false)
     */
    private $orderId;
    /**
     * @ORM\Column(type="integer")
     * @Assert\NotBlank()
     * @Assert\PositiveOrZero()
     * @Groups({"view", "order:view", "order:index", "order:create"})
     */
    private $num;
    /**
     * @ORM\Column(type="integer")
     * @SerializedName("total_amount")
     * @Assert\PositiveOrZero()
     * @Groups({"view", "order:view", "order:index"})
     */
    private $totalAmount;
    /**
     * @return string
     */
    public function __toString(): string {
        return $this->id;
    }
    /**
     * @return int|null
     */
    public function getId(): ?int
    {
        return $this->id;
    }
    /**
     * @return Product|null
     */
    public function getProductId(): ?Product
    {
        return $this->productId;
    }
    /**
     * @param Product|null $productId
     * @return OrderItem
     */
    public function setProductId(?Product $productId): self
    {
        $this->productId = $productId;
        return $this;
    }
    /**
     * @return Order|null
     */
    public function getOrderId(): ?Order
    {
        return $this->orderId;
    }
    /**
     * @param Order|null $orderId
     * @return OrderItem
     */
    public function setOrderId(?Order $orderId): self
    {
        $this->orderId = $orderId;
        return $this;
    }
    /**
     * @return int|null
     */
    public function getNum(): ?int
    {
        return $this->num;
    }
    /**
     * @param int $num
     * @return OrderItem
     */
    public function setNum(int $num): self
    {
        $this->num = $num;
        return $this;
    }
    /**
     * @return int|null
     */
    public function getItemAmount(): ?int
    {
        return $this->itemAmount;
    }
    /**
     * @param int $itemAmount
     * @return OrderItem
     */
    public function setItemAmount(int $itemAmount): self
    {
        $this->itemAmount = $itemAmount;
        return $this;
    }
    /**
     * @return int|null
     */
    public function getTotalAmount(): ?int
    {
        return $this->totalAmount;
    }
    /**
     * @param int $totalAmount
     * @return OrderItem
     */
    public function setTotalAmount(int $totalAmount): self
    {
        $this->totalAmount = $totalAmount;
        return $this;
    }
}

I'm trying to create an order with its item in a single post request using embedded nested items instead of item IRIs. As documentation suggests I add @Assert\Valid for orderItems getter method inside Order model. but it doesn't validate my orderItem data in the post request.

How to add the input username in fosCommentBundle without fosUser?

$
0
0

I want to add the Username field (input) in bundle FOSCommentBundle without using FOSUserBundlde.

the user must enter his username and comment. The basic model does not offer the pseudo field because it relies on the connected user or "anonymous" if no connected user.

Can you tell me how to do this?

Symfony 4.4

Thank's

List depend to onther one in symfony 4

$
0
0

How can i show a list of an object that depend to another object (for example the list of student depend to the class room) with symfony 4


How to pass data into CollectionType form and get it there?

$
0
0

How can I get in correct way data which send into a collection?

Important:

If I delete from the Create Form class this line:

'data'=> array_values($builder->getData()->cpus), //TODO: shit code send data And add in Collection 

And add in Collection Form class this:

'data_class' => Command::class, //namespace (Collection\Command)

This works only in view (twig) stage, but firstly I have to get those data before creating collection form (view).

How can I do that?

At this moment I found this solution (which looks "shitty") :). Lines marked as TODO

Collection\Command:

class Command
{
    public $id_item;
    /**
     * @var ItemInterface $interface
     */
    public $interface;
    public $id_object;

    public function __construct(string $id_item, ItemInterface $interface)
    {
        $this->id_item = $id_item;
        $this->interface = $interface;
    }

    public function getIdItem(): string
    {
        return $this->id_item;
    }

    public function getInterface(): ItemInterface
    {
        return $this->interface;
    }
}

There is the problem, I can't get data from $cpus in good way :)

Collection\Form:

class Form extends AbstractType
{
    private $cpuModelFetcher;

    public function __construct(CpuModelFetcher $cpuModelFetcher)
    {
        $this->cpuModelFetcher = $cpuModelFetcher;
    }

    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $index = (int)$builder->getName(); //TODO: shit code - use name of form as index.
        /**
         * @var Command $command
         */
        $command = $builder->getData()[$index]; //TODO: shit code get data from array

        $builder
            ->add('id_object', Type\ChoiceType::class,
                [
                    'choices' => array_flip($this->cpuModelFetcher->getSupportedCpuModelListForModelBasedDeviceBySocketType(
                        $command->getIdItem(),$command->getInterface()->getId())),
                    'placeholder' => 'not installed in '.$command->getInterface()->getName().' socket.',
                    'required' => false,
                ]);
    }

    public function configureOptions(OptionsResolver $resolver): void
    {
        $resolver->setDefaults(array(
            //'data_class' => Command::class,
            'data_class' => null,
        ));
    }
}

Create Command:

class Command
{
    /**
     * @Assert\NotBlank()
     */
    private $id;
    public $cpus;

    private function __construct(Id $id)
    {
        $this->id = $id;
    }

    public static function fromDevice(Device $device): self
    {
        $command = new self($device->getId());
        if($device->getBasedType()->isModelBasedDevice()){
            $command->cpus = $command->transformDeviceModelInterfaceCollectionToCommandArray($device->getId(),
                $device->getModelBasedDevice()->getDeviceModel()->getCpuInterfaces());
        }

        return $command;
    }

    private function transformDeviceModelInterfaceCollectionToCommandArray(Id $id_item, ArrayCollection $interfaces): array
    {
        $object_specific_interfaces = [];
        foreach ($interfaces as $one){
            /**
             * @var DeviceModelInterface $one
             */
            for($i=0; $i<$one->getAmount(); $i++){
                $object_specific_interfaces[] = new Collection\Command($id_item->getValue(), $one->getInterface());
            }
        }
        unset($one);
        return $object_specific_interfaces;
    }
}

Create Form:

class Form extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        //dump($builder);
        $builder
            ->add('cpus', CollectionType::class, [
                'label' => false,
                'entry_type' => Collection\Form::class,
                'entry_options' => [
                    'label' => false,
                    'data'=> array_values($builder->getData()->cpus), //TODO: shit code send data
                ],
                'by_reference' => true,
                'allow_add' => false,
                'allow_delete' => false,
                'delete_empty' => true,
            ])
            ->add('save', Type\SubmitType::class, [
                'attr' => ['class' => 'btn btn-primary'],
            ]);
    }

    public function configureOptions(OptionsResolver $resolver): void
    {
        $resolver->setDefaults(array(
            'data_class' => Command::class,
        ));
    }
}

Thank you for any help.

Symfony make:entity and Single Table Inheritance issue

$
0
0

Symfony version: 4.4.x / Doctrine: 2.6.x

I use make:entity --regenerate command in Symfony console to generate getters/setters for my classes. I am getting a particular issue with single table inherited classes. Despite the parent table having all the variables and properties declared, make:entity ends up creating private variables and methods in inherited table.

///Class InfoItem
/**
* @ORM\Entity
* @ORM\InheritanceType("SINGLE_TABLE")
* @ORM\DiscriminatorColumn(name="item_type", type="string", length=20)
* @ORM\DiscriminatorMap({"uom"="Uom"})
*/
abstract class InfoItem{
  /**
    * @ORM\Id
    * @ORM\Column(type="integer")
    * @ORM\GeneratedValue(strategy="AUTO")
    * @var integer 
    */    
    protected $id;   

   /**
     * @ORM\Column(type="string", length=20, nullable=true)
     * @var string
     */
    protected $code;


    public function getId()
    {
        return $this->id;
    }

    public function getCode(): ?string
    {
        return $this->code;
    }

    public function setCode(?string $code): self
    {
        $this->code = $code;

        return $this;
    }    
}

///Class Uom
/**
* @ORM\Entity
*/
class Uom extends InfoItem
{
}

Now when I run php bin/console make:entity --regenerate, the command results in an unnecessary modification of Uom class.

class Uom{

    private $id;
    private $code;

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getCode(): ?string
    {
        return $this->code;
    }

    public function setCode(?string $code): self
    {
        $this->code = $code;

        return $this;
    }
}

And if you run the make:entity command again, it results in an error:

Compile Error: Access level to App\Entity\Uom::$id must be protected (as in class App\Entity\InfoItem) or weaker

Please advise. This is proving to be a major headache.

Error 500 "PHP Fatal error: Uncaught RuntimeException: APP_ENV environment variable is not defined." on Symfony app start

$
0
0

I recently deployed a new Symfony 4 project to a prod server where I set (via ssh) both APP_ENV and APP_SECRET among others, as environment variables. Both commands printenv and set list those variables in their output so I assume everything should be fine on that part.

I get an error 500 on the site though, the log returning PHP Fatal error: Uncaught RuntimeException: APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.

What am I missing here ?

passwordEncoder generated hash for non-authentication purpose fails on verification

$
0
0

For a user to register with my system, I'm sending a confirmation mail with a generated link. On click the system should set an active property to true.

To create the confirm link, I generate a md5 hashed random_byte value. This value is part of the link I send to the user. The value is hashed with the passwordEncoder and stored in my database.

When the user clicks the link, the system checks the value against the hash in my database and should return true, to fully activate the user. For some reason the verification fails.

I checked, that the generated $identifier value in register() is the one that gets send to the user. They match. So no mistake there.

At first I wanted to use password_verify() only, but that didn't work out either.

I simply have no clue, why it's not working. My last guess is, that there is some Symfony dark magic going on, that I'm not aware of.

public function register(EntityManagerInterface $entityManager, Request $request, UserPasswordEncoderInterface $passwordEncoder, MailerInterface $mailer)
{
    // Register-Form
    $form = $this->createForm(RegisterFormType::class);

    $form->handleRequest($request);
    if ($form->isSubmitted() && $form->isValid()) {

        /** @var User $user */
        $user = $form->getData();

        $user->setPassword($passwordEncoder->encodePassword(
            $user,
            $form['plainPassword']->getData()
        ));

        // create activation hash
        $identifier = md5(random_bytes(16));

        $user->setActiveHash(
            $passwordEncoder->encodePassword(
                $user,
                $identifier
            )
        );


        // send activation mail with activation hash
        $message = (new TemplatedEmail())
            ->subject('...')
            ->from('...')
            ->to($user->getEmail())
            ->textTemplate('emails/registration.txt.twig')
            ->context([
                'mail' => $user->getEmail(),
                'identifier' => $identifier,
            ])
        ;

        $mailer->send($message);

        // persist & flush
        $entityManager->persist($user);
        $entityManager->flush();

        $this->addFlash('success', '...');

        //return $this->redirectToRoute('login');
        return $this->render('home/index.html.twig');
    }

    return $this->render('security/register.html.twig', [
        'registerForm' => $form->createView()
    ]);

}


/**
 * @Route("/confirm/{email}/{identifier}", name="register.confirm")
 */
public function confirm($email, $identifier, EntityManagerInterface $entityManager, UserPasswordEncoderInterface $passwordEncoder)
{
    $user = $entityManager->getRepository(User::class)->findOneBy([
        'email' => $email,
        'active' => false
    ]);

    if (!$user) {
        // fail no user with email
        die('no such user');
    }

    if( !$passwordEncoder->isPasswordValid($user, $identifier) ){
        // Hash verification failed
        die('hash failed');
    }

    $user->setActive(true);

    $entityManager->persist($user);
    $entityManager->flush();

    $this->addFlash('success', '...');

    return $this->redirectToRoute('login');

}

EDIT: I tried manually hashing a string with password_hash('a_string', PASSWORD_ARGON2ID) and it throws an exception that PASSWORD_ARGON2ID is an undefined constant. PASSWORD_ARGON2I works. And Symfony somehow uses Argon2ID as my password strings and the activeHash strings generated through encodePassword() start with "$argon2id..." How is that possible?

Symfony 4 and MercureBundle

$
0
0

I'm a new user of this platform and I'm trying to integrate Mercure into Symfony by following the documentation: https://symfony.com/blog/symfony-gets-real-time-push-capabilities . Once all the steps in the console are followed of chrome to the response of the Publisher class an error is generated:

net :: ERR_ABORTED 406.

Could you help me to understand how to make this bundle work?

namespace App\Controller;

use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Mercure\Publisher;
use Symfony\Component\Mercure\Update;

class PublishController
{
    public function __invoke(Publisher $publisher)
    {
        $update = new Update(
            'http://example.com/books/1',
            json_encode(['status' => 'OutOfStock'])
        );


        // The Publisher service is an invokable object
        $publisher($update);
    }
}

const es = new EventSource('https://www.davidecpr.online/hub?topic=' + encodeURIComponent('http://example.com/books/1'));
            es.onmessage = e => {
                // Will be called every time an update is published by the server
                console.log(JSON.parse(e.data));
            };

The .env variable is set like this: 'MERCURE_PUBLISH_URL' =>'http://www.davidecpr.online:3000/hub'

Viewing all 3916 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>