From 7bdc788695bafae2978ced3c4c0c663cb35f2f69 Mon Sep 17 00:00:00 2001 From: Anders Jurisoo Date: Sat, 23 Apr 2022 09:28:40 +0200 Subject: [PATCH] Don't proxy make methods on PHPFile --- src/PHPFile.php | 13 ++++--------- src/Traits/HasSyntacticSweeteners.php | 5 ----- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/PHPFile.php b/src/PHPFile.php index dd5efb6..9a99577 100644 --- a/src/PHPFile.php +++ b/src/PHPFile.php @@ -35,6 +35,8 @@ class PHPFile protected string $fileQueryBuilder = Endpoints\PHP\PHPFileQueryBuilder::class; + protected string $maker = Endpoints\PHP\Make::class; + public string $astQueryBuilder = ASTQueryBuilder::class; protected $ast; @@ -80,17 +82,10 @@ public function getReflection() $handler = new ReflectionProxy($this); return $handler->getReflection(); } - - public function file(string $name = 'dummy.php') - { - $handler = new Make($this); - return $handler->file($name); - } - public function class($name = \App\Dummy::class) + public function make() { - $handler = new Make($this); - return $handler->class($name); + return new $this->maker($this); } public function __construct( diff --git a/src/Traits/HasSyntacticSweeteners.php b/src/Traits/HasSyntacticSweeteners.php index cedb115..262c568 100644 --- a/src/Traits/HasSyntacticSweeteners.php +++ b/src/Traits/HasSyntacticSweeteners.php @@ -39,11 +39,6 @@ public function it() return $this; } - public function make() - { - return $this; - } - public function please() { return $this;