Override `getOwnScopes()` in ShareableTrait

For $this's own scopes, looking for any parent class or interface in
all the available scopes.

{@inheritDoc}
433281
protected function getOwnScopes()/*# : array */
    {
        // result
        $result = [];

        // all types avaible
        $allTypes = $this->getAllTypes(static::getScopes());

        // loop thru own scopes
        foreach ($this->scopes as $scope) {
            $result[$scope] = true;
            $this->matchParentType($scope, $allTypes, $result);
        }

        // alway add global scope
        $result[''] = true;

        return array_keys($result);
    }
1261302
public function popScope()
    {
        $upIndex = $this->getUpIndex();

        if ($upIndex !== null) {
            $itemStack = $this->getItemStack();
            $this->overlay = $itemStack[$this->getUpIndex()][SSViewer_Scope::ITEM_OVERLAY];
        }

        return parent::popScope();
    }
203552
public function &getScope($scope)
    {
        if ($scope == Smarty::SCOPE_PARENT && !empty($this->parent)) {
            return $this->parent->tpl_vars;
        } elseif ($scope == Smarty::SCOPE_ROOT && !empty($this->parent)) {
            $ptr = $this->parent;
            while (!empty($ptr->parent)) {
                $ptr = $ptr->parent;
            }

            return $ptr->tpl_vars;
        } elseif ($scope == Smarty::SCOPE_GLOBAL) {
            return Smarty::$global_tpl_vars;
        }
        $null = null;

        return $null;
    }
250813
def _get_scope_with_mangled(self, name):
        """"""
        scope = self
        while True:
            parent = scope.get_enclosing_scope()
            if parent is None:
                return

            if name in parent.rev_mangled:
                return parent

            scope = parent
1050719
private function applyScopes($parent, $method = 'set')
	{
		// Inherit scopes from parent
		foreach ($this->scopes as $scope)
		{
			$this->$method($scope, $parent->$scope);
		}

		return $this;
	}
423322
public function scope($scope)
    {
        $beforeMethod = 'before'.ucfirst($scope);
        $afterMethod  = 'after'.ucfirst($scope);
        if ( method_exists($this, $beforeMethod) )
        {
            call_user_func([$this,$beforeMethod]);
        }
        $this->rules = $this->resolveScope($scope);
        $this->attributes = $this->resolveAttributes($scope);
        $this->messages = $this->resolveMessages($scope);


        if ( method_exists($this, $afterMethod) )
        {
            call_user_func([$this,$afterMethod]);
        }

        return $this;
    }
113724
public function withLocalScope()
    {
        if ($this->isClosed()) {
            throw new \RuntimeException("The stream is closed");
        }
        
        if (!$this->isGlobal()) {
            return $this;
        }
        
        $stream = clone $this;
        
        fwrite($stream->handle, (string)$this);
        
        return $stream;
    }
741257
public static function getAllScopes()
    {
        return array(
            self::SCOPE_MANAGE_ACCOUNTS,
            self::SCOPE_MANAGE_SUBSCRIPTIONS,
            self::SCOPE_COLLECT_PAYMENTS,
            self::SCOPE_PREAPPROVE_PAYMENTS,
            self::SCOPE_VIEW_USER,
            self::SCOPE_SEND_MONEY
        );
    }
639122
public function getScopes()
    {
        $scopes = array();
        $repositories = $this->getEntityRepositories($this->_scope_identifier);

        foreach ($repositories as $repository) {
            $scopes[] = array('repository' => $repository,'type' => $this->_scope_type);
        }

        return $scopes;
    }
574323
public function set($scopes)
    {
        $this->scopes = func_get_args();

        if (is_array($scopes)) {
            $this->scopes[] = $scopes;
        }

        return $this->getDisplay();
    }
567534
public static function scope(ScopeContract $scope = null)
    {
        if (! is_null($scope)) {
            return static::$scope = $scope;
        }

        if (is_null(static::$scope)) {
            static::$scope = new Scope;
        }

        return static::$scope;
    }
863923
function () {
      let scope = context.getScope();
      while (scope) {
        const node = scope.block && scope.block.parent && scope.block.parent.parent;
        if (node && utils.isES5Component(node)) {
          return node;
        }
        scope = scope.upper;
      }
      return null;
    }
319586
public function scope($scope)
	{
		$scope = (new Scope())->scope($scope);

		$this->scopes[] = $scope;
		return $scope;
	}
373377
public function getScopeVariables($includeBoundObject = true)
    {
        $vars = $this->context->getAll();

        if (!$includeBoundObject) {
            unset($vars['this']);
        }

        return $vars;
    }
115268
def get_scope_path(cls, scope_separator="::"):
        
        if cls.get_parent_scope() is None:
            return ""
        elif isinstance(cls.get_parent_scope(), comp.Root):
            return ""
        else:
            parent_path = cls.get_parent_scope().get_scope_path(scope_separator)
            if parent_path:
                return(
                    parent_path
                    + scope_separator
                    + cls.get_parent_scope().type_name
                )
            else:
                return cls.get_parent_scope().type_name
897947
public function getCurrentScope()
    {
        $key = request(Scope::QUERY_NAME);

        return $this->scopes->first(function ($scope) use ($key) {
            return $scope->key == $key;
        });
    }
48851
public function getScope($scope)
    {
        if (!isset($this->allScopes[$scope])) {
            throw new ApplicationException('No definition for scope ' . $scope);
        }

        return $this->allScopes[$scope];
    }