PHP constructor arguments?
<p>I'm building a class that needs two arguments, and they can be passed through <code>__constructor</code>, or they can be set using setter methods.</p>

<p>What is the best way to check if arguments are passed through constructor?</p>

<p>I did it like this:</p>

<pre><code>class Services {

    public function __construct(array $configs, array $services)
    {
        if(isset($configs) AND isset($services)) {
            $this-&gt;configs = $configs;
            $this-&gt;services = $services;
        }
    }

    public function setConfigs(array $configs)
    {
        $this-&gt;config = $configs;
    }

    public function setServices(array $services)
    {
        $this-&gt;services = $services;
    }
}   
</code></pre>

<p>Now this works fine, but I'm not 100% if  this is the right way.
The thing thats bothering me is that if arguments are passed through constructor, I want both of them there, not only one.</p>

<p>How would I prevent user to put only one argument in constructor?</p>
