Skip to content

Commit 14c624b

Browse files
authored
use contracts (#61)
* use contracts * update phpstan
1 parent ed40375 commit 14c624b

File tree

15 files changed

+375
-346
lines changed

15 files changed

+375
-346
lines changed

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"require-dev": {
3838
"friendsofphp/php-cs-fixer": "^3.3",
3939
"infection/infection": "^0.26.13",
40-
"lychee-org/phpstan-lychee": "dev-master",
40+
"lychee-org/phpstan-lychee": "^1.0.1",
4141
"php-parallel-lint/php-parallel-lint": "^1.2",
4242
"phpmd/phpmd": "^2.9",
4343
"phpunit/phpunit": "^9.5.10",
@@ -85,5 +85,6 @@
8585
"infection/extension-installer": true
8686
}
8787
},
88-
"prefer-stable": true
88+
"prefer-stable": true,
89+
"minimum-stability": "dev"
8990
}

composer.lock

Lines changed: 328 additions & 318 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/PHPExif/Adapter/AbstractAdapter.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
namespace PHPExif\Adapter;
44

5-
use PHPExif\Mapper\MapperInterface;
6-
use PHPExif\Hydrator\HydratorInterface;
75
use ForceUTF8\Encoding;
6+
use PHPExif\Contracts\AdapterInterface;
7+
use PHPExif\Contracts\HydratorInterface;
8+
use PHPExif\Contracts\MapperInterface;
89
use PHPExif\Hydrator\Mutator;
910

1011
/**
@@ -39,8 +40,8 @@ public function __construct(array $options = array())
3940
/**
4041
* Mutator for the data mapper
4142
*
42-
* @param \PHPExif\Mapper\MapperInterface $mapper
43-
* @return \PHPExif\Adapter\AdapterInterface
43+
* @param \PHPExif\Contracts\MapperInterface $mapper
44+
* @return \PHPExif\Contracts\AdapterInterface
4445
*/
4546
public function setMapper(MapperInterface $mapper) : AdapterInterface
4647
{
@@ -52,7 +53,7 @@ public function setMapper(MapperInterface $mapper) : AdapterInterface
5253
/**
5354
* Accessor for the data mapper
5455
*
55-
* @return \PHPExif\Mapper\MapperInterface
56+
* @return \PHPExif\Contracts\MapperInterface
5657
*/
5758
public function getMapper() : MapperInterface
5859
{
@@ -70,8 +71,8 @@ public function getMapper() : MapperInterface
7071
/**
7172
* Mutator for the hydrator
7273
*
73-
* @param \PHPExif\Hydrator\HydratorInterface $hydrator
74-
* @return \PHPExif\Adapter\AdapterInterface
74+
* @param \PHPExif\Contracts\HydratorInterface $hydrator
75+
* @return \PHPExif\Contracts\AdapterInterface
7576
*/
7677
public function setHydrator(HydratorInterface $hydrator) : AdapterInterface
7778
{
@@ -83,7 +84,7 @@ public function setHydrator(HydratorInterface $hydrator) : AdapterInterface
8384
/**
8485
* Accessor for the data hydrator
8586
*
86-
* @return \PHPExif\Hydrator\HydratorInterface
87+
* @return \PHPExif\Contracts\HydratorInterface
8788
*/
8889
public function getHydrator() : HydratorInterface
8990
{
@@ -102,7 +103,7 @@ public function getHydrator() : HydratorInterface
102103
* Set array of options in the current object
103104
*
104105
* @param array $options
105-
* @return \PHPExif\Adapter\AdapterInterface
106+
* @return \PHPExif\Contracts\AdapterInterface
106107
*/
107108
public function setOptions(array $options) : AdapterInterface
108109
{

lib/PHPExif/Adapter/AdapterInterface.php renamed to lib/PHPExif/Contracts/AdapterInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @codeCoverageIgnore
44
*/
55

6-
namespace PHPExif\Adapter;
6+
namespace PHPExif\Contracts;
77

88
use PHPExif\Exif;
99

lib/PHPExif/Hydrator/HydratorInterface.php renamed to lib/PHPExif/Contracts/HydratorInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @codeCoverageIgnore
44
*/
55

6-
namespace PHPExif\Hydrator;
6+
namespace PHPExif\Contracts;
77

88
/**
99
* PHP Exif Hydrator

lib/PHPExif/Mapper/MapperInterface.php renamed to lib/PHPExif/Contracts/MapperInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @codeCoverageIgnore
44
*/
55

6-
namespace PHPExif\Mapper;
6+
namespace PHPExif\Contracts;
77

88
/**
99
* PHP Exif Mapper

lib/PHPExif/Reader/ReaderInterface.php renamed to lib/PHPExif/Contracts/ReaderInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @codeCoverageIgnore
44
*/
55

6-
namespace PHPExif\Reader;
6+
namespace PHPExif\Contracts;
77

88
use PHPExif\Exif;
99

lib/PHPExif/Hydrator/Mutator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace PHPExif\Hydrator;
44

5+
use PHPExif\Contracts\HydratorInterface;
6+
57
/**
68
* PHP Exif Mutator Hydrator
79
*

lib/PHPExif/Mapper/AbstractMapper.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace PHPExif\Mapper;
44

5+
use PHPExif\Contracts\MapperInterface;
6+
57
/**
68
* PHP Exif Mapper Abstract
79
*

lib/PHPExif/Reader/Reader.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
namespace PHPExif\Reader;
44

5-
use PHPExif\Adapter\AdapterInterface;
65
use PHPExif\Adapter\NoAdapterException;
76
use PHPExif\Adapter\Exiftool as ExiftoolAdapter;
87
use PHPExif\Adapter\FFprobe as FFprobeAdapter;
98
use PHPExif\Adapter\ImageMagick as ImageMagickAdapter;
109
use PHPExif\Adapter\Native as NativeAdapter;
10+
use PHPExif\Contracts\AdapterInterface;
11+
use PHPExif\Contracts\ReaderInterface;
1112
use PHPExif\Exif;
1213
use PHPExif\Enum\ReaderType;
1314

@@ -30,7 +31,7 @@ class Reader implements ReaderInterface
3031
/**
3132
* Reader constructor
3233
*
33-
* @param \PHPExif\Adapter\AdapterInterface $adapter
34+
* @param \PHPExif\Contracts\AdapterInterface $adapter
3435
*/
3536
public function __construct(AdapterInterface $adapter)
3637
{
@@ -40,7 +41,7 @@ public function __construct(AdapterInterface $adapter)
4041
/**
4142
* Getter for the reader adapter
4243
*
43-
* @return \PHPExif\Adapter\AdapterInterface
44+
* @return \PHPExif\Contracts\AdapterInterface
4445
* @throws NoAdapterException When no adapter is set
4546
*/
4647
public function getAdapter(): AdapterInterface

0 commit comments

Comments
 (0)