Skip to content

Commit

Permalink
Remove AopCodeGen
Browse files Browse the repository at this point in the history
  • Loading branch information
koriym committed Nov 12, 2023
1 parent abfee6c commit a2e64f3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 34 deletions.
26 changes: 0 additions & 26 deletions src/AopCodeGen.php

This file was deleted.

9 changes: 4 additions & 5 deletions src/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@
use function sprintf;
use function str_replace;

use const PHP_VERSION_ID;

final class Compiler implements CompilerInterface
{
/** @var string */
public $classDir;

/** @var AopCodeGen */
private $codeGen;

/** @throws AnnotationException */
public function __construct(string $classDir)
{
Expand All @@ -36,7 +35,6 @@ public function __construct(string $classDir)
}

$this->classDir = $classDir;
$this->codeGen = new AopCodeGen();
}

/**
Expand Down Expand Up @@ -114,7 +112,8 @@ private function requireFile(AopPostfixClassName $className, ReflectionClass $so
{
$file = $this->getFileName($className->fqn);
if (! file_exists($file)) {
$aopCode = $this->codeGen->generate($sourceClass, $bind, $className->postFix);
$code = new AopCode(new MethodSignatureString(PHP_VERSION_ID));
$aopCode = $code->generate($sourceClass, $bind, $className->postFix);
file_put_contents($file, $aopCode);
}

Expand Down
8 changes: 5 additions & 3 deletions tests/AopCodeGenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@
use function tempnam;
use function unlink;

class AopCodeGenTest extends TestCase
use const PHP_VERSION_ID;

class AopCodeTest extends TestCase

Check failure on line 20 in tests/AopCodeGenTest.php

View workflow job for this annotation

GitHub Actions / cs / Coding Standards

Class name doesn't match filename; expected "class AopCodeGenTest"

Check failure on line 20 in tests/AopCodeGenTest.php

View workflow job for this annotation

GitHub Actions / cs / Coding Standards

Class name doesn't match filename; expected "class AopCodeGenTest"
{
/** @var AopCodeGen */
/** @var AopCode */
private $codeGen;

protected function setUp(): void
{
$this->codeGen = new AopCodeGen();
$this->codeGen = new AopCode(new MethodSignatureString(PHP_VERSION_ID));
}

public function testTypeDeclarations(): void
Expand Down

0 comments on commit a2e64f3

Please sign in to comment.