Skip to content

Commit

Permalink
Merge pull request #1449 from les-enovateurs/fix_release
Browse files Browse the repository at this point in the history
Fix error Psalm - Calling empty on a boolean value is almost certainly unintended
  • Loading branch information
Jeckerson authored Apr 11, 2020
2 parents 18dd7c3 + 39fc3fd commit 9845d60
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/Builder/Component/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,11 @@ public function build(): void

foreach ($reflection->getProperties() as $property) {
$propertyName = $property->getName();
/** @var null|string $possibleFieldsValue */
$possibleFieldsValue = $possibleFieldsTransformed[$propertyName];

if ($property->getDeclaringClass()->getName() != $fullClassName ||
!empty($possibleFieldsTransformed[$propertyName])) {
!empty($possibleFieldsValue)) {
continue;
}

Expand Down
10 changes: 8 additions & 2 deletions src/Builder/Path.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,20 @@ public function getConfig($type = null): Config
throw new BuilderException("Builder can't locate the configuration file");
}

public function setRootPath($path)
/**
* @param null|string $path
*/
public function setRootPath(?string $path = null)
{
$this->rootPath = rtrim(str_replace('/', DIRECTORY_SEPARATOR, $path), '\\/') . DIRECTORY_SEPARATOR;

return $this;
}

public function getRootPath($path = null): string
/**
* @param null|string $path
*/
public function getRootPath(?string $path = null): string
{
return $this->rootPath . ($path ? trim($path, '\\/') . DIRECTORY_SEPARATOR : '');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Generator/Snippet.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public function getMigrationBatchDelete($table)
return sprintf($template, $table);
}

public function getMigrationDefinition($name, $definition)
public function getMigrationDefinition(string $name, $definition)
{
$template = <<<EOD
'%s' => [
Expand Down

0 comments on commit 9845d60

Please sign in to comment.