Skip to content

Commit

Permalink
Update README.md to clarify aspect weaving paths
Browse files Browse the repository at this point in the history
Revised the documentation to differentiate between weaving aspects into the source directory and a specific target directory. This change enhances clarity by providing explicit example paths for both use cases.
  • Loading branch information
koriym committed Nov 6, 2024
1 parent 0854ee1 commit 2d5f44f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ $aspect->bind(

$billing = $aspect->newInstance(RealBillingService::class);
try {
echo $billing->chargeOrder();
echo $billing->chargeOrder(); // Interceptors applied
} catch (\RuntimeException $e) {
echo $e->getMessage() . "\n";
exit(1);
Expand All @@ -103,7 +103,11 @@ $aspect->bind(
(new Matcher())->annotatedWith(NotOnWeekends::class),
[new WeekendBlocker()]
);
$aspect->weave(__DIR__ . '/src'); // Weave the aspects to all classes in the directory that match the matcher.
// Weave aspects into all matching classes in the source directory
$aspect->weave('/path/to/src');

// Or weave into specific target directory
$aspect->weave('/path/to/target');

$billing = new RealBillingService();
echo $billing->chargeOrder(); // Interceptors applied
Expand Down

0 comments on commit 2d5f44f

Please sign in to comment.