pug-php/js-phpize

View on GitHub
src/JsPhpize/Nodes/HooksArray.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
<?php

namespace JsPhpize\Nodes;

class HooksArray extends ArrayBase
{
    public function addItem(Value $value)
    {
        if (!empty($value)) {
            $this->data[] = $value;
        }
    }

    public function getReadVariables()
    {
        $variables = [];
        foreach ($this->data as $value) {
            $variables = array_merge($variables, $value->getReadVariables());
        }

        return $variables;
    }
}