Skip to content

::namespace #178

@thekid

Description

@thekid

How about using ::namespace for namespace resolution just like ::class?

Example:

<?php namespace de\thekid\dialog;

// Currently, using the dotted syntax
$api= new RestApi(new ResourcesIn('de.thekid.dialog.api'));

// The PHP way
$api= new RestApi(new ResourcesIn(__NAMESPACE__.'\\api'));

// Suggestion
$api= new RestApi(new ResourcesIn(api::namespace));

This would simply be emitted as ::class, which already does everything we want; however, using api::class in this place doesn't convey the intent correctly!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions