Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CompileVisitor using the visitor pattern and CompiledInjector #115

Merged
merged 158 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
d7040fd
Add compiler and related features
koriym Nov 27, 2024
6eb1d76
Add type annotations and coding standard comments
koriym Nov 27, 2024
62fc288
Remove obsolete AOP and DI-related classes
koriym Nov 28, 2024
7d06eaf
Refactor InjectionPoint and related classes for better DI
koriym Nov 28, 2024
84bfe97
Improve Fake class
koriym Nov 28, 2024
b58d3b4
fixup! Remove obsolete AOP and DI-related classes
koriym Nov 28, 2024
428d55a
Add LazyModule class for creating a lazy module
koriym Nov 28, 2024
c3e9ff1
Refactor test setup with CompileInjector
koriym Nov 28, 2024
241763c
Remove obsolete testCompileFailureLog function
koriym Nov 28, 2024
060b835
Refactor ContextBindingTest to use a CompileInjector
koriym Nov 28, 2024
39923b7
fixup! Add LazyModule class for creating a lazy module
koriym Nov 28, 2024
544cc7f
Refactor MultiBindingTest using CompileInjector
koriym Nov 28, 2024
f2b3d17
Implement LazyModuleInterface in LazyModule class
koriym Nov 28, 2024
c5c2bc6
Refactor to use CompileInjector with LazyModule
koriym Nov 28, 2024
a9228c9
Refactor tests to use CompileInjector and enhance coverage
koriym Nov 28, 2024
bdbb351
Remove deprecated test files for Normalizer and PrivateProperty.
koriym Nov 28, 2024
38d68bc
Remove obsolete DiCompilerTest.php file
koriym Nov 28, 2024
5c457ad
Remove unused imports from DevInjectorContext.php
koriym Nov 28, 2024
037ab21
Remove scriptDir dependency from InjectionPoint class.
koriym Nov 28, 2024
b77a4c1
Soothe SA: Add type annotation for $isProd in InjectorFactory
koriym Nov 28, 2024
992503b
Update Symfony dependencies in composer.lock
koriym Nov 28, 2024
d679618
Fix CS: Add type hint to ContextBindingTest injector property
koriym Nov 28, 2024
27acbf2
Rename DiCompiler.php to src-deprecated directory
koriym Nov 28, 2024
769b01e
Refactor test assertion for instance type checks
koriym Nov 28, 2024
215286c
Update ray/di dependency for compatibility
koriym Nov 28, 2024
6930cd9
Refactor temporary directory creation in tests.
koriym Nov 28, 2024
e281db2
Add runtime type assertions in VisitorCompilerTest
koriym Nov 28, 2024
47a88ed
Ignore PHPStan warning on InjectionPoint initialization
koriym Nov 28, 2024
24102ec
Refactor test setup to use a new CompileInjector instance
koriym Nov 28, 2024
ea78008
fixup! Update ray/di dependency for compatibility
koriym Nov 28, 2024
0ef1aac
Add ScriptDir annotation to Compiler class
koriym Nov 29, 2024
bb28ca9
Add ray/di dependency and update autoload paths
koriym Nov 29, 2024
7f7e177
Update dependencies and deprecate DiCompiler class.
koriym Nov 29, 2024
63b555c
Refactor docblock style in Compiler.php
koriym Nov 29, 2024
13e2794
Remove unused doctrine/annotations dependency
koriym Nov 29, 2024
b28f767
Remove unnecessary Ray\Di components from config
koriym Nov 29, 2024
9dfdc99
Add PhpParser to composer-require-checker configuration
koriym Nov 29, 2024
0afe222
fixup! Add ray/di dependency and update autoload paths
koriym Nov 29, 2024
b028815
Fix incorrect assertion in InjectorFactoryTest
koriym Nov 29, 2024
5de7cf7
Refactor LazyModule initialization in tests.
koriym Nov 29, 2024
61dea78
fixup! fixup! Add ray/di dependency and update autoload paths
koriym Nov 29, 2024
eb197f5
Remove default values for $ip parameter in functions.
koriym Nov 29, 2024
536e781
Avoit static functions in AirInjector
koriym Nov 30, 2024
d9a2542
Add InjectionPoint test
koriym Nov 30, 2024
ec4e4e3
Remove unused InjectionPoint and update script handling
koriym Nov 30, 2024
eacf2af
Enable unused baseline entry detection in Psalm config
koriym Nov 30, 2024
1308f2f
Fix InjectionPoint namespace in InstanceScript.php
koriym Nov 30, 2024
8e8dc63
Add autoloading for standalone functions in Composer
koriym Nov 30, 2024
1ad9161
Refactor singleton and prototype argument creation
koriym Nov 30, 2024
a2455d4
Refactor AirInjector: Simplify instance retrieval
koriym Nov 30, 2024
d865fd1
Refactor CompileInjector to use AirInjector
koriym Nov 30, 2024
f05a597
Update tests with script path and class changes
koriym Nov 30, 2024
9641283
Add initial Qodana configuration file
koriym Nov 30, 2024
7d6df30
fixup! Update tests with script path and class changes
koriym Nov 30, 2024
995bf54
Refactor and update dependencies for stability.
koriym Nov 30, 2024
ababe09
Replace TestClass with FakeTestClass in tests
koriym Nov 30, 2024
06b44a8
Refactor instance creation logic for clarity
koriym Nov 30, 2024
89a4b2c
Update src/Compiler.php
koriym Jan 12, 2025
a8eaa3e
Add CompileNullObject invocation in CompileInjector
koriym Jan 11, 2025
2a9f348
Refactor null object handling in dependency mapping.
koriym Jan 11, 2025
7e35b83
Add binding for FakeNullInterface in FakeCarModule
koriym Jan 11, 2025
23097ee
Enable cleanup in AirInjectorTest teardown method
koriym Jan 12, 2025
636156f
Update src/CompileInjector.php
koriym Jan 12, 2025
18ab50e
Update tests/AirInjectorTest.php
koriym Jan 12, 2025
da6a4af
Refactor null handling and tidy up dependencies.
koriym Jan 12, 2025
8fb9e7c
Remove unused test method from AirInjectorTest
koriym Jan 12, 2025
f54bb27
Remove qodana.yaml configuration file
koriym Jan 12, 2025
dd78fa8
Fix misplaced code coverage annotation in Compiler
koriym Jan 12, 2025
ff26d8b
Remove unused InjectionPointUnbound import from test
koriym Jan 12, 2025
dfb2eac
Remove CompileNullObject class and its invocation
koriym Jan 12, 2025
3941135
Mark IpQualifier as deprecated with version and reason.
koriym Jan 12, 2025
642db88
Refactor AirInjector with assertions and cleanup
koriym Jan 12, 2025
f5cc2b4
Update src-function/singleton.php
koriym Jan 12, 2025
d9a9381
Update src-function/prototype.php
koriym Jan 12, 2025
92dd7ba
Refactor file handling and add custom exception.
koriym Jan 12, 2025
4d4df5d
Refactor aspect binding handling in pushAspectBind.
koriym Jan 12, 2025
7f802ea
Revert "Refactor file handling and add custom exception."
koriym Jan 12, 2025
fb44928
Use `realpath` to resolve absolute script directory paths.
koriym Jan 12, 2025
b2de176
Add validation for readable script directory in AirInjector
koriym Jan 12, 2025
248e05b
Add type annotations for array bindings in InstanceScript
koriym Jan 12, 2025
628f5f2
Refactor file handling and add custom exception.
koriym Jan 12, 2025
b974dad
Add a new file to the repository
koriym Jan 12, 2025
5d3352e
Refactor singleton and prototype handling in DI compiler
koriym Jan 12, 2025
d250a2a
Remove unused code and dependencies in test files
koriym Jan 12, 2025
9a5e305
fixup! Refactor singleton and prototype handling in DI compiler
koriym Jan 12, 2025
54fe3fc
Refactor variable usage in AirInjector registerLoader function.
koriym Jan 12, 2025
301e5ee
Remove isSingleton parameter from pushProviderContext
koriym Jan 12, 2025
ea8cd73
fixup! Refactor variable usage in AirInjector registerLoader function.
koriym Jan 12, 2025
53acd69
Refactor comments in AirInjector for clarity.
koriym Jan 12, 2025
28bb097
Replace AirInjector with CompiledInjector
koriym Jan 12, 2025
27b7ea8
Enhance documentation and improve Compiler class annotations
koriym Jan 12, 2025
b468080
fixup! Replace AirInjector with CompiledInjector
koriym Jan 12, 2025
7123345
[ci skip] Add exception handling for unwritable binding log files
koriym Jan 13, 2025
fd4015c
Refactor functions and update code style configuration
koriym Jan 13, 2025
794c619
Fix docblock punctuation in CompileInjector.php
koriym Jan 13, 2025
9c7eb8a
Add detailed PHPDoc comments to singleton and prototype
koriym Jan 13, 2025
6306907
Add debug utility and comment in singleton function
koriym Jan 13, 2025
6a5a78c
Set scriptDir to its real path in CompiledInjector
koriym Jan 13, 2025
48f4a63
Update return type doc for dependency resolution function
koriym Jan 13, 2025
8c7641b
Refactor ScriptDir handling and update Injector binding
koriym Jan 13, 2025
c3d2c24
Refactor module installation into Compiler class
koriym Jan 13, 2025
559a13c
Add CompilerModule and improve dependency handling
koriym Jan 13, 2025
3dc68af
Move modules to `src-deprecated` and mark them as deprecated.
koriym Jan 13, 2025
005e942
fixup! Remove CompileNullObject class and its invocation
koriym Jan 14, 2025
0d31b15
Revert `CompileInjector` to previous released version to keep compati…
koriym Jan 14, 2025
a7c797e
Deprecate `CompileInjector` and add replacement utilities
koriym Jan 14, 2025
b740d3d
fixup! Deprecate `CompileInjector` and add replacement utilities
koriym Jan 14, 2025
53aa693
Update README with detailed production and development usage
koriym Jan 14, 2025
89f132a
Expand autoload paths to include deprecated source directory.
koriym Jan 14, 2025
c2e3595
Swap parameter order in Compiler::compile method
koriym Jan 14, 2025
18e7074
Refactor tests to use `CompiledInjector` and `Compiler`.
koriym Jan 14, 2025
a9bec97
Update injector implementation to use CompiledInjector
koriym Jan 14, 2025
336372e
Update PHPUnit dependency version in composer.json
koriym Jan 14, 2025
2aa2a30
Remove unused multi-binding logic from CompilerModule
koriym Jan 14, 2025
245e63b
Ensure `nikic/php-parser` is required in CompileInjector
koriym Jan 14, 2025
51c6e4f
Refactor CompilerModule imports to remove unused dependencies.
koriym Jan 14, 2025
ab44b23
Refactor type definitions into a dedicated `Types` class.
koriym Jan 14, 2025
3e2bd85
Add new dependencies for annotations and require-checker
koriym Jan 14, 2025
31088fb
Update composer-require-checker excludes with PhpParser types
koriym Jan 14, 2025
e3ae3fc
Define type annotations and add constructor coverage ignore
koriym Jan 14, 2025
ad9daf7
Remove redundant injector interface condition check
koriym Jan 14, 2025
0dd5adf
Change implemented interface to ScriptInjectorInterface
koriym Jan 14, 2025
536e721
Rename LazyModule.php and mark it as deprecated
koriym Jan 14, 2025
37572c2
Add test for ScriptDirNotReadable exception in CompiledInjector
koriym Jan 14, 2025
977320c
fixup! Add new dependencies for annotations and require-checker
koriym Jan 14, 2025
1ff846a
fixup! Add test for ScriptDirNotReadable exception in CompiledInjector
koriym Jan 14, 2025
1d630da
fixup! Change implemented interface to ScriptInjectorInterface
koriym Jan 14, 2025
6b93d65
fixup! Refactor tests to use `CompiledInjector` and `Compiler`.
koriym Jan 14, 2025
cc3596a
Update src/CompiledInjector.php
koriym Jan 14, 2025
1d5a54b
fixup! Rename LazyModule.php and mark it as deprecated
koriym Jan 14, 2025
9d9d413
Refactor test cleanup with variable for script directory
koriym Jan 14, 2025
dd301f0
Add a missing template annotation in CompiledInjector.php
koriym Jan 14, 2025
9c6ec91
Refactor InjectorFactory to simplify injector creation logic
koriym Jan 14, 2025
ee0faa0
Rename FakeLazyModule to FakeModule and update references
koriym Jan 14, 2025
0a8d381
Refactor test temp directories to use test method names.
koriym Jan 14, 2025
5df3f09
Update class reference in CompiledInjector docblock
koriym Jan 14, 2025
12c246e
fixup! Remove obsolete testCompileFailureLog function
koriym Jan 14, 2025
6712387
Refactor compile method to swap parameter order
koriym Jan 16, 2025
8a70d8d
Refactor script path handling to use relative paths
koriym Jan 16, 2025
d436e2f
Add documentation for ScriptDirNotReadable error
koriym Jan 16, 2025
f8b983f
Add detailed error documentation and improve exception message
koriym Jan 16, 2025
7b8818d
Refactor README to improve clarity and streamline instructions
koriym Jan 16, 2025
3865fcc
Revert "Refactor script path handling to use relative paths"
koriym Jan 16, 2025
873c604
Implement Countable interface in Scripts class
koriym Jan 17, 2025
e636425
Add compile script for dependency injection container
koriym Jan 17, 2025
f08d8cc
Add compile script for dependency injection container
koriym Jan 17, 2025
210b82d
Add example for creating a compile script in README
koriym Jan 17, 2025
1272baf
Add unit tests for Scripts class
koriym Jan 17, 2025
bd9ef6a
Cast file operations to ensure type safety
koriym Jan 17, 2025
b056540
fixup! Add example for creating a compile script in README
koriym Jan 17, 2025
f4090d8
Fix punctuation in README.md for list consistency
koriym Jan 17, 2025
9215cba
Update README with Dockerfile improvements and .gitignore
koriym Jan 17, 2025
74aa414
Update temp directory path for ScriptsTest
koriym Jan 17, 2025
3031fd7
fixup! Update README with Dockerfile improvements and .gitignore
koriym Jan 17, 2025
c58be92
Refactor README with clearer examples and error handling.
koriym Feb 4, 2025
552f0d8
Update PHP version to 8.4 in GitHub workflows
koriym Feb 4, 2025
786782b
Update dev dependencies and add new packages for Amp v3
koriym Feb 4, 2025
3936771
Improve Dockerfile and update README with best practices.
koriym Feb 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.3
php_version: 8.4
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ jobs:
sa:
uses: ray-di/.github/.github/workflows/static-analysis.yml@v1
with:
php_version: 8.3
php_version: 8.4
has_crc_config: true
178 changes: 141 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,172 @@
# Ray.Compiler

