Skip to content

Commit

Permalink
Refactor README.md content structure
Browse files Browse the repository at this point in the history
Removed redundant code blocks and explanations in the README.md file. The file is now more concise and easier to navigate. A part of the content concerning Interceptor Details was revised for clarity.
  • Loading branch information
koriym committed Jul 7, 2024
1 parent 28f4a78 commit 097721f
Showing 1 changed file with 3 additions and 26 deletions.
29 changes: 3 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class WeekendBlocker implements MethodInterceptor
}
```

```markdown
Finally, we configure everything using the `Aspect` class:

```php
Expand Down Expand Up @@ -130,9 +129,8 @@ $aspect = new Aspect('/path/to/tmp/dir');
If not specified, the system's default temporary directory will be used.

This concludes the basic usage of Ray.Aop. For more detailed information and advanced usage, please refer to the full documentation.
```
Own matcher
-----------

## Own matcher

You can have your own matcher.
To create `contains` matcher, You need to provide a class which have two method. One is `matchesClass` for class match.
Expand Down Expand Up @@ -170,27 +168,6 @@ class IsContainsMatcher extends AbstractMatcher

In an interceptor, a `MethodInvocation` object is passed to the `invoke` method:

```php
class MyInterceptor implements MethodInterceptor
{
public function invoke(MethodInvocation $invocation)
{
// Before method invocation
$result = $invocation->proceed();
// After method invocation
return $result;
}
}

In an interceptor a `MethodInvocation` object gets passed to the `invoke` method. We can the decorate the targetted instances so that you run computations before or after any methods on the target are invoked.

```markdown
[The first half remains unchanged, updating the Interceptor Details section]

## Interceptor Details

In an interceptor, a `MethodInvocation` object is passed to the `invoke` method:

```php
class MyInterceptor implements MethodInterceptor
{
Expand Down Expand Up @@ -269,4 +246,4 @@ SevericeLocator::setReader(new AttributeReader);`
---

* Note: This documentation of the part is taken from [Guice/AOP](https://github.com/google/guice/wiki/AOP).
z1
z1

0 comments on commit 097721f

Please sign in to comment.