Skip to content

Commit 1d6c147

Browse files
Merge pull request #2 from ryangjchandler/rewrite
2 parents b6645fa + 752fd1c commit 1d6c147

File tree

168 files changed

+7671
-234623
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+7671
-234623
lines changed

.editorconfig

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@ root = true
33
[*]
44
charset = utf-8
55
end_of_line = lf
6-
insert_final_newline = true
7-
indent_style = space
86
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
99
trim_trailing_whitespace = true
1010

1111
[*.md]
1212
trim_trailing_whitespace = false
1313

1414
[*.{yml,yaml}]
1515
indent_size = 2
16+
17+
[docker-compose.yml]
18+
indent_size = 4

.env.example

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,19 @@ APP_DEBUG=true
55
APP_URL=http://localhost
66

77
LOG_CHANNEL=stack
8+
LOG_DEPRECATIONS_CHANNEL=null
89
LOG_LEVEL=debug
910

1011
DB_CONNECTION=mysql
1112
DB_HOST=127.0.0.1
1213
DB_PORT=3306
13-
DB_DATABASE=ast_explorer
14+
DB_DATABASE=laravel
1415
DB_USERNAME=root
1516
DB_PASSWORD=
1617

1718
BROADCAST_DRIVER=log
1819
CACHE_DRIVER=file
20+
FILESYSTEM_DISK=local
1921
QUEUE_CONNECTION=sync
2022
SESSION_DRIVER=file
2123
SESSION_LIFETIME=120
@@ -27,23 +29,31 @@ REDIS_PASSWORD=null
2729
REDIS_PORT=6379
2830

2931
MAIL_MAILER=smtp
30-
MAIL_HOST=mailhog
32+
MAIL_HOST=mailpit
3133
MAIL_PORT=1025
3234
MAIL_USERNAME=null
3335
MAIL_PASSWORD=null
3436
MAIL_ENCRYPTION=null
35-
MAIL_FROM_ADDRESS=null
37+
MAIL_FROM_ADDRESS="hello@example.com"
3638
MAIL_FROM_NAME="${APP_NAME}"
3739

3840
AWS_ACCESS_KEY_ID=
3941
AWS_SECRET_ACCESS_KEY=
4042
AWS_DEFAULT_REGION=us-east-1
4143
AWS_BUCKET=
44+
AWS_USE_PATH_STYLE_ENDPOINT=false
4245

4346
PUSHER_APP_ID=
4447
PUSHER_APP_KEY=
4548
PUSHER_APP_SECRET=
49+
PUSHER_HOST=
50+
PUSHER_PORT=443
51+
PUSHER_SCHEME=https
4652
PUSHER_APP_CLUSTER=mt1
4753

48-
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
49-
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
54+
VITE_APP_NAME="${APP_NAME}"
55+
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
56+
VITE_PUSHER_HOST="${PUSHER_HOST}"
57+
VITE_PUSHER_PORT="${PUSHER_PORT}"
58+
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
59+
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

