Skip to content

Fixes https://github.com/Setono/meta-conversions-api-php-sdk/issues/6 #95

Fixes https://github.com/Setono/meta-conversions-api-php-sdk/issues/6

Fixes https://github.com/Setono/meta-conversions-api-php-sdk/issues/6 #95

Triggered via push April 14, 2025 11:48
Status Failure
Total duration 1m 35s
Artifacts

build.yaml

on: push
Matrix: Code Coverage
Matrix: Coding Standards
Matrix: Dependency Analysis
Matrix: Mutation tests
Matrix: Static Code Analysis
Matrix: Unit tests
Fit to window
Zoom out
Zoom in

Annotations

24 errors and 10 warnings
Dependency Analysis (8.2, highest)
Process completed with exit code 255.
Unit tests (8.2, lowest)
Process completed with exit code 255.
Dependency Analysis (8.1, lowest)
The job was canceled because "_8_2_highest" failed.
Dependency Analysis (8.3, highest)
The job was canceled because "_8_2_highest" failed.
Dependency Analysis (8.3, lowest)
The job was canceled because "_8_2_highest" failed.
MethodSignatureMismatch: tests/Client/ClientTest.php#L90
tests/Client/ClientTest.php:90:52: MethodSignatureMismatch: Argument 2 of Setono\MetaConversionsApi\Client\TestLogger::log has wrong type 'Stringable|string', expecting '' as defined by Psr\Log\LoggerInterface::log (see https://psalm.dev/042)
RedundantCastGivenDocblockType: tests/Client/ClientTest.php#L92
tests/Client/ClientTest.php:92:20: RedundantCastGivenDocblockType: Redundant cast to string given docblock-provided type (see https://psalm.dev/263)
Static Code Analysis (8.3, lowest)
Process completed with exit code 2.
Dependency Analysis (8.2, lowest)
The job was canceled because "_8_2_highest" failed.
Unit tests (8.3, lowest)
The job was canceled because "_8_2_lowest" failed.
Unit tests (8.3, lowest)
Process completed with exit code 255.
Unit tests (8.2, highest)
The job was canceled because "_8_2_lowest" failed.
Coding Standards (8.1, highest)
Process completed with exit code 1.
Static Code Analysis (8.1, lowest)
The job was canceled because "_8_3_lowest" failed.
MethodSignatureMismatch: tests/Client/ClientTest.php#L90
tests/Client/ClientTest.php:90:52: MethodSignatureMismatch: Argument 2 of Setono\MetaConversionsApi\Client\TestLogger::log has wrong type 'Stringable|string', expecting '' as defined by Psr\Log\LoggerInterface::log (see https://psalm.dev/042)
RedundantCastGivenDocblockType: tests/Client/ClientTest.php#L92
tests/Client/ClientTest.php:92:20: RedundantCastGivenDocblockType: Redundant cast to string given docblock-provided type (see https://psalm.dev/263)
Static Code Analysis (8.1, lowest)
The operation was canceled.
Static Code Analysis (8.2, highest)
The job was canceled because "_8_3_lowest" failed.
Static Code Analysis (8.2, lowest)
The job was canceled because "_8_3_lowest" failed.
MethodSignatureMismatch: tests/Client/ClientTest.php#L90
tests/Client/ClientTest.php:90:52: MethodSignatureMismatch: Argument 2 of Setono\MetaConversionsApi\Client\TestLogger::log has wrong type 'Stringable|string', expecting '' as defined by Psr\Log\LoggerInterface::log (see https://psalm.dev/042)
RedundantCastGivenDocblockType: tests/Client/ClientTest.php#L92
tests/Client/ClientTest.php:92:20: RedundantCastGivenDocblockType: Redundant cast to string given docblock-provided type (see https://psalm.dev/263)
Static Code Analysis (8.2, lowest)
The operation was canceled.
Dependency Analysis (8.1, highest)
The job was canceled because "_8_2_highest" failed.
Unit tests (8.1, lowest)
The job was canceled because "_8_2_lowest" failed.
Mutation tests (8.3, highest): src/Client/Client.php#L51
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ $requestFactory = $this->getRequestFactory(); $data = json_encode([$event->getPayload()], \JSON_THROW_ON_ERROR); foreach ($event->pixels as $pixel) { - $body = ['access_token' => $pixel->accessToken, 'data' => $data]; + $body = ['data' => $data]; if (null !== $event->testEventCode) { $body['test_event_code'] = $event->testEventCode; }
Mutation tests (8.3, highest): src/Client/Client.php#L56
Escaped Mutant for Mutator "NotIdentical": --- Original +++ New @@ @@ $data = json_encode([$event->getPayload()], \JSON_THROW_ON_ERROR); foreach ($event->pixels as $pixel) { $body = ['access_token' => $pixel->accessToken, 'data' => $data]; - if (null !== $event->testEventCode) { + if (null === $event->testEventCode) { $body['test_event_code'] = $event->testEventCode; } $request = $requestFactory->createRequest('POST', sprintf('https://graph.facebook.com/%s/%s/events', sprintf('v%s', ApiConfig::APIVersion), $pixel->id))->withHeader('Content-Type', 'application/x-www-form-urlencoded')->withHeader('Accept', 'application/json')->withBody($this->getStreamFactory()->createStream(http_build_query($body)));
Mutation tests (8.3, highest): src/Event/Content.php#L44
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ */ protected static function getNormalizedFields() : array { - return ['delivery_category']; + return []; } }
Mutation tests (8.3, highest): src/Event/Custom.php#L49
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ public array $customProperties = []; protected function getMapping(string $context) : array { - return array_merge($this->customProperties, ['content_category' => $this->contentCategory, 'content_ids' => $this->contentIds, 'content_name' => $this->contentName, 'content_type' => $this->contentType, 'contents' => $this->contents, 'currency' => $this->currency, 'delivery_category' => $this->deliveryCategory, 'num_items' => $this->numItems, 'order_id' => $this->orderId, 'predicted_ltv' => $this->predictedLtv, 'search_string' => $this->searchString, 'status' => $this->status, 'value' => $this->value]); + return array_merge($this->customProperties, ['content_ids' => $this->contentIds, 'content_name' => $this->contentName, 'content_type' => $this->contentType, 'contents' => $this->contents, 'currency' => $this->currency, 'delivery_category' => $this->deliveryCategory, 'num_items' => $this->numItems, 'order_id' => $this->orderId, 'predicted_ltv' => $this->predictedLtv, 'search_string' => $this->searchString, 'status' => $this->status, 'value' => $this->value]); } /** * @see \FacebookAds\Object\ServerSide\CustomData::normalize
Mutation tests (8.3, highest): src/Event/Event.php#L112
Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ { // We set the event id by default because of deduplication // See https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/server-event#event-id - $this->eventId = bin2hex(random_bytes(16)); + $this->eventId = bin2hex(random_bytes(15)); $this->eventName = $eventName; $this->eventTime = time(); $this->userData = new User();
Mutation tests (8.3, highest): src/Event/Event.php#L112
Escaped Mutant for Mutator "IncrementInteger": --- Original +++ New @@ @@ { // We set the event id by default because of deduplication // See https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/server-event#event-id - $this->eventId = bin2hex(random_bytes(16)); + $this->eventId = bin2hex(random_bytes(17)); $this->eventName = $eventName; $this->eventTime = time(); $this->userData = new User();
Mutation tests (8.3, highest): src/Event/Event.php#L143
Escaped Mutant for Mutator "PublicVisibility": --- Original +++ New @@ @@ /** * @return list<string> */ - public static function getEvents() : array + protected static function getEvents() : array { return [self::EVENT_ADD_TO_CART, self::EVENT_ADD_PAYMENT_INFO, self::EVENT_ADD_TO_WISHLIST, self::EVENT_COMPLETE_REGISTRATION, self::EVENT_CONTACT, self::EVENT_CUSTOMIZE_PRODUCT, self::EVENT_DONATE, self::EVENT_FIND_LOCATION, self::EVENT_INITIATE_CHECKOUT, self::EVENT_LEAD, self::EVENT_PURCHASE, self::EVENT_SCHEDULE, self::EVENT_SEARCH, self::EVENT_START_TRIAL, self::EVENT_SUBMIT_APPLICATION, self::EVENT_SUBSCRIBE, self::EVENT_VIEW_CONTENT]; }
Mutation tests (8.3, highest): src/Event/Event.php#L145
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ */ public static function getEvents() : array { - return [self::EVENT_ADD_TO_CART, self::EVENT_ADD_PAYMENT_INFO, self::EVENT_ADD_TO_WISHLIST, self::EVENT_COMPLETE_REGISTRATION, self::EVENT_CONTACT, self::EVENT_CUSTOMIZE_PRODUCT, self::EVENT_DONATE, self::EVENT_FIND_LOCATION, self::EVENT_INITIATE_CHECKOUT, self::EVENT_LEAD, self::EVENT_PURCHASE, self::EVENT_SCHEDULE, self::EVENT_SEARCH, self::EVENT_START_TRIAL, self::EVENT_SUBMIT_APPLICATION, self::EVENT_SUBSCRIBE, self::EVENT_VIEW_CONTENT]; + return [self::EVENT_ADD_PAYMENT_INFO, self::EVENT_ADD_TO_WISHLIST, self::EVENT_COMPLETE_REGISTRATION, self::EVENT_CONTACT, self::EVENT_CUSTOMIZE_PRODUCT, self::EVENT_DONATE, self::EVENT_FIND_LOCATION, self::EVENT_INITIATE_CHECKOUT, self::EVENT_LEAD, self::EVENT_PURCHASE, self::EVENT_SCHEDULE, self::EVENT_SEARCH, self::EVENT_START_TRIAL, self::EVENT_SUBMIT_APPLICATION, self::EVENT_SUBSCRIBE, self::EVENT_VIEW_CONTENT]; } protected function getMapping(string $context) : array {
Mutation tests (8.3, highest): src/Event/Event.php#L188
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ */ protected static function getNormalizedFields() : array { - return ['action_source']; + return []; } }
Mutation tests (8.3, highest): src/Event/Parameters.php#L24
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ public function getPayload(string $context = self::PAYLOAD_CONTEXT_SERVER) : array { $payload = self::normalize($this->getMapping($context)); - Assert::isArray($payload); + return $payload; } /**