Skip to content

Commit 5cc64f8

Browse files
committed
cleanup
1 parent 1aec5dc commit 5cc64f8

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

example/benchmark.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace example;
44

55
error_reporting(E_ALL);
6-
ini_set('display_errors', 1);
76
date_default_timezone_set('UTC');
87
include __DIR__ . '/../vendor/autoload.php';
98

@@ -18,6 +17,7 @@
1817
use MySQLReplication\Config\ConfigService;
1918
use MySQLReplication\Definitions\ConstEventType;
2019
use MySQLReplication\Event\DTO\UpdateRowsDTO;
20+
use SebastianBergmann\RecursionContext\InvalidArgumentException;
2121

2222
/**
2323
* Class BenchmarkEventSubscribers
@@ -113,13 +113,14 @@ private function getConnection()
113113
/**
114114
* @throws MySQLReplicationException
115115
* @throws DBALException
116+
* @throws \InvalidArgumentException
116117
*/
117118
public function run()
118119
{
119120
$pid = pcntl_fork();
120121
if ($pid === -1)
121122
{
122-
die('could not fork');
123+
throw new \InvalidArgumentException('Could not fork');
123124
}
124125
else if ($pid)
125126
{
@@ -157,7 +158,6 @@ private function produce()
157158
}
158159

159160
$conn->close();
160-
die;
161161
}
162162
}
163163

example/dump_events.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace example;
44

55
error_reporting(E_ALL);
6-
ini_set('display_errors', 1);
76
date_default_timezone_set('UTC');
87
include __DIR__ . '/../vendor/autoload.php';
98

@@ -37,7 +36,7 @@ public function allEvents(EventDTO $event)
3736
echo $event;
3837

3938
// all events got JsonSerializable implementation
40-
//echo json_encode($result, JSON_PRETTY_PRINT);
39+
echo json_encode($event, JSON_PRETTY_PRINT);
4140

4241
echo 'Memory usage ' . round(memory_get_usage() / 1048576, 2) . ' MB' . PHP_EOL;
4342
}

src/MySQLReplication/BinLog/BinLogServerInfo.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace MySQLReplication\BinLog;
44

55
/**
6-
* todo ugly class, for refactoring
76
* Class BinLogServerInfo
87
* @package MySQLReplication\BinLog
98
*/

0 commit comments

Comments
 (0)