Skip to content

necromant2005/AOP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

=AOP/Loader=

Some syntax sugar for PHP

=USE CASE=

Asserts:
```
Class A 
{
    public function foo(string $str, integer $amount)
    {

    }
}
```
will be translated to 
```
Class A 
{
    public function foo($str, $amount)
    {
        if (!is_string($content)) throw new \ArgumentError('Argument 0 passed to foo() must be a string');
        if (!is_integer($content)) throw new \ArgumentError('Argument 1 passed to foo() must be a integer');
    }
}
```

ClassNew SyntaxSugar
```
$x = A.new('test')->foo();
```
will be 
```
$objectA = new A('test');
$x = $objectA->foo();
```

About

AOP - syntax replacer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published