Hello if I use trait Nette\StaticClass the extension Search automatically register the class like a service to container.
There are two ways:
1) in trait Nette\StaticClass change visibility of constructor from final public to private. The ReflectionClass::isInstantiable will work fine. I prefer
2) add exception for this trait to Search extension
I know if you have registered static classes, it doesn't matter, because these classes are not in constructors, but this is no reason to register in container.
Example of bad behavior:
namespace Uget;
use Nette\StaticClass;
final class Tools
{
use StaticClass;
}
In Container i see
public function createService017(): Uget\Tools
{
return new Uget\Tools; // throw exception
}
Hello if I use trait Nette\StaticClass the extension Search automatically register the class like a service to container.
There are two ways: 1) in trait Nette\StaticClass change visibility of constructor from final public to private. The ReflectionClass::isInstantiable will work fine. I prefer
2) add exception for this trait to Search extension
Example of bad behavior:
In Container i see
I must add to ignore