Skip to content

Commit

Permalink
added code (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
ytake authored Apr 23, 2020
1 parent 670e86f commit ce78a13
Show file tree
Hide file tree
Showing 100 changed files with 904 additions and 915 deletions.
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/.styleci.yml export-ignore
/.scrutinizer.yml export-ignore
/.sensiolabs.yml export-ignore
/nitpick.json export-ignore
/composer.lock export-ignore
/tests/ export-ignore
/phpunit.xml export-ignore
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
vendor
composer.lock
composer.phar
*.result.cache

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015-2017 Yuuki Takezawa
Copyright (c) 2015-2020 Yuuki Takezawa

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ This library is heavily inspired by the [jcabi/jcabi-aspects](https://github.com
5.6.x | 2.1.*
5.7.x | 3.0.*
6.0.x | 4.0

7.x | 5.0

### install

```bash
Expand Down
34 changes: 17 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,36 @@
}
],
"require": {
"php": "^7.1",
"illuminate/console": "^6.0",
"illuminate/filesystem": "^6.0",
"illuminate/support": "^6.0",
"illuminate/config": "^6.0",
"illuminate/contracts": "^6.0",
"illuminate/log": "^6.0",
"illuminate/database": "^6.0",
"illuminate/cache": "^6.0",
"illuminate/events": "^6.0",
"illuminate/bus": "^6.0",
"illuminate/queue": "^6.0",
"php": "^7.2.5",
"illuminate/console": "^7.0",
"illuminate/filesystem": "^7.0",
"illuminate/support": "^7.0",
"illuminate/config": "^7.0",
"illuminate/contracts": "^7.0",
"illuminate/log": "^7.0",
"illuminate/database": "^7.0",
"illuminate/cache": "^7.0",
"illuminate/events": "^7.0",
"illuminate/bus": "^7.0",
"illuminate/queue": "^7.0",
"ray/aop": "^2.9",
"doctrine/annotations": "^1.4",
"nikic/php-parser": "^4.0",
"psr/log": "~1.0"
},
"require-dev": {
"symfony/framework-bundle": "^4.1",
"symfony/console": "^4.1",
"phpunit/phpunit": "^7.0",
"symfony/framework-bundle": "^5.0",
"symfony/console": "^5.0",
"phpunit/phpunit": "^8.5",
"mockery/mockery": "*",
"satooshi/php-coveralls": "*",
"sebastian/phpcpd": "*",
"phploc/phploc": "*",
"pdepend/pdepend" : "^2.2.4",
"phpmd/phpmd": "@stable",
"squizlabs/php_codesniffer": "~2.7",
"illuminate/encryption":"^6.0",
"vlucas/phpdotenv": "^3.3"
"illuminate/encryption":"^7.0",
"vlucas/phpdotenv": "^4.1.4"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/AnnotateClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*
* Copyright (c) 2015-2018 Yuuki Takezawa
* Copyright (c) 2015-2020 Yuuki Takezawa
*
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/AnnotationReaderTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*
* Copyright (c) 2015-2018 Yuuki Takezawa
* Copyright (c) 2015-2020 Yuuki Takezawa
*
*/
namespace Ytake\LaravelAspect\Annotation;
Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/CacheEvict.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*
* Copyright (c) 2015-2018 Yuuki Takezawa
* Copyright (c) 2015-2020 Yuuki Takezawa
*
*/
namespace Ytake\LaravelAspect\Annotation;
Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/CachePut.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*
* Copyright (c) 2015-2018 Yuuki Takezawa
* Copyright (c) 2015-2020 Yuuki Takezawa
*
*/
namespace Ytake\LaravelAspect\Annotation;
Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/Cacheable.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*
* Copyright (c) 2015-2018 Yuuki Takezawa
* Copyright (c) 2015-2020 Yuuki Takezawa
*
*/
namespace Ytake\LaravelAspect\Annotation;
Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/Delayed.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*
* Copyright (c) 2015-2018 Yuuki Takezawa
* Copyright (c) 2015-2020 Yuuki Takezawa
*
*/
namespace Ytake\LaravelAspect\Annotation;
Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/EagerQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*
* Copyright (c) 2015-2018 Yuuki Takezawa
* Copyright (c) 2015-2020 Yuuki Takezawa
*
*/
namespace Ytake\LaravelAspect\Annotation;
Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/LazyQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*
* Copyright (c) 2015-2018 Yuuki Takezawa
* Copyright (c) 2015-2020 Yuuki Takezawa
*
*/
namespace Ytake\LaravelAspect\Annotation;
Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/LogExceptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*
* Copyright (c) 2015-2018 Yuuki Takezawa
* Copyright (c) 2015-2020 Yuuki Takezawa
*
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/Loggable.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*
* Copyright (c) 2015-2018 Yuuki Takezawa
* Copyright (c) 2015-2020 Yuuki Takezawa
*
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/LoggableAnnotate.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*
* Copyright (c) 2015-2018 Yuuki Takezawa
* Copyright (c) 2015-2020 Yuuki Takezawa
*
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/MessageDriven.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*
* Copyright (c) 2015-2018 Yuuki Takezawa
* Copyright (c) 2015-2020 Yuuki Takezawa
*
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/PostConstruct.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*
* Copyright (c) 2015-2018 Yuuki Takezawa
* Copyright (c) 2015-2020 Yuuki Takezawa
*
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/QueryLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*
* Copyright (c) 2015-2018 Yuuki Takezawa
* Copyright (c) 2015-2020 Yuuki Takezawa
*
*/
namespace Ytake\LaravelAspect\Annotation;
Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/RetryOnFailure.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*
* Copyright (c) 2015-2018 Yuuki Takezawa
* Copyright (c) 2015-2020 Yuuki Takezawa
*
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/Transactional.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*
* Copyright (c) 2015-2018 Yuuki Takezawa
* Copyright (c) 2015-2020 Yuuki Takezawa
*
*/

Expand Down
2 changes: 1 addition & 1 deletion src/AnnotationConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*
* Copyright (c) 2015-2018 Yuuki Takezawa
* Copyright (c) 2015-2020 Yuuki Takezawa
*
*/

Expand Down
14 changes: 9 additions & 5 deletions src/AspectBind.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*
* Copyright (c) 2015-2018 Yuuki Takezawa
* Copyright (c) 2015-2020 Yuuki Takezawa
*
*/

Expand Down Expand Up @@ -51,18 +51,22 @@ class AspectBind
* @param string $path
* @param bool $cacheable
*/
public function __construct(Filesystem $filesystem, string $path, bool $cacheable = false)
{
public function __construct(
Filesystem $filesystem,
string $path,
bool $cacheable = false
) {
$this->filesystem = $filesystem;
$this->cacheable = $cacheable;
$this->path = $path;
}

/**
* @param string $class
* @param array $pointcuts
*
* @param array $pointcuts
* @return mixed|\Ray\Aop\BindInterface
* @throws \Doctrine\Common\Annotations\AnnotationException
* @throws \ReflectionException
*/
public function bind(string $class, array $pointcuts)
{
Expand Down
2 changes: 1 addition & 1 deletion src/AspectDriverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*
* Copyright (c) 2015-2018 Yuuki Takezawa
* Copyright (c) 2015-2020 Yuuki Takezawa
*
*/
namespace Ytake\LaravelAspect;
Expand Down
12 changes: 6 additions & 6 deletions src/AspectManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*
* Copyright (c) 2015-2018 Yuuki Takezawa
* Copyright (c) 2015-2020 Yuuki Takezawa
*
*/

Expand All @@ -37,8 +37,8 @@ class AspectManager extends Manager
protected function createRayDriver(): AspectDriverInterface
{
return new RayAspectKernel(
$this->app,
$this->app['files'],
$this->container,
$this->container['files'],
$this->getConfigure('ray')
);
}
Expand All @@ -56,7 +56,7 @@ protected function createNoneDriver(): AspectDriverInterface
*/
public function getDefaultDriver()
{
return $this->app['config']->get('ytake-laravel-aop.aspect.default');
return $this->container['config']->get('ytake-laravel-aop.aspect.default');
}

/**
Expand All @@ -66,8 +66,8 @@ public function getDefaultDriver()
*/
protected function getConfigure(string $driver): array
{
$aspectConfigure = $this->app['config']->get('ytake-laravel-aop.aspect.drivers');
$aspectConfigure[$driver]['modules'] = $this->app['config']->get('ytake-laravel-aop.aspect.modules', []);
$aspectConfigure = $this->container['config']->get('ytake-laravel-aop.aspect.drivers');
$aspectConfigure[$driver]['modules'] = $this->container['config']->get('ytake-laravel-aop.aspect.modules', []);

return $aspectConfigure[$driver];
}
Expand Down
2 changes: 1 addition & 1 deletion src/AspectServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*
* Copyright (c) 2015-2018 Yuuki Takezawa
* Copyright (c) 2015-2020 Yuuki Takezawa
*
*/

Expand Down
4 changes: 2 additions & 2 deletions src/Console/ClearCacheCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*
* Copyright (c) 2015-2018 Yuuki Takezawa
* Copyright (c) 2015-2020 Yuuki Takezawa
*
*/

Expand Down Expand Up @@ -54,7 +54,7 @@ public function __construct(ConfigRepository $config, Filesystem $filesystem)
/**
* @return void
*/
public function handle()
public function handle(): void
{
$configure = $this->config->get('ytake-laravel-aop.aspect');
$driverConfig = $configure['drivers'][$configure['default']];
Expand Down
4 changes: 2 additions & 2 deletions src/Console/CompileCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*
* Copyright (c) 2015-2018 Yuuki Takezawa
* Copyright (c) 2015-2020 Yuuki Takezawa
*
*/

Expand Down Expand Up @@ -50,7 +50,7 @@ public function __construct(AspectManager $aspectManager)
/**
* @return void
*/
public function handle()
public function handle(): void
{
$this->aspectManager->weave();
$this->info('class files compiled!');
Expand Down
4 changes: 2 additions & 2 deletions src/Console/ModulePublishCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*
* Copyright (c) 2015-2018 Yuuki Takezawa
* Copyright (c) 2015-2020 Yuuki Takezawa
*
*/

Expand Down Expand Up @@ -73,7 +73,7 @@ public function __construct(Filesystem $filesystem)
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
* @throws \ReflectionException
*/
public function handle()
public function handle(): void
{
foreach ($this->modules as $className => $module) {
$path = $this->getPath($this->parseClassName($className, $this->argument('module_dir')));
Expand Down
Loading

0 comments on commit ce78a13

Please sign in to comment.