Skip to content

Conversation

@tacman
Copy link
Contributor

@tacman tacman commented Dec 3, 2018

Use Dependency Injection instead of the container.

Use Dependency Injection instead of the container.
@peter-gribanov
Copy link

@tacman this code in your PR is not working

use Javer\SphinxBundle\Sphinx\Manager;
use Knp\Component\Pager\Pagination\PaginationInterface;
use Doctrine\ORM\EntityManagerInterface;
     public function __construct(EntityManagerInterface $em, 
                                PaginatorInterface $paginator,
                                Manager $sphinx)
                                
    private $sphinx;
    private $em;
    private $paginator;
                                
    {
        $this->sphinx = $sphinx;
        $this->em = $em;
        $this->paginator = $paginator;
    }

Do you declare the global function __construct()?
Maybe this is a class code?
Why do you declare properties in the middle of a function/method declaration?

@tacman
Copy link
Contributor Author

tacman commented Dec 3, 2018 via email

@tacman
Copy link
Contributor Author

tacman commented Dec 3, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants