Skip to content

Commit

Permalink
Merge branch '3.4.x' into 3.5.x
Browse files Browse the repository at this point in the history
* 3.4.x:
  Generate explicit nullable types for proxies
  Add doctrine-project.json to .gitattributes (#1004)
  Remove no longer needed ignore rules
  Add phpstan.neon.dist and psalm.xml to .gitattributes
  Add missing strict parameter to in_array
  • Loading branch information
derrabus committed Apr 16, 2024
2 parents c1e3356 + 0aad4b7 commit 6b266d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
tests export-ignore
.doctrine-project.json export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.github export-ignore
phpunit.xml.dist export-ignore
/phpcs.xml.dist export-ignore
/phpstan.neon.dist export-ignore
/psalm.xml export-ignore
6 changes: 3 additions & 3 deletions src/Proxy/ProxyGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public function __setInitialized($initialized): void
* {@inheritDoc}
* @internal generated method: use only when explicitly handling proxy specific loading logic
*/
public function __setInitializer(\Closure $initializer = null): void
public function __setInitializer(?\Closure $initializer = null): void
{
$this->__initializer__ = $initializer;
}
Expand All @@ -221,7 +221,7 @@ public function __getInitializer(): ?\Closure
* {@inheritDoc}
* @internal generated method: use only when explicitly handling proxy specific loading logic
*/
public function __setCloner(\Closure $cloner = null): void
public function __setCloner(?\Closure $cloner = null): void
{
$this->__cloner__ = $cloner;
}
Expand Down Expand Up @@ -942,7 +942,7 @@ private function generateMethods(ClassMetadata $class)
if ($this->isShortIdentifierGetter($method, $class)) {
$identifier = lcfirst(substr($name, 3));
$fieldType = $class->getTypeOfField($identifier);
$cast = in_array($fieldType, ['integer', 'smallint']) ? '(int) ' : '';
$cast = in_array($fieldType, ['integer', 'smallint'], true) ? '(int) ' : '';

$methods .= ' if ($this->__isInitialized__ === false) {' . "\n";
$methods .= ' ';
Expand Down

0 comments on commit 6b266d6

Please sign in to comment.