.gitattributes

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
* text=auto
2-
*.css linguist-vendored
3-
*.scss linguist-vendored
4-
*.js linguist-vendored
1+
* text=auto eol=lf
2+
3+
*.blade.php diff=html
4+
*.css diff=css
5+
*.html diff=html
6+
*.md diff=markdown
7+
*.php diff=php
8+
9+
/.github export-ignore
510
CHANGELOG.md export-ignore
11+
.styleci.yml export-ignore

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1+
/.phpunit.cache
12
/node_modules
23
/public/hot
34
/public/storage
45
/storage/*.key
56
/vendor
67
.env
78
.env.backup
9+
.env.production
810
.phpunit.result.cache
9-
docker-compose.override.yml
1011
Homestead.json
1112
Homestead.yaml
13+
auth.json
1214
npm-debug.log
1315
yarn-error.log
16+
/.fleet
17+
/.idea
18+
/.vscode

.styleci.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

LICENSE.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 56 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,66 @@
1-
# [phpast.com](https://phpast.com)
1+
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>
22

3-
A web tool to explore the ASTs generated by PHP-Parser.
3+
<p align="center">
4+
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
5+
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
6+
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
7+
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
8+
</p>
49

5-
## About
10+
## About Laravel
611

7-
This web tool provides a GUI for exploring the AST of your PHP code. You can enter any valid PHP code into the editor and click 'Generate'. This will produce an AST that can be explored as JSON.
12+
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
813

9-
![image](https://user-images.githubusercontent.com/41837763/119830652-67573c00-bef4-11eb-9a50-632756e51206.png)
14+
- [Simple, fast routing engine](https://laravel.com/docs/routing).
15+
- [Powerful dependency injection container](https://laravel.com/docs/container).
16+
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
17+
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
18+
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
19+
- [Robust background job processing](https://laravel.com/docs/queues).
20+
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
21+
22+
Laravel is accessible, powerful, and provides tools required for large, robust applications.
23+
24+
## Learning Laravel
25+
26+
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
27+
28+
You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.
29+
30+
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 2000 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
31+
32+
## Laravel Sponsors
33+
34+
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com).
35+
36+
### Premium Partners
37+
38+
- **[Vehikl](https://vehikl.com/)**
39+
- **[Tighten Co.](https://tighten.co)**
40+
- **[WebReinvent](https://webreinvent.com/)**
41+
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
42+
- **[64 Robots](https://64robots.com)**
43+
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
44+
- **[Cyber-Duck](https://cyber-duck.co.uk)**
45+
- **[DevSquad](https://devsquad.com/hire-laravel-developers)**
46+
- **[Jump24](https://jump24.co.uk)**
47+
- **[Redberry](https://redberry.international/laravel/)**
48+
- **[Active Logic](https://activelogic.com)**
49+
- **[byte5](https://byte5.de)**
50+
- **[OP.GG](https://op.gg)**
1051

1152
## Contributing
1253

13-
All contributions are welcome. Please fork this repository, make your changes in a separate branch (from `main`) and open a pull request.
54+
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
55+
56+
## Code of Conduct
57+
58+
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
59+
60+
## Security Vulnerabilities
61+
62+
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
1463

1564
## License
1665

17-
This repository is available under the MIT license. For more information, please visit [LICENSE](LICENSE.md).
66+
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

app/Console/Kernel.php

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,18 @@
77

88
class Kernel extends ConsoleKernel
99
{
10-
/**
11-
* The Artisan commands provided by your application.
12-
*
13-
* @var array
14-
*/
15-
protected $commands = [
16-
//
17-
];
18-
1910
/**
2011
* Define the application's command schedule.
21-
*
22-
* @param \Illuminate\Console\Scheduling\Schedule $schedule
23-
* @return void
2412
*/
25-
protected function schedule(Schedule $schedule)
13+
protected function schedule(Schedule $schedule): void
2614
{
2715
// $schedule->command('inspire')->hourly();
2816
}
2917

3018
/**
3119
* Register the commands for the application.
32-
*
33-
* @return void
3420
*/
35-
protected function commands()
21+
protected function commands(): void
3622
{
3723
$this->load(__DIR__.'/Commands');
3824

app/Exceptions/Handler.php

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,9 @@
88
class Handler extends ExceptionHandler
99
{
1010
/**
11-
* A list of the exception types that are not reported.
11+
* The list of the inputs that are never flashed to the session on validation exceptions.
1212
*
13-
* @var array
14-
*/
15-
protected $dontReport = [
16-
//
17-
];
18-
19-
/**
20-
* A list of the inputs that are never flashed for validation exceptions.
21-
*
22-
* @var array
13+
* @var array<int, string>
2314
*/
2415
protected $dontFlash = [
2516
'current_password',
@@ -29,10 +20,8 @@ class Handler extends ExceptionHandler
2920

3021
/**
3122
* Register the exception handling callbacks for the application.
32-
*
33-
* @return void
3423
*/
35-
public function register()
24+
public function register(): void
3625
{
3726
$this->reportable(function (Throwable $e) {
3827
//
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Api;
4+
5+
use Illuminate\Http\Request;
6+
use PhpParser\Error;
7+
use PhpParser\ParserFactory;
8+
9+
class GenerateController
10+
{
11+
public function __invoke(Request $request)
12+
{
13+
$code = $request->input('code');
14+
$parser = (new ParserFactory)->create(ParserFactory::ONLY_PHP7);
15+
16+
try {
17+
return response()->json([
18+
'ast' => $parser->parse($code),
19+
]);
20+
} catch (Error $e) {
21+
return response()->json([
22+
'ast' => [],
23+
'error' => $e->getMessage(),
24+
]);
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)