Phue\Command\GetRules::send PHP Method

send() public method

Send command
public send ( Client $client ) : Rule[]
$client Phue\Client Phue Client
return Phue\Rule[] List of Rule objects
    public function send(Client $client)
    {
        // Get response
        $results = $client->getTransport()->sendRequest("/api/{$client->getUsername()}/rules");
        $rules = array();
        foreach ($results as $ruleId => $attributes) {
            $rules[$ruleId] = new Rule($ruleId, $attributes, $client);
        }
        return $rules;
    }
GetRules