ST3 - Generation of code failing

Issue #1 resolved
Iván N Paz
created an issue

Based on the starting code:

<?php
@class User
@property -t string -get -set name
@property -t DateTime -get -set birthday
@endClass

The resulting generated code is:

<?php


/**
 * User
 */

class User {

    /**
     * name
     * @var string
     */

    protected $name;

    /**
     * setName
     * @param $value
     * @return void
     */

    public function setName($value) {

        $this->name = $value;

    }

    /**
     * getName
     * @return string
     */


    /**
     * birthday
     * @var DateTime
     */

    protected $birthday;

    /**
     * setBirthday
     * @param DateTime $value
     * @return void
     */

    public function setBirthday(DateTime $value) {

        $this->birthday = $value;

    }

    /**
     * getBirthday
     * @return DateTime
     */

    public
} getBirthday() {

        return $this->birthday;

    }eturn $this->name;

    }
@property -t DateTime -get -set birthday
@endClass

Comments (6)

  1. B T repo owner

    I copied and pasted the starting code and was not able to replicate the issue on windows or mac. Are you still having an issue?

    Also, check sublimes console. Make sure PhpCodeGen's debugMode is turned on and see if you get any errors. If there is an issue parsing a command string, it will display that in the console.

  2. Iván N Paz reporter

    Hello again,

    Found the offending issue... It happens that if the translate_tabs_to_spaces setting is set to true you will get the scrambled output I posted on the issue report.

    If it helps the extra info, I'm on Linux Mint 15, using Cinnamon and SublimeText3. Tried again with a clean install, and this single setting is the one that breaks the generation.

  3. Log in to comment