Skip to content

Commit

Permalink
Rename repository, namespace and service
Browse files Browse the repository at this point in the history
  • Loading branch information
steevanb committed May 11, 2019
1 parent 4cdba5b commit 9284d31
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ You can compare results between Apache Bench and Siege, PHP 5.6 to 7.3 and versi

## What is this repository?

It's data for [JSON serializer hello world](http://www.phpbenchmarks.com/en/documentation/benchmark/json-serializer-hello-world) benchmark.
It's data for [JSON serialization hello world](http://www.phpbenchmarks.com/en/documentation/benchmark/json-serialization-hello-world) benchmark.

You can find how we benchmark it [here](http://www.phpbenchmarks.com/en/benchmark-protocol).

## How to use it?

You will need this repository for JSON serializer hello world benchmark.
You will need this repository for JSON serialization of "Hello world" benchmark.

You can retrieve data to serialize with `PhpBenchmarks\BenchmarkJsonSerializerHelloWorld\JsonSerializerHelloWorld::getDataToSerialize()`.
You can retrieve data to serialize with `PhpBenchmarks\BenchmarkJsonSerializationHelloWorld\BenchmarkService::getDataToSerialize()`.

As serialization don't need to write anything to response body,
when we validate your serialization we add a parameter into query string
to indicate you need to write serialization result into response body.

Use `PhpBenchmarks\JsonSerializerHelloWorld\BenchmarkJsonSerializerHelloWorld::isWriteToResponseBody()` to know if you have to do it or not.
Use `PhpBenchmarks\BenchmarkJsonSerializationHelloWorld\BenchmarkService::isWriteToResponseBody()` to know if you have to do it or not.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "phpbenchmarks/benchmark-json-serializer-hello-world",
"description": "Data for JSON serializer hello world benchmark on phpbenchmarks.com",
"name": "phpbenchmarks/benchmark-json-serialization-hello-world",
"description": "Data for JSON serialization of Hello world benchmark on phpbenchmarks.com.",
"license": "proprietary",
"type": "project",
"autoload": {
"psr-4": {
"PhpBenchmarks\\BenchmarkJsonSerializerHelloWorld\\": "src/"
"PhpBenchmarks\\BenchmarkJsonSerializationHelloWorld\\": "src/"
}
},
"require": {
Expand Down
6 changes: 4 additions & 2 deletions src/JsonSerializerHelloWorld.php → src/BenchmarkService.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<?php

namespace PhpBenchmarks\BenchmarkJsonSerializerHelloWorld;
namespace PhpBenchmarks\BenchmarkJsonSerializationHelloWorld;

class JsonSerializerHelloWorld
class BenchmarkService
{
/** @return array */
public static function getDataToSerialize()
{
return ['Hello World !'];
}

/** @return bool */
public static function isWriteToResponseBody()
{
return @$_GET['phpBenchmarksShowResults'] === '1';
Expand Down

0 comments on commit 9284d31

Please sign in to comment.