Skip to content

Regression implementing contract with nullable type #875

Closed

Description

@dantleech

Given:

interface IndexQuery
{
    public function implementing(FullyQualifiedName $name): References;

    public function class(FullyQualifiedName $name): ?ClassRecord;
}

we get

<?php

namespace Phpactor\ProjectQuery\Adapter\Dbal;

use ?Phpactor\ProjectQuery\Model\Record\ClassRecord;
use Phpactor\Name\FullyQualifiedName;
use Phpactor\ProjectQuery\Model\IndexQuery;
use Phpactor\ProjectQuery\Model\References;

class DbalIndexQuery implements IndexQuery
{
    public function implementing(FullyQualifiedName $name): References
    {
    }
    public function class(FullyQualifiedName $name): ClassRecord
    {
    }
}

Note the use statement has a ? (when the ClassRecord of class should have the nullable type.

@elythyr I guess this is rather to do with the code-builder library than the WorseReflection change and might be fixed with the forthcoming Nullable types PR there.

Activity

  1. dantleech commented on Jan 19, 2020

    @dantleech
    CollaboratorAuthor

    Fixed in #876

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions