Sanpi\Behatch\Json\Json::getContent PHP Méthode

getContent() public méthode

public getContent ( )
    public function getContent()
    {
        return $this->content;
    }

Usage Example

Exemple #1
0
 public function validate(Json $json, Validator $validator)
 {
     $validator->check($json->getContent(), $this->getContent());
     if (!$validator->isValid()) {
         $msg = "JSON does not validate. Violations:" . PHP_EOL;
         foreach ($validator->getErrors() as $error) {
             $msg .= sprintf("  - [%s] %s" . PHP_EOL, $error['property'], $error['message']);
         }
         throw new \Exception($msg);
     }
     return true;
 }