private function buildProperty($value, $key): string
    {
        if (collect(['from', 'to'])->contains($key)) {
            $value = $this->implode($value);
        }

        return vsprintf("<apps:property name='%s' value='%s'/>", [
            $key,
            htmlentities($this->implode($value)),
        ]);
    }
private function buildProperty($value, $key): string
    {
        if (collect(['from', 'to'])->contains($key)) {
            $value = $this->implode($value);
        }

        return vsprintf("<apps:property name='%s' value='%s'/>", [
            $key,
            htmlentities($this->implode($value)),
        ]);
    }
private function buildProperty ( $ value , $ key ) : string { if ( collect ( [ 'from' , 'to' ] ) -> contains ( $ key ) ) { $ value = $ this -> implode ( $ value ) ; } return vsprintf ( "<apps:property name='%s' value='%s'/>" , [ $ key , htmlentities ( $ this -> implode ( $ value ) ) , ] ) ; }
Build XML for a property.

@param string $value
@param string $key

@return string
Build XML for a property .