Google\Cloud\Vision\Annotation::safeSearch PHP Method

safeSearch() public method

Example: $safeSearch = $annotation->safeSearch();
public safeSearch ( ) : SafeSearch | null
return Google\Cloud\Vision\Annotation\SafeSearch | null
    public function safeSearch()
    {
        return $this->safeSearch;
    }

Usage Example

 public function testConstruct()
 {
     $res = ['faceAnnotations' => [['landmarks' => []]], 'landmarkAnnotations' => ['foo' => ['bat' => 'bar']], 'logoAnnotations' => ['foo' => ['bat' => 'bar']], 'labelAnnotations' => ['foo' => ['bat' => 'bar']], 'textAnnotations' => ['foo' => ['bat' => 'bar']], 'safeSearchAnnotation' => ['foo' => ['bat' => 'bar']], 'imagePropertiesAnnotation' => ['foo' => ['bat' => 'bar']], 'error' => ['foo' => ['bat' => 'bar']]];
     $ann = new Annotation($res);
     $this->assertInstanceOf(Face::class, $ann->faces()[0]);
     $this->assertInstanceOf(Entity::class, $ann->landmarks()[0]);
     $this->assertInstanceOf(Entity::class, $ann->logos()[0]);
     $this->assertInstanceOf(Entity::class, $ann->labels()[0]);
     $this->assertInstanceOf(Entity::class, $ann->text()[0]);
     $this->assertInstanceOf(SafeSearch::class, $ann->safeSearch());
     $this->assertInstanceOf(ImageProperties::class, $ann->imageProperties());
     $this->assertEquals($res['error'], $ann->error());
     $this->assertEquals($res, $ann->info());
 }