public function getAll($scope = null)
    {
        // Build the list of all available zones.
        if (empty($this->zoneIndex)) {
            if ($handle = opendir($this->definitionPath)) {
                while (false !== ($entry = readdir($handle))) {
                    if (substr($entry, 0, 1) != '.') {
                        $id = strtok($entry, '.');
                        $this->zoneIndex[] = $id;
                    }
                }
                closedir($handle);
            }
        }

        // Load each zone, filter by scope if needed.
        $zones = [];
        foreach ($this->zoneIndex as $id) {
            $zone = $this->get($id);
            if (is_null($scope) || ($zone->getScope() == $scope)) {
                $zones[$id] = $this->get($id);
            }
        }

        return $zones;
    }
public function getAll($scope = null)
    {
        // Build the list of all available zones.
        if (empty($this->zoneIndex)) {
            if ($handle = opendir($this->definitionPath)) {
                while (false !== ($entry = readdir($handle))) {
                    if (substr($entry, 0, 1) != '.') {
                        $id = strtok($entry, '.');
                        $this->zoneIndex[] = $id;
                    }
                }
                closedir($handle);
            }
        }

        // Load each zone, filter by scope if needed.
        $zones = [];
        foreach ($this->zoneIndex as $id) {
            $zone = $this->get($id);
            if (is_null($scope) || ($zone->getScope() == $scope)) {
                $zones[$id] = $this->get($id);
            }
        }

        return $zones;
    }
{@inheritdoc}