Skip to content

Releases: ajthinking/archetype

Support php-parser 5

11 May 08:10
d2c5cd0
Compare
Choose a tag to compare
  • Add support for php-parser 5, Drops support for php parser 4.

Thanks to @jasonvarga

Preliminary support for trait usage in a class

24 Aug 05:54
cfee026
Compare
Choose a tag to compare

Allow passing a closure to insertStmt

25 May 07:36
62abebd
Compare
Choose a tag to compare

This feature provides a BuilderFactory instance when passing a closure to insertStmt.

PHPFile::make()->class(\App\Dummy::class)
  ->astQuery()
  ->class()
  ->insertStmt(function(BuilderFactory $builder) {
	  return $builder->property('someProperty')->getNode();
  })
  ->commit()
  ->end()
  ->preview();

Fix insertStmt bug

25 May 07:21
4d84592
Compare
Choose a tag to compare

When astQuery()->insertStmt(.....) had no matches to operate on, it added the node to the end of the file. This was fixed by adding a guard clause.

Refactoring and bug fixes

21 May 15:44
Compare
Choose a tag to compare
  • Improve pretty printing when creating new classes
  • Adds missing types
  • Remove unused dev dependency
  • new ASTQueryBuilder withEach method
  • No more magic for phpparser classmap, use explicit methods instead
  • Fix an issue where weak comparison caused flakiness

Refactoring

06 May 19:17
b0c014b
Compare
Choose a tag to compare
  • Use dependency injection for maker
  • Fix most phpstan level 0 errors

Dynamic Makers

04 May 06:03
a014014
Compare
Choose a tag to compare

Makers

PHPFile::make() now return a Maker instance. Makers allows creating files from a template, for instance:

PHPFile::make()->file('scripts.php')
PHPFile::make()->class(\App\Car::class)

We can implement a custom maker and attaching it to the property "maker" on the File instance.

Internal changes

File methods no longer rely on obscure __call magic, instead minimal stubs are implemented to explicitly forward calls to the corresponding endpoint class.

Bugfix - Str::macro

09 Mar 15:12
9ffd7c1
Compare
Choose a tag to compare

Avoid Str macros which may cause segmentation fault in statamic/cms

Laravel 9 support

05 Mar 16:02
6bc48f3
Compare
Choose a tag to compare
Merge pull request #60 from ajthinking/laravel-9-support

Allow laravel 9

v1.0.1

11 Jan 20:19
bc4924c
Compare
Choose a tag to compare

Fixes bug when creating classes.

Now we can create classes like so:

namespace App;

PHPFile::make()->class(Models\Car::class);
PHPFile::make()->class(\App\Models\Car::class);
PHPFile::make()->class('App\Models\Car');
PHPFile::make()->class('\App\Models\Car');
PHPFile::make()->class('app/Models/Car.php');

all of these will write two app/Models/Car.php.