## Dependency Injection Compiler
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ray-di/Ray.Compiler/badges/quality-score.png?b=1.x)](https://scrutinizer-ci.com/g/ray-di/Ray.Compiler/?branch=1.x)
[![codecov](https://codecov.io/gh/ray-di/Ray.Compiler/branch/1.x/graph/badge.svg?token=KCQXtu01zc)](https://codecov.io/gh/ray-di/Ray.Compiler)
[![Type Coverage](https://shepherd.dev/github/ray-di/Ray.Compiler/coverage.svg)](https://shepherd.dev/github/ray-di/Ray.Compiler)
[![Continuous Integration](https://github.com/ray-di/Ray.Compiler/actions/workflows/continuous-integration.yml/badge.svg?branch=1.x)](https://github.com/ray-di/Ray.Compiler/actions/workflows/continuous-integration.yml)

[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ray-di/Ray.Di/badges/quality-score.png?b=2.x)](https://scrutinizer-ci.com/g/ray-di/Ray.Di/?branch=2.x)
[![codecov](https://codecov.io/gh/ray-di/Ray.Di/branch/2.x/graph/badge.svg?token=KCQXtu01zc)](https://codecov.io/gh/ray-di/Ray.Di)
[![Type Coverage](https://shepherd.dev/github/ray-di/Ray.Di/coverage.svg)](https://shepherd.dev/github/ray-di/Ray.Di)
[![Continuous Integration](https://github.com/ray-di/Ray.Di/actions/workflows/continuous-integration.yml/badge.svg?branch=2.x)](https://github.com/ray-di/Ray.Di/actions/workflows/continuous-integration.yml)
Pre-compile Ray.Di bindings to PHP code for maximum performance. The compiled injector runs faster than the standard injector by avoiding runtime reflection and binding resolution.

Ray.Compiler compiles Ray.Di bindings into PHP code, providing a performance boost that makes Dependency Injection couldn't be any faster.
## Installation

## Script Injector
```bash
composer require ray/compiler
```

`ScriptInjector` has the same interface as Ray.Di Injector; whereas Ray.Di Injector resolves dependencies based on memory bindings, ScriptInjector executes pre-compiled PHP code and is faster.
## Usage

Ray.Di injector
```php
$injector = new Injector(new CarModule); // Ray.Di injector
```
Ray.Compiler provides two main components:

1. **`Compiler`**: Compiles Ray.Di bindings into PHP code.
2. **`CompiledInjector`**: High-performance injector that executes pre-compiled code.

### Basic Usage

Pre-compile your dependencies:

Ray.Compiler injector
```php
$injector = new ScriptInjector($tmpDir, fn => new CarModule);
use Ray\Compiler\Compiler;

$compiler = new Compiler();
// Compile Ray.Di bindings to PHP files
$compiler->compile(
$module, // AbstractModule: Your application's module
$scriptDir // string: Directory path where compiled PHP files will be generated
);
```

## Precompile

You will want to compile all dependencies into code before deploying the production. The `DiCompiler` will compile all bindings into PHP code.
Use the compiled injector:

```php
$compiler = new DiCompiler(new CarModule, $tmpDir);
$compiler->compile();
use Ray\Compiler\CompiledInjector;

$injector = new CompiledInjector($scriptDir);
$instance = $injector->getInstance(YourInterface::class);
```

## Object graph visualization
### Compiler Integration

Object graph can be visualized with `dumpGraph()`.
Graph HTML files will be output at `graph` folder under `$tmpDir`.
Create a compile script:

```php
$compiler = new DiCompiler(new Module, $tmpDir);
$compiler->compile();
$compiler->dumpGraph();
try {
$scripts = (new Compiler())->compile(
new AppModule(),
__DIR__ . '/di'
);
printf("Compiled %d files.\n", count($scripts));
} catch (CompileException $e) {
fprintf(STDERR, "Compilation failed: %s\n", $e->getMessage());
exit(1);
}
```

Add compile script to your `composer.json`:

```json
{
"scripts": {
"post-install-cmd": ["php bin/compile.php"]
}
}
```
open tmp/graph/Ray_Compiler_FakeCarInterface-.html

## Docker Integration

Use multi-stage builds to maintain path consistency:

```dockerfile
# Build stage
FROM php:8.2-cli-alpine as builder

# Set working directory
WORKDIR /app

# Install composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

# Copy composer files first
COPY composer.json composer.lock ./

# Install dependencies
RUN composer install \
--no-dev \
--no-scripts \
--prefer-dist \
--no-interaction \
--optimize-autoloader

# Copy application code
COPY . .

# Create non-root user
RUN adduser -D appuser
USER appuser

# Compile DI code
RUN php bin/compile.php

# Production stage
FROM php:8.2-cli-alpine

# Create non-root user
RUN adduser -D appuser

# Set working directory
WORKDIR /app

# Copy only necessary files from builder
COPY --from=builder /app/vendor/ ./vendor/
COPY . .
COPY --from=builder /app/tmp/di/ ./tmp/di/

# Switch to non-root user
USER appuser
# Start command or other configurations can be added here
```

## CompileInjector
## Docker Best Practices

The `CompileInjector` gives you the best performance in both development (x2) and production (x10) by switching two injector.
When building your Docker images, it’s important to exclude unnecessary files to speed up builds, reduce image size, and prevent sensitive files from being included in the image. Below is a recommended `.dockerignore` file. Adjust it to fit your project’s requirements:

Get the injector by specifying the binding and cache, depending on the execution context of the application.
```dockerignore
# Ignore Git files
.git/

```php
$injector = new CompileInjector($tmpDir, $injectorContext);
# Ignore dependency directories
/vendor/
/node_modules/

# Ignore compiled DI files
/tmp/di/

# Ignore environment-specific files
.env
.env.local
.env.*.local

# Ignore documentation and tests
/docs/
/tests/

# Ignore IDE-specific files
.idea/
.vscode/

# Ignore log files
*.log

# Ignore OS-specific files
.DS_Store
Thumbs.db
```

`$injectorContext` example:
## Version Control

* [dev](docs/exmaple/DevInjectorContext.php)
* [prod](docs/exmaple/ProdInjectorContext.php)
Compiled DI code is considered an environment-specific build artifact and **should not** be committed to version control. This approach ensures that your repository remains clean and build artifacts do not cause merge conflicts or unexpected behavior across different environments.

The `__invoke()` method prepares the modules needed in that context.
The `getCache()` method specifies the cache of the injector itself.
Add the compile directory to your `.gitignore`:

Install `DiCompileModule` in the context for production. The injector is more optimized and dependency errors are reported at compile-time instead of run-time.
```gitignore
/tmp/di/
```
13 changes: 13 additions & 0 deletions bin/compile.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

use Ray\Compiler\Compiler;
use Ray\Compiler\FakeCarModule;

require dirname(__DIR__) . '/vendor/autoload.php';
koriym marked this conversation as resolved.
Show resolved Hide resolved

$scripts = (new Compiler())->compile(
new FakeCarModule(),
__DIR__ . '/di'
);
koriym marked this conversation as resolved.
Show resolved Hide resolved

printf('Compiled %d files.', count($scripts));
23 changes: 9 additions & 14 deletions composer-require-checker.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,14 @@
"static", "self", "parent",
"array", "string", "int", "float", "bool", "iterable", "callable", "void", "object",
"Attribute", "ReflectionAttribute",
"Ray\\Di\\AbstractModule", "Ray\\Di\\Annotation\\ScriptDir",
"Ray\\Di\\Argument", "Ray\\Di\\Arguments",
"Ray\\Di\\AssistedModule", "Ray\\Di\\Bind",
"Ray\\Di\\Container", "Ray\\Di\\Dependency",
"Ray\\Di\\DependencyInterface","Ray\\Di\\DependencyProvider",
"Ray\\Di\\Di\\Qualifier", "Ray\\Di\\Exception\\NotFound",
"Ray\\Di\\Exception\\Unbound", "Ray\\Di\\InjectionPointInterface",
"Ray\\Di\\Injector", "Ray\\Di\\InjectorInterface", "Ray\\Di\\Instance",
"Ray\\Di\\MultiBinding\\Map", "Ray\\Di\\MultiBinding\\MapProvider",
"Ray\\Di\\Name", "Ray\\Di\\NullCache",
"Ray\\Di\\NullModule", "Ray\\Di\\NullObjectDependency",
"Ray\\Di\\ProviderInterface", "Ray\\Di\\ProviderSetModule",
"Ray\\Di\\SetContextInterface"

"PhpParser",
"PhpParser\\BuilderFactory", "PhpParser\\Node", "PhpParser\\NodeAbstract", "PhpParser\\Node\\Arg",
"PhpParser\\Node\\Expr", "PhpParser\\Node\\Expr\\ArrayItem", "PhpParser\\Node\\Expr\\Array_",
"PhpParser\\Node\\Expr\\Array_", "PhpParser\\Node\\Expr\\Assign", "PhpParser\\Node\\Expr\\ConstFetch",
"PhpParser\\Node\\Expr\\FuncCall", "PhpParser\\Node\\Expr\\MethodCall", "PhpParser\\Node\\Expr\\New_",
"PhpParser\\Node\\Expr\\PropertyFetch", "PhpParser\\Node\\Expr\\Variable", "PhpParser\\Node\\Name",
"PhpParser\\Node\\FullyQualified", "PhpParser\\Node\\Scalar\\DNumber", "PhpParser\\Node\\Scalar\\LNumber",
"PhpParser\\Node\\Scalar\\String_", "PhpParser\\Node\\Stmt\\Return_", "PhpParser\\ParserFactory",
"PhpParser\\PrettyPrinter\\Standard", "PhpParser\\Node\\Name\\FullyQualified"
koriym marked this conversation as resolved.
Show resolved Hide resolved
]
}
22 changes: 11 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,19 @@
],
"require": {
"php": "^7.2 || ^8.0",
"doctrine/annotations": "^1.12 || ^2.0",
"doctrine/cache": "^1.10 || ^2.1",
"doctrine/annotations": "^1.8 || ^2.0",
"koriym/attributes": "^1.0",
"koriym/null-object": "^1.0",
"koriym/param-reader": "^1.0",
"koriym/printo": "^1.0",
"nikic/php-parser": "^4.5 || ^5.0",
"ray/aop": "^2.14"
"ray/aop": "^2.14",
"ray/di": "^2.18"
},
"require-dev": {
"ext-pdo": "*",
"ray/di": "^2.16",
"phpunit/phpunit": "^8.5.24 || ^9.5",
"bamarni/composer-bin-plugin": "^1.4"
"bamarni/composer-bin-plugin": "^1.4",
"phpunit/phpunit": "^8.5.41 || ^9.5"
},
"config": {
"sort-packages": true,
Expand All @@ -36,7 +35,11 @@
"autoload": {
"psr-4": {
"Ray\\Compiler\\": ["src", "src-deprecated"]
}
},
"files": [
"src-function/prototype.php",
"src-function/singleton.php"
]
},
"autoload-dev": {
"psr-4": {
Expand All @@ -51,7 +54,7 @@
"coverage": ["php -dzend_extension=xdebug.so -dxdebug.mode=coverage ./vendor/bin/phpunit --coverage-text --coverage-html=build/coverage"],
"pcov": ["php -dextension=pcov.so -d pcov.enabled=1 ./vendor/bin/phpunit --coverage-text --coverage-html=build/coverage --coverage-clover=coverage.xml"],
"cs": ["phpcs --standard=./phpcs.xml src tests"],
"cs-fix": ["phpcbf src tests"],
"cs-fix": ["phpcbf src src-function tests"],
"clean": ["phpstan clear-result-cache", "psalm --clear-cache", "rm -rf tests/tmp/*.php"],
"sa": ["psalm --show-info=false", "phpstan analyse -c phpstan.neon --no-progress"],
"metrics": ["@test", "phpmetrics --report-html=build/metrics --exclude=Exception --log-junit=build/junit.xml --junit=build/junit.xml src"],
Expand All @@ -62,9 +65,6 @@
"bamarni-bin": {
"forward-command": true,
"bin-links": true
},
"branch-alias": {
"dev-master": "1.0.x-dev"
}
}
}
Loading
Loading