[Implemented] Support for PHP7 return types

+1 vote
asked Apr 29, 2016 in Solved by cvuorinen (320 points)
recategorized Jul 4, 2016 by ludek.vodicka

Hi,

Currently when I have a PHP class that uses PHP 7 return types, when I export from Skipper it messes up my class and adds extra curly braces. Here is a small sample:

Before:

/**
 * @ORM\Entity
 * @ORM\Table(name="my_entity")
 */
class MyEntity
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     *
     * @var int
     */
    private $id;

    /**
     * @ORM\Column(type="string", nullable=false)
     *
     * @var string
     */
    private $description;

    public function __construct(string $description)
    {
        $this->description = $description;
    }

    public function getId(): int
    {
        return $this->id;
    }

    public function getDescription(): string
    {
        return $this->description;
    }
}

After export from Skipper:

/**
 * @ORM\Entity
 * @ORM\Table(name="my_entity")
 */
class MyEntity
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     *
     * @var int
     */
    private $id;

    /**
     * @ORM\Column(type="string", nullable=false)
     *
     * @var string
     */
    private $description;

    public function __construct(string $description)
    {
        $this->description = $description;
    }

    public function getId(){: int
    {
        return $this->id;
    }

    public function getDescription(): string
    {
        return $this->description;
    }
}}

So as you can see it adds an extra { before the first return type and an extra } at the end.

1 Answer

0 votes
answered Jun 1, 2016 by ludek.vodicka Skipper developer (140,450 points)
selected Jun 2, 2016 by cvuorinen
 
Best answer

This feature is implemented in latest beta 3.2.7.1319 available from our support site:
http://support.skipper18.com/402/downloads-skipper-beta

...