Non-static method
kris-terziev opened this issue · 3 comments
kris-terziev commented
Hello,
The package looks great but i get this error:
Non-static method should not be called statically.
weboAp commented
can you post more info about the error so i can troubleshoot it? thanks
cihadturhan commented
Same problem here. Here is a simple code so you can know the issue
<?php
use Weboap\Visitor\Visitor;
class Log
{
public function test(){
Visitor::log();
}
}
weboAp commented
replace the statement
use Weboap\Visitor\Visitor;
with
use Visitor; // the package Facade.
you can use also
<?php
use Weboap\Visitor\Visitor;
class Log
{
protected $visitor;
public function test(Visitor $visitor){
$visitor->log();
}
}