<?php

class Button
{
   public $data = []; //public только для теста

   public function build($method)
   {
       if(is_callable($method)) {
           $method($this); // Передаем в колбэк $this (object Button)
       }

       if(is_array($method)) {
            $this->data['buttons'] = $method;
        }
   }

    public function addButton(array $button = [])
    {
        $this->data['buttons'] = $button;

        return $this;
    }
}

$button = new Button;

$button->build(function ($button) {
    /** @var Button $button */
    $button->addButton(['a' => 'b']);
});

print_r($button->data['buttons']);
