Skip to content

Extract property hook bodies properly - #172

Merged
dg merged 2 commits into
nette:masterfrom
xHeaven:patch-1
Feb 17, 2025
Merged

Extract property hook bodies properly#172
dg merged 2 commits into
nette:masterfrom
xHeaven:patch-1

Conversation

@xHeaven

@xHeaven xHeaven commented Jan 23, 2025

Copy link
Copy Markdown
Contributor

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

xHeaven commented Feb 8, 2025

Copy link
Copy Markdown
Contributor Author

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

@dg

dg commented Feb 17, 2025

Copy link
Copy Markdown
Member

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

brendt commented Feb 26, 2025

Copy link
Copy Markdown

@dg do you have plans on tagging this?

@xHeaven

xHeaven commented Mar 28, 2025

Copy link
Copy Markdown
Contributor Author

@dg do we have any update on tagging this?

@dg

dg commented Mar 31, 2025

Copy link
Copy Markdown
Member

I have just tagged a new version

@xHeaven

xHeaven commented Mar 31, 2025

Copy link
Copy Markdown
Contributor Author

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