Skip to content

Commit

Permalink
Update configuration files
Browse files Browse the repository at this point in the history
  • Loading branch information
guanguans committed Oct 28, 2022
1 parent bf0a021 commit 145fb32
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 17 deletions.
9 changes: 4 additions & 5 deletions README-zh_CN.md
@@ -1,17 +1,18 @@
# laravel-code-runner

![](docs/usage.png)

[ENGLISH](README.md) | [简体中文](README-zh_CN.md)

> Run the code in the browser. - 在浏览器中运行代码
> Run the PHP code in the browser. - 在浏览器中运行 PHP 代码
[![tests](https://github.com/guanguans/laravel-code-runner/workflows/tests/badge.svg)](https://github.com/guanguans/laravel-code-runner/actions)
[![check & fix styling](https://github.com/guanguans/laravel-code-runner/actions/workflows/php-cs-fixer.yml/badge.svg)](https://github.com/guanguans/laravel-code-runner/actions)
[![codecov](https://codecov.io/gh/guanguans/laravel-code-runner/branch/main/graph/badge.svg?token=URGFAWS6S4)](https://codecov.io/gh/guanguans/laravel-code-runner)
[![Latest Stable Version](https://poser.pugx.org/guanguans/laravel-code-runner/v)](//packagist.org/packages/guanguans/laravel-code-runner)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/guanguans/laravel-code-runner)
[![Total Downloads](https://poser.pugx.org/guanguans/laravel-code-runner/downloads)](//packagist.org/packages/guanguans/laravel-code-runner)
[![License](https://poser.pugx.org/guanguans/laravel-code-runner/license)](//packagist.org/packages/guanguans/laravel-code-runner)
![GitHub repo size](https://img.shields.io/github/repo-size/guanguans/laravel-code-runner)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/guanguans/laravel-code-runner)

## 环境要求

Expand Down Expand Up @@ -44,8 +45,6 @@ $ php artisan vendor:publish --provider="Guanguans\LaravelCodeRunner\WebTinkerSe

访问 `/code-runner` 查看页面。

![](docs/usage.png)

### Authorization

如果您想在另一个环境中运行它(我们不建议这样做),您必须执行两个步骤。
Expand Down
9 changes: 4 additions & 5 deletions README.md
@@ -1,17 +1,18 @@
# laravel-code-runner

![](docs/usage.png)

[ENGLISH](README.md) | [简体中文](README-zh_CN.md)

> Run the code in the browser. - 在浏览器中运行代码
> Run the PHP code in the browser. - 在浏览器中运行 PHP 代码
[![tests](https://github.com/guanguans/laravel-code-runner/workflows/tests/badge.svg)](https://github.com/guanguans/laravel-code-runner/actions)
[![check & fix styling](https://github.com/guanguans/laravel-code-runner/actions/workflows/php-cs-fixer.yml/badge.svg)](https://github.com/guanguans/laravel-code-runner/actions)
[![codecov](https://codecov.io/gh/guanguans/laravel-code-runner/branch/main/graph/badge.svg?token=URGFAWS6S4)](https://codecov.io/gh/guanguans/laravel-code-runner)
[![Latest Stable Version](https://poser.pugx.org/guanguans/laravel-code-runner/v)](//packagist.org/packages/guanguans/laravel-code-runner)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/guanguans/laravel-code-runner)
[![Total Downloads](https://poser.pugx.org/guanguans/laravel-code-runner/downloads)](//packagist.org/packages/guanguans/laravel-code-runner)
[![License](https://poser.pugx.org/guanguans/laravel-code-runner/license)](//packagist.org/packages/guanguans/laravel-code-runner)
![GitHub repo size](https://img.shields.io/github/repo-size/guanguans/laravel-code-runner)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/guanguans/laravel-code-runner)

## Requirement

Expand Down Expand Up @@ -40,8 +41,6 @@ $ php artisan vendor:publish --provider="Guanguans\LaravelCodeRunner\WebTinkerSe

## Usage

![](docs/usage.png)

By default this package will only run in a local environment.

Visit `/code-runner` in your app to view page.
Expand Down
11 changes: 8 additions & 3 deletions composer.json
@@ -1,6 +1,6 @@
{
"name": "guanguans/laravel-code-runner",
"description": "Run the code in the browser. - 在浏览器中运行代码",
"description": "Run the PHP code in the browser. - 在浏览器中运行 PHP 代码",
"license": "MIT",
"type": "library",
"abandoned": false,
Expand All @@ -10,8 +10,12 @@
"code-runner",
"code",
"runner",
"web-tinker",
"web",
"tinker",
"php-parser",
"php",
"parser",
"artisan",
"browser",
"debug",
Expand Down Expand Up @@ -98,7 +102,6 @@
"config": {
"allow-plugins": {
"infection/extension-installer": true,
"kylekatarnls/update-helper": false,
"pestphp/pest-plugin": true,
"phpstan/extension-installer": true
},
Expand Down Expand Up @@ -150,6 +153,8 @@
"@mark-separate",
"@test",
"@mark-separate",
"@phpstan",
"@mark-separate",
"@psalm",
"@mark-finish"
],
Expand All @@ -161,7 +166,7 @@
"md-lint": "lint-md --config .lintmdrc ./*.md ./.github/ ./docs/",
"pest": "./vendor/bin/pest --cache-result-file=./build//phpunit/.phpunit.result.cache",
"pest-coverage": "@pest --coverage-html=./build/phpunit/ --coverage-clover=clover.xml --coverage",
"phpstan": "./vendor/bin/phpstan analyse -vv",
"phpstan": "./vendor/bin/phpstan analyse -v",
"phpstan-baseline": "@phpstan --generate-baseline",
"post-merge": [
"composer install"
Expand Down
2 changes: 1 addition & 1 deletion config/code-runner.php
Expand Up @@ -26,7 +26,7 @@
'prefix' => '/code-runner',
],

'code_runner' => Guanguans\LaravelCodeRunner\CodeRunners\ArtisanCodeRunner::class,
'code_runner' => Guanguans\LaravelCodeRunner\CodeRunners\TinkerCodeRunner::class,

'code_modifier' => Guanguans\LaravelCodeRunner\CodeModifiers\RemoveCommentCodeModifier::class,

Expand Down
2 changes: 2 additions & 0 deletions phpstan.neon
Expand Up @@ -4,6 +4,8 @@ includes:
parameters:
level: 5
paths:
- config
- routes
- src
tmpDir: build/phpstan
checkOctaneCompatibility: true
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Expand Up @@ -20,7 +20,7 @@
</include>
<exclude>
<directory>src/Facades</directory>
<file>src/WebTinkerServiceProvider.php</file>
<file>src/xxx.php</file>
</exclude>
</coverage>
<testsuites>
Expand Down
2 changes: 2 additions & 0 deletions psalm.xml.dist
Expand Up @@ -10,6 +10,8 @@
errorBaseline="psalm-baseline.xml"
>
<projectFiles>
<directory name="config"/>
<directory name="routes"/>
<directory name="src"/>
<ignoreFiles allowMissingFiles="true">
<directory name="vendor"/>
Expand Down
4 changes: 2 additions & 2 deletions routes/code-runner.php
Expand Up @@ -16,7 +16,7 @@
Route::group(
['namespace' => 'Guanguans\LaravelCodeRunner\Http\Controllers'] + config('code-runner.route'),
static function (Router $router): void {
Route::get('/', 'CodeRunnerController@index');
Route::post('/run', 'CodeRunnerController@run')->name('run');
$router->get('/', 'CodeRunnerController@index');
$router->post('/run', 'CodeRunnerController@run')->name('run');
}
);

0 comments on commit 145fb32

Please sign in to comment.