private function countStackMessages(Stack $stack)
    {
        return 1 + array_sum(array_map(function (Stack $child) {
            return $this->countStackMessages($child);
        }, $this->getChildrenStacks($stack)));
    }
private function countStackMessages(Stack $stack)
    {
        return 1 + array_sum(array_map(function (Stack $child) {
            return $this->countStackMessages($child);
        }, $this->getChildrenStacks($stack)));
    }
private function countStackMessages ( Stack $ stack ) { return 1 + array_sum ( array_map ( function ( Stack $ child ) { return $ this -> countStackMessages ( $ child ) ; } , $ this -> getChildrenStacks ( $ stack ) ) ) ; }
Recursively count message in stack.

@param Stack $stack

@return int
Recursively count message in stack .