Example #1
0
 protected function applyMixin($text)
 {
     return preg_replace_callback('/\\$([\\w\\-]+)(?::\\s*(.*?);)?/m', function ($m) {
         $name = $m[1];
         $value = $m[2] ?? null;
         if (isset($this->mixin[$name])) {
             return $this->mixin[$name];
         }
         return Mixin::call($name, $value);
     }, $text);
 }