1
0
mirror of https://github.com/danog/parallel.git synced 2024-11-30 04:39:01 +01:00

Use strict types; fix tests

This commit is contained in:
Aaron Piotrowski 2016-08-21 23:40:48 -05:00
parent 193581d6c9
commit c068a5ae38
84 changed files with 90 additions and 90 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/env php
<?php
<?php declare(strict_types = 1);
use Amp\Concurrent\{ ChannelException, SerializationException} ;
use Amp\Concurrent\Sync\{ ChannelledStream, Internal\ExitFailure, Internal\ExitSuccess };

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Forking;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Process;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Process;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Sync;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Sync;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Sync;
@ -22,7 +22,7 @@ use Interop\Async\Awaitable;
* @see http://php.net/fopen
*/
class FileMutex implements Mutex {
const LATENCY_TIMEOUT = 0.01; // 10 ms
const LATENCY_TIMEOUT = 10;
/**
* @var string The full path to the lock file.

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Sync\Internal;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Sync\Internal;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Sync\Internal;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Sync;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Sync;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Sync;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Sync;
@ -15,7 +15,7 @@ use Interop\Async\Awaitable;
* Not compatible with Windows.
*/
class PosixSemaphore implements Semaphore, \Serializable {
const LATENCY_TIMEOUT = 0.01; // 10 ms
const LATENCY_TIMEOUT = 10;
/**
* @var int The semaphore key.

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Sync;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Sync;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Sync;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Threading\Internal;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Threading\Internal;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Threading\Internal;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Threading\Internal;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Threading;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Threading;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Threading;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Threading;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Worker;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Worker;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Worker;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Worker;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Worker;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Worker\Internal;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Worker\Internal;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Worker\Internal;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Worker\Internal;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Worker\Internal;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Worker\Internal;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Worker;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Worker;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Worker;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Worker;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Worker;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Worker;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Worker;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Worker;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test\Forking;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test\Stub;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test\Sync;
@ -34,7 +34,7 @@ abstract class AbstractParcelTest extends TestCase {
$awaitable = $parcel->synchronized(function ($value) {
$this->assertSame(0, $value);
usleep(1e4);
usleep(10000);
return 1;
});
@ -46,7 +46,7 @@ abstract class AbstractParcelTest extends TestCase {
$awaitable = $parcel->synchronized(function ($value) {
$this->assertSame(1, $value);
usleep(1e4);
usleep(10000);
return 2;
});

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test\Sync;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test\Sync;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test\Sync;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test\Sync;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test\Sync;
@ -62,7 +62,7 @@ class PosixSemaphoreTest extends AbstractSemaphoreTest {
$fork1 = new Fork(function (Semaphore $semaphore) {
$lock = yield $semaphore->acquire();
usleep(1e5);
usleep(100000);
$lock->release();
@ -72,7 +72,7 @@ class PosixSemaphoreTest extends AbstractSemaphoreTest {
$fork2 = new Fork(function (Semaphore $semaphore) {
$lock = yield $semaphore->acquire();
usleep(1e5);
usleep(100000);
$lock->release();

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test\Sync;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test\Threading;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test\Threading;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test\Threading;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test\Threading;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test\Worker;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test\Worker;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test\Worker;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test\Worker;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test\Worker;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test\Worker;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test\Worker;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test\Worker;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test\Worker;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test\Worker;