Skip to content

Commit d2ac5cc

Browse files
Ocramiusguilhermeblanco
authored andcommitted
Static analysis fixes as reported by scrutinizer-ci
1 parent 876e0d7 commit d2ac5cc

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

lib/Doctrine/ORM/Configuration.php

+5-13
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,8 @@ public function setProxyDir(string $directory) : void
162162
*
163163
* @param boolean|int $autoGenerate Possible values are constants of Doctrine\ORM\Proxy\Factory\ProxyFactory.
164164
* True is converted to AUTOGENERATE_ALWAYS, false to AUTOGENERATE_NEVER.
165-
*
166-
* @return void
167165
*/
168-
public function setAutoGenerateProxyClasses($autoGenerate)
166+
public function setAutoGenerateProxyClasses($autoGenerate) : void
169167
{
170168
$proxyManagerConfig = $this->getProxyManagerConfiguration();
171169

@@ -432,10 +430,8 @@ public function getCustomStringFunction(string $functionName)
432430
* Any previously added string functions are discarded.
433431
*
434432
* @param array $functions The map of custom DQL string functions.
435-
*
436-
* @return void
437433
*/
438-
public function setCustomStringFunctions(array $functions)
434+
public function setCustomStringFunctions(array $functions) : void
439435
{
440436
foreach ($functions as $name => $className) {
441437
$this->addCustomStringFunction($name, $className);
@@ -500,11 +496,9 @@ public function addCustomDatetimeFunction(string $functionName, $classNameOrFact
500496
/**
501497
* Gets the implementation class name of a registered custom date/time DQL function.
502498
*
503-
* @param string $name
504-
*
505-
* @return string|null
499+
* @return string|callable|null
506500
*/
507-
public function getCustomDatetimeFunction($functionName)
501+
public function getCustomDatetimeFunction(string $functionName)
508502
{
509503
return $this->customDatetimeFunctions[\strtolower($functionName)] ?? null;
510504
}
@@ -518,10 +512,8 @@ public function getCustomDatetimeFunction($functionName)
518512
* Any previously added date/time functions are discarded.
519513
*
520514
* @param array $functions The map of custom DQL date/time functions.
521-
*
522-
* @return void
523515
*/
524-
public function setCustomDatetimeFunctions(array $functions)
516+
public function setCustomDatetimeFunctions(array $functions) : void
525517
{
526518
foreach ($functions as $name => $className) {
527519
$this->addCustomDatetimeFunction($name, $className);

lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Doctrine\ORM\Mapping\Driver;
66

77
use Doctrine\Common\Annotations\AnnotationReader;
8+
use Doctrine\Common\Annotations\Reader;
89
use Doctrine\DBAL\Types\Type;
910
use Doctrine\ORM\Annotation;
1011
use Doctrine\ORM\Events;
@@ -68,10 +69,10 @@ class AnnotationDriver implements MappingDriver
6869
* Initializes a new AnnotationDriver that uses the given AnnotationReader for reading
6970
* docblock annotations.
7071
*
71-
* @param AnnotationReader $reader The AnnotationReader to use, duck-typed.
72+
* @param Reader $reader The AnnotationReader to use, duck-typed.
7273
* @param string|array|null $paths One or multiple paths where mapping classes can be found.
7374
*/
74-
public function __construct($reader, $paths = null)
75+
public function __construct(Reader $reader, $paths = null)
7576
{
7677
$this->reader = $reader;
7778
if ($paths) {

0 commit comments

Comments
 (0)