Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI #633

Merged
merged 3 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
->setRiskyAllowed(false)
->setRules([
'@PER-CS' => true,
'array_syntax' => false,
'braces_position' => [
'control_structures_opening_brace' => 'same_line',
],
Expand Down
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ parameters:
count: 2
path: src/Prophecy/Argument/Token/ExactValueToken.php

-
message: "#^Method Prophecy\\\\Call\\\\CallCenter\\:\\:indentArguments\\(\\) should return array\\<string\\> but returns array\\<string\\>\\|null\\.$#"
count: 1
path: src/Prophecy/Call/CallCenter.php

-
message: "#^Method Prophecy\\\\Doubler\\\\CachedDoubler\\:\\:createDoubleClass\\(\\) should return class\\-string\\<Prophecy\\\\Doubler\\\\DoubleInterface&T of object\\> but returns class\\-string\\.$#"
count: 1
Expand Down
1 change: 0 additions & 1 deletion spec/Prophecy/Prediction/CallbackPredictionSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace spec\Prophecy\Prediction;

use PhpSpec\ObjectBehavior;

use Prophecy\Call\Call;
use Prophecy\Prophecy\MethodProphecy;
use Prophecy\Prophecy\ObjectProphecy;
Expand Down
4 changes: 2 additions & 2 deletions src/Prophecy/Doubler/ClassPatch/MagicCallPatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ public function apply(ClassNode $node)
if (in_array($methodName, self::MAGIC_METHODS_WITH_ARGUMENTS)) {
if (method_exists($tag, 'getParameters')) {
// Reflection Docblock 5.4.0+.
foreach($tag->getParameters() as $argument) {
foreach ($tag->getParameters() as $argument) {
$argumentNode = new ArgumentNode($argument->getName());
$methodNode->addArgument($argumentNode);
}
} else {
// Reflection Docblock < 5.4.0.
foreach($tag->getArguments() as $argument) {
foreach ($tag->getArguments() as $argument) {
$argumentNode = new ArgumentNode($argument['name']);
$methodNode->addArgument($argumentNode);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Prophecy/Doubler/Generator/ClassMirror.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ private function getTypeHints(?ReflectionType $type, ReflectionClass $class, boo
}
} elseif ($type instanceof ReflectionIntersectionType) {
throw new ClassMirrorException('Doubling intersection types is not supported', $class);
} elseif(is_object($type)) {
} elseif (is_object($type)) {
throw new ClassMirrorException('Unknown reflection type '.get_class($type), $class);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private function getInterfacesTagList(\ReflectionClass $reflectionClass)
$interfaces = $reflectionClass->getInterfaces();
$tagList = array();

foreach($interfaces as $interface) {
foreach ($interfaces as $interface) {
$tagList = array_merge($tagList, $this->classRetriever->getTagList($interface));
}

Expand Down
4 changes: 2 additions & 2 deletions src/Prophecy/Prophecy/MethodProphecy.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ static function (string $type1, string $type2) {
return class_exists($type) || interface_exists($type);
};

if($isObject($type1) && !$isObject($type2)) {
if ($isObject($type1) && !$isObject($type2)) {
return -1;
} elseif(!$isObject($type1) && $isObject($type2)) {
} elseif (!$isObject($type1) && $isObject($type2)) {
return 1;
}

Expand Down