Releases: ytake/Laravel-Aspect
Releases · ytake/Laravel-Aspect
bugfix
added @Async
@async
Methods annotated with @async will return immediately to its caller while its operation executes asynchronously.
Methods annotated with @async must strictly have a void
required pcntl extension
PHP:PCNTL - Process Control
use Ytake\LaravelAspect\Annotation\Async;
class AspectAsync
{
/**
* @Async
* @param null $id
*/
public function asyncProcess()
{
sleep(10);
}
}
bug fixed / supported ignore annotations
Merge pull request #26 from ytake/feature-ignore-annotations Feature ignore annotations
bug fixed
added LogExceptions
/**
* @LogExceptions
* @param null $id
* @return null
* @throws \Exception
*/
public function normalLog($id = null)
{
return $id;
}
/**
* @LogExceptions(expect="\LogicException")
*/
public function expectException()
{
throw new \LogicException;
}
/**
* @LogExceptions(expect="\LogicException")
*/
public function expectNoException()
{
throw new FileNotFoundException(__DIR__);
}
1.1.0: Merge pull request #23 from ytake/develop
added Loggable
@loggable
for logger(illuminate/log, monolog)
- option
params | description |
---|---|
value | log level (default: \Monolog\Logger::INFO) should Monolog Constants |
skipResult | method result output to log |
name | log name prefix(default: Loggable) |
use Ytake\LaravelAspect\Annotation\Loggable;
class AspectLoggable
{
/**
* @Loggable
* @param null $id
* @return null
*/
public function normalLog($id = null)
{
return $id;
}
}
sample)
[2015-12-23 08:15:30] testing.INFO: Loggable:__Test\AspectLoggable.normalLog {"args":{"id":1},"result":1,"time":0.000259876251221}
0.2.2: Merge pull request #15 from ytake/develop
0.2.1: Merge pull request #12 from ytake/bug-patch1
breaking changes
Merge pull request #11 from ytake/feature-change-dependency Feature change dependency