Skip to content

Commit

Permalink
Fixed StyleCI config
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Aug 3, 2020
1 parent db6e1dd commit 6779e4c
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 19 deletions.
9 changes: 7 additions & 2 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
preset: psr12

enabled:
- symfony_braces

disabled:
- const_visibility_required
- psr12_braces

finder:
not-name:
- MethodWithHHVMReturnType.php
- MockingParameterAndReturnTypesTest.php
- SemiReservedWordsAsMethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,7 @@ private function getOriginalParameters($code, Method $method)
}

$groupMatches = end($parameterMatches);
$parameterNames = is_array($groupMatches) ?
$groupMatches :
array($groupMatches);
$parameterNames = is_array($groupMatches) ? $groupMatches : [$groupMatches];

return $parameterNames;
}
Expand Down
1 change: 0 additions & 1 deletion library/Mockery/Matcher/MultiArgumentClosure.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

class MultiArgumentClosure extends MatcherAbstract implements ArgumentListMatcher
{

/**
* Check if the actual value matches the expected.
* Actual passed by reference to preserve reference trail (where applicable)
Expand Down
2 changes: 1 addition & 1 deletion tests/Mockery/Fixtures/SemiReservedWordsAsMethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Mockery\Fixtures;

class SemiReservedWordsAsMethods
class SemiReservedWordsAsMethods
{
function callable() {}
function class() {}
Expand Down
44 changes: 32 additions & 12 deletions tests/PHP70/MockingParameterAndReturnTypesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function testIgnoringMissingReturnsType()
$this->assertSame('', $mock->returnString());
$this->assertSame(0, $mock->returnInteger());
$this->assertSame(0.0, $mock->returnFloat());
$this->assertFalse( $mock->returnBoolean());
$this->assertFalse($mock->returnBoolean());
$this->assertSame([], $mock->returnArray());
$this->assertTrue(is_callable($mock->returnCallable()));
$this->assertInstanceOf('\Generator', $mock->returnGenerator());
Expand Down Expand Up @@ -150,31 +150,51 @@ public function __isset(string $property)

class MagicReturns
{
public function __isset($property) : bool
public function __isset($property): bool
{
return false;
}
}

abstract class TestWithParameterAndReturnType
{
public function returnString(): string {}
public function returnString(): string
{
}

public function returnInteger(): int {}
public function returnInteger(): int
{
}

public function returnFloat(): float {}
public function returnFloat(): float
{
}

public function returnBoolean(): bool {}
public function returnBoolean(): bool
{
}

public function returnArray(): array {}
public function returnArray(): array
{
}

public function returnCallable(): callable {}
public function returnCallable(): callable
{
}

public function returnGenerator(): \Generator {}
public function returnGenerator(): \Generator
{
}

public function withClassReturnType(): TestWithParameterAndReturnType {}
public function withClassReturnType(): TestWithParameterAndReturnType
{
}

public function withScalarParameters(int $integer, float $float, bool $boolean, string $string) {}
public function withScalarParameters(int $integer, float $float, bool $boolean, string $string)
{
}

public function returnSelf(): self {}
public function returnSelf(): self
{
}
}

0 comments on commit 6779e4c

Please sign in to comment.