Skip to content

Commit

Permalink
Merge f3217e3 into e64f658
Browse files Browse the repository at this point in the history
  • Loading branch information
kletord committed Oct 5, 2017
2 parents e64f658 + f3217e3 commit c470a9d
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 10 deletions.
1 change: 0 additions & 1 deletion .coveralls.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
service_name: travis-ci
src_dir: src
coverage_clover: build/logs/clover.xml
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: php

php:
- "5.6"
- "7.0"
- "7.1"

before_script:
- composer self-update
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
}
},
"require": {
"php": ">=5.6",
"php": ">=7.0",
"doctrine/annotations": "1.2.*",
"ocramius/proxy-manager": "1.0.*",
"ocramius/proxy-manager": "~2.0",
"openclassrooms/doctrine-cache-extension": "1.0.*@dev",
"symfony/expression-language": ">=2.7 <4",
"symfony/filesystem": ">2.7 <4",
"zendframework/zend-code": "2.5.*"
"zendframework/zend-code": "~3.0"
},
"require-dev": {
"fabpot/php-cs-fixer": "1.*",
Expand Down
4 changes: 2 additions & 2 deletions src/Helpers/ServiceProxyHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ trait ServiceProxyHelper
/**
* @return ServiceProxyFactory
*/
protected function getServiceProxyFactory($cacheDir = null)
protected function getServiceProxyFactory(string $cacheDir)
{
$serviceProxyFactory = new ServiceProxyFactory();
$configuration = new Configuration();
Expand Down Expand Up @@ -68,7 +68,7 @@ private function buildCacheStrategy()
/**
* @return \OpenClassrooms\ServiceProxy\ServiceProxyBuilderInterface
*/
protected function getServiceProxyBuilder($cacheDir = null)
protected function getServiceProxyBuilder(string $cacheDir)
{
$serviceProxyBuilder = new ServiceProxyBuilder();
$configuration = new Configuration();
Expand Down
3 changes: 2 additions & 1 deletion src/Proxy/Factory/ProxyFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use OpenClassrooms\ServiceProxy\ServiceProxyInterface;
use ProxyManager\Configuration;
use ProxyManager\Factory\AbstractBaseFactory;
use ProxyManager\ProxyGenerator\ProxyGeneratorInterface;
use Symfony\Component\Filesystem\Filesystem;

/**
Expand Down Expand Up @@ -46,7 +47,7 @@ public function createProxy($instance)
/**
* {@inheritdoc}
*/
protected function getGenerator()
protected function getGenerator() : ProxyGeneratorInterface
{
return $this->generator;
}
Expand Down
5 changes: 5 additions & 0 deletions tests/Doubles/WithoutAnnotationClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public function aSetterMethod($value)
$this->field = $value;
}

public function aSetterMethodWithType(string $value): string
{
return $value;
}

/**
* @return bool
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/ServiceProxyCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function WithLifeTime_ReturnData()
public function TooLongId_WithId_ThrowException()
{
/** @var ExceptionCacheAnnotationClass $proxy */
$proxy = $this->getServiceProxyBuilder()
$proxy = $this->getServiceProxyBuilder(self::$cacheDir)
->create(new ExceptionCacheAnnotationClass())
->withCache($this->cacheProviderDecorator)
->build();
Expand Down
2 changes: 1 addition & 1 deletion tests/ServiceProxyFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ public function WithCacheAnnotationWithConstructor_ReturnServiceProxyCacheInterf
*/
protected function setUp()
{
$this->factory = $this->getServiceProxyFactory();
$this->factory = $this->getServiceProxyFactory(self::$cacheDir);
}
}

0 comments on commit c470a9d

Please sign in to comment.