[ 
https://issues.apache.org/jira/browse/NETBEANS-52?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ádám Turcsán updated NETBEANS-52:
---------------------------------
    Description: 
There's a new PHP7.1 implementation in the nightly builds.
As I was using the new features I recognized that if a used type is used only 
in nullable cases, like below, NetBeans marks it as "Unused Use Statement":
{code:php}
<?php

use \Psr\Log\LoggerInterface as Logger;

class Example {

    /**
     * @var ?Logger
     */
    private $logger;

    public function __construct(?Logger $logger)
    {
        $this->logger = $logger;
    }

    private function getLogger(): ?Logger
    {
        return $this->logger;
    }

}
{code}


  was:
There's a new PHP7.1 implementation in the nightly builds.
As I was using the new features I recognized that if a used type is used only 
in nullable cases, like below, NetBeans marks it as "Unused Use Statement":

use \Psr\Log\LoggerInterface as Logger;

{code:php}
class Example {

    /**
     * @var ?Logger
     */
    private $logger;

    public function __construct(?Logger $logger)
    {
        $this->logger = $logger;
    }

    private function getLogger(): ?Logger
    {
        return $this->logger;
    }

}
{code}



> PHP7.1 Nullable type's use statement unrecognized
> -------------------------------------------------
>
>                 Key: NETBEANS-52
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-52
>             Project: NetBeans
>          Issue Type: Improvement
>          Components: php - Code
>    Affects Versions: 9.0, Next
>         Environment: Ubuntu 16.04.3 - Linux 4.4.0-92-generic
> openjdk version "1.8.0_131"
> OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-2ubuntu1.16.04.3-b11)
> OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)
>            Reporter: Ádám Turcsán
>              Labels: features
>
> There's a new PHP7.1 implementation in the nightly builds.
> As I was using the new features I recognized that if a used type is used only 
> in nullable cases, like below, NetBeans marks it as "Unused Use Statement":
> {code:php}
> <?php
> use \Psr\Log\LoggerInterface as Logger;
> class Example {
>     /**
>      * @var ?Logger
>      */
>     private $logger;
>     public function __construct(?Logger $logger)
>     {
>         $this->logger = $logger;
>     }
>     private function getLogger(): ?Logger
>     {
>         return $this->logger;
>     }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to