Skip to content

Polyfilled interface not aliased #965

@theofidry

Description

@theofidry

Bug report

Question Answer
PHP-Scoper version x.y.z <!-- (php-scoper.phar -V or `composer show
PHP version x.y.z
Platform with version e.g. Ubuntu/Windows/MacOS
Github Repo -

This is the scoped code from symfony/polyfill-php80:

<?php

namespace _PHPStan_64f6b4b37;

if (\PHP_VERSION_ID < 80000) {
    interface Stringable
    {
        /**
         * @return string
         */
        public function __toString();
    }
}

We do have the following statement in the autoloader:

humbug_phpscoper_expose_class('Stringable', '_PHPStan_64f6b4b37\Stringable');

But since there is no class_alias() statement it does nothing.

The same problem will happen with:

<?php

namespace _PHPStan_64f6b4b37;

if (\PHP_VERSION_ID < 80000) {
    class ValueError extends \Error
    {
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions