Skip to content

Commit

Permalink
Merge pull request #14 from bearsunday/halo
Browse files Browse the repository at this point in the history
Create HaloModule
  • Loading branch information
koriym authored Apr 20, 2024
2 parents 8209086 + 9e81d1d commit 407eb7a
Show file tree
Hide file tree
Showing 53 changed files with 2,473 additions and 1,311 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ jobs:
cs:
uses: ray-di/.github/.github/workflows/coding-standards.yml@v1
with:
php_version: 8.1
php_version: 8.3
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ jobs:
ci:
uses: ray-di/.github/.github/workflows/continuous-integration.yml@v1
with:
old_stable: '["7.4", "8.0", "8.1", "8.2"]'
old_stable: '["8.1", "8.2"]'
current_stable: 8.3
1 change: 1 addition & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ jobs:
uses: ray-di/.github/.github/workflows/static-analysis.yml@v1
with:
php_version: 8.3
has_crc_config: true
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@
tests/Http/log/HttpResourceClientTest.log
coverage.xml
tests/Http/log/app.log
.idea
!.idea/
.idea/*
!.idea/runConfigurations/
6 changes: 6 additions & 0 deletions .idea/runConfigurations/phpunit_xml_dist.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/runConfigurations/serve_qiq.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/runConfigurations/serve_twig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

194 changes: 0 additions & 194 deletions .php_cs.dist

This file was deleted.

19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# BEAR.DevTools

## Halo module

A frame, called a halo, appears around the HTML representation of the resource.
The halo identifies the resource being rendered and provides tools about the resource.

The tools in the halo provide information about the resource, such as its status (Status), its representation (View), the interceptor applied to it, and so on. It also provides links to editors to resource classes and resource templates.

```php
class DevModule extends AbstractModule
{
protected function configure(): void
{
$this->install(new HaloModule($this));
}
}
```

## HttpResource client

`HttpResource` starts a local server and becomes an HTTP client.

```php
Expand Down
10 changes: 10 additions & 0 deletions composer-require-checker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"symbol-whitelist": [
"null", "true", "false",
"static", "self", "parent",
"array", "string", "int", "float", "bool", "iterable", "callable", "void", "object",
"json_decode", "json_encode", "JSON_PRETTY_PRINT", "JSON_THROW_ON_ERROR", "JSON_UNESCAPED_SLASHES", "JSON_UNESCAPED_UNICODE",
"xhprof_disable", "xhprof_enable", "XHPROF_FLAGS_CPU", "XHPROF_FLAGS_MEMORY", "XHPROF_FLAGS_NO_BUILTINS",
"Madapaja\\TwigModule\\Annotation\\TwigPaths"
]
}
32 changes: 29 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,22 @@
}
],
"require": {
"php": "^7.3 || ^8.0",
"ext-json": "*",
"php": "^8.0",
"ext-filter": "*",
"aura/sql": "^3 || ^4 || ^5",
"bear/app-meta": "^1.8",
"bear/resource": "^1.17",
"koriym/php-server": "^1.0",
"xhprof/xhprof": "^2.3",
"psr/log": "^1 || ^2 || ^3",
"ray/aop": "^2.14",
"ray/di": "^2.14",
"symfony/process": "^v5.4 || ^v6.4 || ^v7.0"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.4",
"bear/package": "^1.10",
"madapaja/twig-module": "^2.5",
"phpunit/phpunit": "^9.6",
"ray/aura-sql-module": "^1.10"
},
Expand All @@ -32,7 +36,10 @@
"autoload-dev": {
"psr-4": {
"BEAR\\Dev\\": [
"tests/"
"tests/Fake"
],
"MyVendor\\MyProject\\": [
"tests/Fake/app/src"
]
}
},
Expand All @@ -56,5 +63,24 @@
"allow-plugins": {
"bamarni/composer-bin-plugin": true
}
},
"repositories": [
{
"type": "package",
"package": {
"name": "xhprof/xhprof",
"version": "2.3.9",
"dist": {
"url": "https://github.com/longxinH/xhprof/archive/refs/tags/v2.3.9.zip",
"type": "zip"
},
"autoload": {
"classmap": ["/xhprof_lib/utils/"]
}
}
}
],
"suggest": {
"ext-xhprof": "XHprof hierarchical profiler"
}
}
3 changes: 1 addition & 2 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor-bin/tools/vendor/squizlabs/php_codesniffer/phpcs.xsd"
>
<description>BEAR.Skeleton Coding Standard</description>
<description>BEAR.DevTools Coding Standard</description>
<arg name="basepath" value="."/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="80"/>
Expand Down Expand Up @@ -35,7 +35,6 @@
<exclude name="SlevomatCodingStandard.Classes.SuperfluousTraitNaming.SuperfluousSuffix"/>
<exclude name="Squiz.Strings.DoubleQuoteUsage.ContainsVar"/>
<!-- Exclude files -->
<exclude-pattern>*/tests/Fake/*</exclude-pattern>
<exclude-pattern>*/tmp/*</exclude-pattern>
</rule>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@

use RuntimeException;
use Symfony\Component\Process\Process;

use function error_log;
use function is_int;
use function register_shutdown_function;
use function sleep;
use function sprintf;
use function strpos;
use function version_compare;

use const PHP_BINARY;
use const PHP_VERSION;

/** @deprecated User koriym/php-server PhpServer instead */
final class BuiltinServer
{
/**
Expand Down Expand Up @@ -67,13 +66,12 @@ public function start(): void
});
}

/** @codeCoverageIgnore */
public function stop(): void
{
// @codeCoverageIgnoreStart
$exitCode = $this->process->stop();
if ($exitCode !== 143) {
throw new RuntimeException(sprintf('code:%s msg:%s', (string) $exitCode, $this->process->getErrorOutput()));
}
// @codeCoverageIgnoreEnd
}
}
Loading

0 comments on commit 407eb7a

Please sign in to comment.