Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
Merge pull request #11 from LaraChimp/feature/laravel-8-support
Browse files Browse the repository at this point in the history
Added support for Laravel 8
  • Loading branch information
percymamedy authored Sep 15, 2021
2 parents 5e4ecb8 + aa566a2 commit 066a83b
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 56 deletions.
3 changes: 0 additions & 3 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
preset: laravel

disabled:
- simplified_null_return
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ env:
matrix:
fast_finish: true
include:
- php: 7.2
- php: 7.2
env: SETUP=lowest
- php: 7.3
- php: 7.3
env: SETUP=lowest
- php: 7.4snapshot
- php: 7.4snapshot
- php: 7.4
- php: 7.4
env: SETUP=lowest
- php: 8.0
- php: 8.0
env: SETUP=lowest

cache:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Pine Annotations is open-sourced software licensed under the [MIT license](http:
5.x.x | 0.x
6.x | 1.x
7.x | 2.x
8.x | 3.x

### Installation

Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
}
],
"require": {
"php": "^7.2",
"php": "^7.3|^8.0",
"doctrine/annotations": "^1.7",
"doctrine/cache": "^1.8",
"illuminate/support": "^7.0",
"illuminate/support": "^8.0",
"symfony/finder": "^5.0"
},
"require-dev": {
"mockery/mockery": "^1.3.1",
"orchestra/testbench": "^5.0",
"phpunit/phpunit": "^8.4|^9.0"
"mockery/mockery": "^1.4.2",
"orchestra/testbench": "^6.0",
"phpunit/phpunit": "^9.3.3"
},
"autoload": {
"psr-4": {
Expand Down
5 changes: 2 additions & 3 deletions src/Concerns/NamespaceToPathConvertable.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ trait NamespaceToPathConvertable
/**
* Convert the given namespace to a file path.
*
* @param string $namespace
* @param string $base
*
* @param string $namespace
* @param string $base
* @return string
*/
public function getPathFromNamespace($namespace, $base = null)
Expand Down
20 changes: 8 additions & 12 deletions src/Doctrine/Cache/LaravelCacheDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class LaravelCacheDriver extends CacheProvider
/**
* LaravelCacheDriver constructor.
*
* @param LaravelCache $cache
* @param LaravelCache $cache
*/
public function __construct(LaravelCache $cache)
{
Expand All @@ -37,8 +37,7 @@ public function getCache()
/**
* Fetches an entry from the cache.
*
* @param string $id The id of the cache entry to fetch.
*
* @param string $id The id of the cache entry to fetch.
* @return mixed|false The cached data or FALSE, if no cache entry exists for the given id.
*/
protected function doFetch($id)
Expand All @@ -49,8 +48,7 @@ protected function doFetch($id)
/**
* Tests if an entry exists in the cache.
*
* @param string $id The cache id of the entry to check for.
*
* @param string $id The cache id of the entry to check for.
* @return bool TRUE if a cache entry exists for the given cache id, FALSE otherwise.
*/
protected function doContains($id)
Expand All @@ -61,11 +59,10 @@ protected function doContains($id)
/**
* Puts data into the cache.
*
* @param string $id The cache id.
* @param string $data The cache entry/data.
* @param int $lifeTime The lifetime. If != 0, sets a specific lifetime for this
* cache entry (0 => infinite lifeTime).
*
* @param string $id The cache id.
* @param string $data The cache entry/data.
* @param int $lifeTime The lifetime. If != 0, sets a specific lifetime for this
* cache entry (0 => infinite lifeTime).
* @return bool TRUE if the entry was successfully stored in the cache, FALSE otherwise.
*/
protected function doSave($id, $data, $lifeTime = 0)
Expand All @@ -84,8 +81,7 @@ protected function doSave($id, $data, $lifeTime = 0)
/**
* Deletes a cache entry.
*
* @param string $id The cache id.
*
* @param string $id The cache id.
* @return bool TRUE if the cache entry was successfully deleted, FALSE otherwise.
*/
protected function doDelete($id)
Expand Down
38 changes: 14 additions & 24 deletions src/Support/Reader/AnnotationsReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class AnnotationsReader
/**
* Reader constructor.
*
* @param Reader $reader
* @param Reader $reader
*/
public function __construct(Reader $reader)
{
Expand All @@ -69,9 +69,8 @@ public function getReader()
* Which type of annotation should the reader target.
* The default is class.
*
* @param string $target
* @param string $keyName
*
* @param string $target
* @param string $keyName
* @return self
*/
public function target($target, $keyName = null)
Expand All @@ -85,8 +84,7 @@ public function target($target, $keyName = null)
/**
* The annotation name if any to target.
*
* @param string $annotationName
*
* @param string $annotationName
* @return $this
*/
public function only($annotationName)
Expand All @@ -99,8 +97,7 @@ public function only($annotationName)
/**
* Reads annotations for a given object.
*
* @param mixed $argument
*
* @param mixed $argument
* @return \Illuminate\Support\Collection
*/
public function read($argument)
Expand All @@ -120,8 +117,7 @@ public function read($argument)
/**
* Adds files containing annotations to the registry.
*
* @param array|string $filePaths
*
* @param array|string $filePaths
* @return self
*/
public function addFilesToRegistry($filePaths)
Expand All @@ -138,8 +134,7 @@ public function addFilesToRegistry($filePaths)
/**
* Adds namespaces containing annotations to the registry.
*
* @param array|string $namespaces
*
* @param array|string $namespaces
* @return $this
*/
public function addNamespacesToRegistry($namespaces)
Expand All @@ -162,8 +157,7 @@ public function addNamespacesToRegistry($namespaces)
/**
* Reads all the annotations for the given target.
*
* @param ReflectionClass|ReflectionProperty|ReflectionMethod $reflection
*
* @param ReflectionClass|ReflectionProperty|ReflectionMethod $reflection
* @return \Illuminate\Support\Collection
*/
protected function readAllAnnotationsFor($reflection)
Expand All @@ -178,8 +172,7 @@ protected function readAllAnnotationsFor($reflection)
/**
* Reads the specified annotation name given for the target.
*
* @param ReflectionClass|ReflectionProperty|ReflectionMethod $reflection
*
* @param ReflectionClass|ReflectionProperty|ReflectionMethod $reflection
* @return \Illuminate\Support\Collection
*/
protected function readSpecificAnnotationFor($reflection)
Expand All @@ -195,8 +188,7 @@ protected function readSpecificAnnotationFor($reflection)
* Get the ReflectionClass from an argument.
* be it an object or a class name.
*
* @param mixed $argument
*
* @param mixed $argument
* @return ReflectionClass|ReflectionMethod|ReflectionProperty
*/
protected function getReflectionFrom($argument)
Expand All @@ -211,9 +203,9 @@ protected function getReflectionFrom($argument)
/**
* Get the ReflectionClass for a given argument.
*
* @param mixed $argument
*
* @param mixed $argument
* @return ReflectionClass
*
* @throws \ReflectionException
*/
protected function getReflectionClassFrom($argument)
Expand All @@ -230,8 +222,7 @@ protected function getReflectionClassFrom($argument)
/**
* Get the ReflectionProperty for a given argument.
*
* @param mixed $argument
*
* @param mixed $argument
* @return ReflectionProperty
*
* @throws InvalidArgumentException
Expand All @@ -256,8 +247,7 @@ protected function getReflectionPropertyFrom($argument)
/**
* Get the ReflectionMethod for a given argument.
*
* @param mixed $argument
*
* @param mixed $argument
* @return ReflectionMethod
*
* @throws \ReflectionException
Expand Down
3 changes: 1 addition & 2 deletions tests/AbstractTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ abstract class AbstractTestCase extends TestCase
/**
* Get package providers.
*
* @param \Illuminate\Foundation\Application $app
*
* @param \Illuminate\Foundation\Application $app
* @return array
*/
protected function getPackageProviders($app)
Expand Down
1 change: 1 addition & 0 deletions tests/Fixtures/Annotations/FooAnnotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class FooAnnotation
* Some annotation property.
*
* @Required
*
* @var string
*/
public $bar;
Expand Down
1 change: 1 addition & 0 deletions tests/Fixtures/Annotations/FooDoubleAnnotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class FooDoubleAnnotation
* Some annotation property.
*
* @Required
*
* @var string
*/
public $bar;
Expand Down
1 change: 1 addition & 0 deletions tests/Fixtures/Annotations/MethodAnnotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class MethodAnnotation
* Some annotation property.
*
* @Required
*
* @var string
*/
public $bar;
Expand Down
1 change: 1 addition & 0 deletions tests/Fixtures/Annotations/MethodDoubleAnnotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class MethodDoubleAnnotation
* Some annotation property.
*
* @Required
*
* @var string
*/
public $bar;
Expand Down
1 change: 1 addition & 0 deletions tests/Fixtures/Annotations/PropertyAnnotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class PropertyAnnotation
* Some annotation property.
*
* @Required
*
* @var string
*/
public $bar;
Expand Down
1 change: 1 addition & 0 deletions tests/Fixtures/Annotations/PropertyDoubleAnnotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class PropertyDoubleAnnotation
* Some annotation property.
*
* @Required
*
* @var string
*/
public $bar;
Expand Down
3 changes: 1 addition & 2 deletions tests/Fixtures/Baz.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ public function someMethod()
/**
* Sets name.
*
* @param string $name
*
* @param string $name
* @return self
*/
public function setName($name)
Expand Down

0 comments on commit 066a83b

Please sign in to comment.