Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot declare trait Khill\Lavacharts\Support\Traits\HasOptionsTrait, because the name is already in use #275

Open
glauberm opened this issue Oct 11, 2018 · 5 comments
Labels

Comments

@glauberm
Copy link

What Version?

3.1.11

Issue

Getting following error in Symfony 3.4 with PHP 7.1:

Error: Cannot declare trait Khill\Lavacharts\Support\Traits\HasOptionsTrait, because the name is already in use

Controller Code (chart creation code)

        $lava = $this->get('lavacharts');
        $lava->setLocale('pt_BR');
        $table = $lava->DataTable();

        $table->addStringColumn('Ano')
            ->addNumberColumn('Filmes com profissionais mulheres')
            ->addNumberColumn('Total de filmes')
        ;

        foreach ($qb->getQuery()->getResult() as $ano) {
            $table->addRow([
                $ano->getNome(), $ano->getNumFilmeProfissional(), $ano->getTotalFilme()
            ]);
        }

        $chart = $lava->AreaChart('AnoGraficoIndex', $table, $this->chartDefaultOptions());

View Code

<div id="ano_list_chart" class="grafico"></div>
{{ areachart('AnoGraficoIndex', 'ano_list_chart')|raw }}
@kevinkhill
Copy link
Owner

Does Symfony already have that trait?

@glauberm
Copy link
Author

@kevinkhill No. Neither Symfony nor the project dependencies.

@OCoulonAckwa
Copy link

Same problem for me
Any help would be appreciated

Version 3.1
Symfony 4
PHP 7.1.3

@glauberm
Copy link
Author

glauberm commented Mar 8, 2019

@OCoulonAckwa IIRC, deleting the vendor folder and running a fresh composer install fixed the problem.

@JWPapi
Copy link

JWPapi commented Oct 11, 2019

Unfortunately not for me.

for me the full line is:

!! PHP Fatal error: Cannot declare trait Khill\Lavacharts\Support\Traits\HasOptionsTrait, because the name is already in use in /var/www/igStoryViewer/vendor/khill/lavacharts/src/Support/Traits/HasOptionsTrait.php on line 22

I wonder why it tries to get the same HasOptionsTrait from different sources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants