Skip to content

Commit

Permalink
Merge pull request #6 from sirn-se/v1.1
Browse files Browse the repository at this point in the history
v1.1 ready
  • Loading branch information
sirn-se committed Mar 5, 2024
2 parents 1d37592 + 6087b1c commit 4016d9f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
],
"autoload": {
"psr-4": {
"": "src/"
"Phrity\\Util\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"": "tests/"
"Phrity\\Util\\Tests\\": "tests/"
}
},
"require": {
Expand Down
12 changes: 6 additions & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">./src/</directory>
</include>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.0/phpunit.xsd">
<testsuites>
<testsuite name="Phrity Util/Accessor tests">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">./src/</directory>
</include>
</source>
</phpunit>
2 changes: 1 addition & 1 deletion src/Phrity/Util/ErrorHandler.php → src/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ public function withAll(callable $callback, $handling = null, int $levels = E_AL
$errors[] = $e;
}, $levels);
$result = $callback();
$error = empty($errors) ? null : $this->handle($handling, $errors, $result);
$this->restore();
$error = empty($errors) ? null : $this->handle($handling, $errors, $result);
return $error ?: $result;
}

Expand Down
8 changes: 0 additions & 8 deletions tests/ErrorHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ public function testSetNull(): void
$this->assertNull($e->getPrevious());
}

// Verify that exception is thrown
$this->expectException('ErrorException');
trigger_error('Another error');

// Restore handler
$this->assertTrue($handler->restore());
}
Expand All @@ -69,10 +65,6 @@ public function testSetThrowable(): void
$this->assertNull($prev->getPrevious());
}

// Verify that exception is thrown
$this->expectException('RuntimeException');
trigger_error('Another error');

// Restore handler
$this->assertTrue($handler->restore());
}
Expand Down

0 comments on commit 4016d9f

Please sign in to comment.