[
https://issues.apache.org/jira/browse/NETBEANS-5370?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Czukowski updated NETBEANS-5370:
--------------------------------
Description:
Please see the example code below. Create a new PHP file in NetBeans and paste
the code into it. At each class declaration for {{Class1}}, {{Class2}} and
{{Class3}}, click the 💡 Hint icon and select _Implement All Abstract Methods_.
The issue will become apparent. If PHPDocs has return type specified as eg.
{{return string[]}}, the generated code will be broken.
{code:php}
<?php declare(strict_types = 1);
namespace Cz\Test\GenerateMethod;
class Class1 extends Base1
{
}
abstract class Base1
{
abstract public function getSingleItem(): string;
}
class Class2 extends Base2
{
}
abstract class Base2
{
/**
* @return string[]
*/
abstract public function getItemsList(): array;
}
class Class3 extends Base3
{
}
abstract class Base3
{
abstract public function getSingleItem(): string;
/**
* @return string[]
*/
abstract public function getItemsList(): array;
}
{code}
was:
Please see the example code below. Create a new PHP file in NetBeans and paste
the code into it. At each class declaration for {{Class1}}, {{Class2}} and
{{Class3}}, click the 💡 Hint icon and select _Implement All Abstract Methods_.
The issue will become apparent. If PHPDocs has return type specified as eg.
{{return string[]}}, the generated code will be broken.
{code:php}
<?php declare(strict_types = 1);
namespace Cz\Test\GenerateMethod;
class Class1 extends Base1
{
}
abstract class Base1
{
abstract public function getSingleItem(): string;
/**
* @return string[]
*/
abstract public function getItemsList(): array;
}
class Class2 extends Base2
{
}
abstract class Base2
{
/**
* @return string[]
*/
abstract public function getItemsList(): array;
}
class Class3 extends Base3
{
}
abstract class Base3
{
abstract public function getSingleItem(): string;
/**
* @return string[]
*/
abstract public function getItemsList(): array;
}
{code}
> Generate abstract method with array return type in PHPDocs
> ----------------------------------------------------------
>
> Key: NETBEANS-5370
> URL: https://issues.apache.org/jira/browse/NETBEANS-5370
> Project: NetBeans
> Issue Type: Bug
> Components: php - Editor
> Affects Versions: 12.3
> Reporter: Czukowski
> Priority: Minor
>
> Please see the example code below. Create a new PHP file in NetBeans and
> paste the code into it. At each class declaration for {{Class1}}, {{Class2}}
> and {{Class3}}, click the 💡 Hint icon and select _Implement All Abstract
> Methods_. The issue will become apparent. If PHPDocs has return type
> specified as eg. {{return string[]}}, the generated code will be broken.
> {code:php}
> <?php declare(strict_types = 1);
> namespace Cz\Test\GenerateMethod;
> class Class1 extends Base1
> {
> }
> abstract class Base1
> {
> abstract public function getSingleItem(): string;
> }
> class Class2 extends Base2
> {
> }
> abstract class Base2
> {
> /**
> * @return string[]
> */
> abstract public function getItemsList(): array;
> }
> class Class3 extends Base3
> {
> }
> abstract class Base3
> {
> abstract public function getSingleItem(): string;
> /**
> * @return string[]
> */
> abstract public function getItemsList(): array;
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists