Skip to content

[WR] Could not resolve ExpressionStatement #96

@dantleech

Description

@dantleech
[2017-08-05T09:23:47.519573+02:00] phpactor.WARNING: Did not know how to resolve node of type "Microsoft\PhpParser\Node\Statement\ExpressionStatement" with text "$locator = $this->serviceLocator;" [] []
<?php

namespace Phpactor\WorseReflection\Reflection;

use Phpactor\WorseReflection\Reflector;
use Microsoft\PhpParser\Node\ClassConstDeclaration;
use Microsoft\PhpParser\Node\ConstElement;
use Microsoft\PhpParser\Node;
use Phpactor\WorseReflection\Type;
use Phpactor\WorseReflection\ServiceLocator;

final class ReflectionConstant extends AbstractReflectedNode
{
    /**
     * @var ServiceLocator
     */
    private $serviceLocator;

    /**
     * @var ConstElement
     */
    private $node;

    public function __construct(
        ServiceLocator $serviceLocator,
        ConstElement $node
    )
    {
        $this->serviceLocator = $serviceLocator;
        $this->node = $node;
    }

    public function name()
    {
        return $this->node->getName();
    }

    public function type(): Type
    {
        $locator = $this->serviceLocator;
        return Type::unknown();
    }

    protected function node(): Node
    {
        return $this->node;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions