Skip to content

Conversation

@xHeaven
Copy link
Contributor

@xHeaven xHeaven commented Jan 23, 2025

This PR aims to fix this issue: tempestphp/tempest-framework#866

Reproduction:

$printer = new Printer();
$from = ClassType::from(Foo::class, withBodies: true);
$fromCode = ClassType::fromCode(file_get_contents(__DIR__ . '/Foo.php'));
echo $printer->printClass($from) . PHP_EOL;
echo $printer->printClass($fromCode);

// Foo.php
class Foo
{
    public $bar {
        get => 'test string';
    }
}

Output before:

class Foo
{
	public $bar {
		get {
		}
	}
}

class Foo
{
	public $bar {
		get => 'test string';
	}
}

Output after:

class Foo
{
	public $bar {
		get => 'test string';
	}
}

class Foo
{
	public $bar {
		get => 'test string';
	}
}

@xHeaven
Copy link
Contributor Author

xHeaven commented Feb 8, 2025

Hey @dg, can you take a look at this, please? Thanks!

@dg
Copy link
Member

dg commented Feb 17, 2025

Thanks!

@dg dg merged commit fff50de into nette:master Feb 17, 2025
@xHeaven xHeaven deleted the patch-1 branch February 22, 2025 13:00
@brendt
Copy link

brendt commented Feb 26, 2025

@dg do you have plans on tagging this?

@xHeaven
Copy link
Contributor Author

xHeaven commented Mar 28, 2025

@dg do we have any update on tagging this?

@dg
Copy link
Member

dg commented Mar 31, 2025

I have just tagged a new version

@xHeaven
Copy link
Contributor Author

xHeaven commented Mar 31, 2025

I have just tagged a new version

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants