lib/Elastica/QueryBuilder/DSL/Aggregation.php
public function bucket_script(string $name, array $bucketsPath = null, string $script = null): BucketScript
    {
        return new BucketScript($name, $bucketsPath, $script);
    }
public function bucket_script(string $name, array $bucketsPath = null, string $script = null): BucketScript
    {
        return new BucketScript($name, $bucketsPath, $script);
    }
public function bucket_script ( string $ name , array $ bucketsPath = null , string $ script = null ) : BucketScript { return new BucketScript ( $ name , $ bucketsPath , $ script ) ; }
bucket script aggregation.

@see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-bucket-script-aggregation.html

@param string      $name
@param array|null  $bucketsPath
@param string|null $script

@return BucketScript
bucket script aggregation .