Skip to content

Commit

Permalink
Fix some phpstan errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mrook committed Nov 8, 2021
1 parent b013812 commit 3f90574
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Phing/Io/XmlFileParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private function getProperties(File $file)

$prefix = implode('.', $path);

if (!empty($prefix)) {
if (count($prefix) > 0) {
$prefix .= '.';
}

Expand Down
4 changes: 2 additions & 2 deletions src/Phing/Target.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ public function getTasks()
* Set the if-condition from the XML tag, if any. The property name given
* as parameter must be present so the if condition evaluates to true.
*
* @param string $property The property name that has to be present
* @param string|null $property The property name that has to be present
*/
public function setIf($property)
{
Expand All @@ -335,7 +335,7 @@ public function getIf()
* given as parameter must be present so the unless condition evaluates
* to true.
*
* @param string $property The property name that has to be present
* @param string|null $property The property name that has to be present
*/
public function setUnless($property)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Phing/Task/System/SwitchTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function main()
foreach ($this->cases as $case) {
$cValue = $case->getValue();

if (empty($case)) {
if (empty($cValue)) {
throw new BuildException('Value is required for case.');
}

Expand Down
4 changes: 2 additions & 2 deletions src/Phing/Type/CommandlineMarker.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function getPosition()
/**
* Set the prefix to be placed in front of the inserted argument.
*
* @param string $prefix fixed prefix string
* @param string|null $prefix fixed prefix string
*/
public function setPrefix($prefix)
{
Expand All @@ -87,7 +87,7 @@ public function getPrefix()
/**
* Set the suffix to be placed at the end of the inserted argument.
*
* @param string $suffix fixed suffix string
* @param string|null $suffix fixed suffix string
*/
public function setSuffix($suffix)
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Phing/Task/System/ApplyTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,11 +453,11 @@ public function testMapperSupport(): void

/**
* @param mixed $value
* @param null $propertyName
* @param string|null $propertyName
*
* @throws ReflectionException
*/
protected function assertAttributeIsSetTo(string $property, $value, $propertyName = null): void
protected function assertAttributeIsSetTo(string $property, $value, string $propertyName = null): void
{
$task = $this->getConfiguredTask('testPropertySet' . ucfirst($property), ApplyTask::class);

Expand Down

0 comments on commit 3f90574

Please sign in to comment.