Skip to content

Commit

Permalink
Merge pull request #17 from moufmouf/no_relative_fqcn
Browse files Browse the repository at this point in the history
Switching to 100% relative namespace for exceptions
  • Loading branch information
moufmouf committed Sep 10, 2018
2 parents c7168e2 + 5405819 commit 965e0c7
Show file tree
Hide file tree
Showing 86 changed files with 2,059 additions and 1,875 deletions.
6 changes: 0 additions & 6 deletions generated/Exceptions/Ingres-iiException.php

This file was deleted.

6 changes: 6 additions & 0 deletions generated/Exceptions/IngresiiException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php
namespace Safe\Exceptions;

class IngresiiException extends AbstractSafeException
{
}
18 changes: 10 additions & 8 deletions generated/apache.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@

namespace Safe;

use Safe\Exceptions\ApacheException;

/**
* Fetch the Apache version.
*
* @return string Returns the Apache version on success .
* @throws Exceptions\ApacheException
* @throws ApacheException
*
*/
function apache_get_version(): string
{
error_clear_last();
$result = \apache_get_version();
if ($result === FALSE) {
throw Exceptions\ApacheException::createFromPhpError();
throw ApacheException::createFromPhpError();
}
return $result;
}
Expand All @@ -29,15 +31,15 @@ function apache_get_version(): string
*
* This function requires Apache 1.
*
* @throws Exceptions\ApacheException
* @throws ApacheException
*
*/
function apache_reset_timeout(): void
{
error_clear_last();
$result = \apache_reset_timeout();
if ($result === FALSE) {
throw Exceptions\ApacheException::createFromPhpError();
throw ApacheException::createFromPhpError();
}
}

Expand All @@ -46,15 +48,15 @@ function apache_reset_timeout(): void
* Fetch all HTTP response headers.
*
* @return array An array of all Apache response headers on success .
* @throws Exceptions\ApacheException
* @throws ApacheException
*
*/
function apache_response_headers(): array
{
error_clear_last();
$result = \apache_response_headers();
if ($result === FALSE) {
throw Exceptions\ApacheException::createFromPhpError();
throw ApacheException::createFromPhpError();
}
return $result;
}
Expand All @@ -68,15 +70,15 @@ function apache_response_headers(): array
* @param string $variable The environment variable that's being set.
* @param string $value The new variable value.
* @param bool $walk_to_top Whether to set the top-level variable available to all Apache layers.
* @throws Exceptions\ApacheException
* @throws ApacheException
*
*/
function apache_setenv(string $variable, string $value, bool $walk_to_top = false): void
{
error_clear_last();
$result = \apache_setenv($variable, $value, $walk_to_top);
if ($result === FALSE) {
throw Exceptions\ApacheException::createFromPhpError();
throw ApacheException::createFromPhpError();
}
}

Expand Down
34 changes: 18 additions & 16 deletions generated/apc.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Safe;

use Safe\Exceptions\ApcException;

/**
* apc_cas updates an already existing integer value if the
* old parameter matches the currently stored value
Expand All @@ -10,15 +12,15 @@
* @param string $key The key of the value being updated.
* @param int $old The old value (the value currently stored).
* @param int $new The new value to update to.
* @throws Exceptions\ApcException
* @throws ApcException
*
*/
function apc_cas(string $key, int $old, int $new): void
{
error_clear_last();
$result = \apc_cas($key, $old, $new);
if ($result === FALSE) {
throw Exceptions\ApcException::createFromPhpError();
throw ApcException::createFromPhpError();
}
}

Expand All @@ -30,15 +32,15 @@ function apc_cas(string $key, int $old, int $new): void
* the bytecode cache.
* @param bool $atomic
* @return mixed Returns TRUE on success .
* @throws Exceptions\ApcException
* @throws ApcException
*
*/
function apc_compile_file(string $filename, bool $atomic = true)
{
error_clear_last();
$result = \apc_compile_file($filename, $atomic);
if ($result === FALSE) {
throw Exceptions\ApcException::createFromPhpError();
throw ApcException::createFromPhpError();
}
return $result;
}
Expand All @@ -53,7 +55,7 @@ function apc_compile_file(string $filename, bool $atomic = true)
* this referenced variable.
* @return int Returns the current value of key's value on success,
*
* @throws Exceptions\ApcException
* @throws ApcException
*
*/
function apc_dec(string $key, int $step = 1, bool &$success = null): int
Expand All @@ -65,7 +67,7 @@ function apc_dec(string $key, int $step = 1, bool &$success = null): int
$result = \apc_dec($key, $step);
}
if ($result === FALSE) {
throw Exceptions\ApcException::createFromPhpError();
throw ApcException::createFromPhpError();
}
return $result;
}
Expand All @@ -91,15 +93,15 @@ function apc_dec(string $key, int $step = 1, bool &$success = null): int
* i.e. CONSTANT and Constant
* represent different values. If this parameter evaluates to FALSE the
* constants will be declared as case-insensitive symbols.
* @throws Exceptions\ApcException
* @throws ApcException
*
*/
function apc_define_constants(string $key, array $constants, bool $case_sensitive = true): void
{
error_clear_last();
$result = \apc_define_constants($key, $constants, $case_sensitive);
if ($result === FALSE) {
throw Exceptions\ApcException::createFromPhpError();
throw ApcException::createFromPhpError();
}
}

Expand All @@ -114,15 +116,15 @@ function apc_define_constants(string $key, array $constants, bool $case_sensitiv
* Or if keys is an array, then
* an empty array is returned on success, or an array of failed files
* is returned.
* @throws Exceptions\ApcException
* @throws ApcException
*
*/
function apc_delete_file($keys)
{
error_clear_last();
$result = \apc_delete_file($keys);
if ($result === FALSE) {
throw Exceptions\ApcException::createFromPhpError();
throw ApcException::createFromPhpError();
}
return $result;
}
Expand All @@ -133,15 +135,15 @@ function apc_delete_file($keys)
*
* @param string|string[]|APCIterator $key The key used to store the value (with
* apc_store).
* @throws Exceptions\ApcException
* @throws ApcException
*
*/
function apc_delete(string $key)
{
error_clear_last();
$result = \apc_delete($key);
if ($result === FALSE) {
throw Exceptions\ApcException::createFromPhpError();
throw ApcException::createFromPhpError();
}
return $result;
}
Expand All @@ -156,7 +158,7 @@ function apc_delete(string $key)
* this referenced variable.
* @return int Returns the current value of key's value on success,
*
* @throws Exceptions\ApcException
* @throws ApcException
*
*/
function apc_inc(string $key, int $step = 1, bool &$success = null): int
Expand All @@ -168,7 +170,7 @@ function apc_inc(string $key, int $step = 1, bool &$success = null): int
$result = \apc_inc($key, $step);
}
if ($result === FALSE) {
throw Exceptions\ApcException::createFromPhpError();
throw ApcException::createFromPhpError();
}
return $result;
}
Expand All @@ -183,15 +185,15 @@ function apc_inc(string $key, int $step = 1, bool &$success = null): int
* i.e. CONSTANT and Constant
* represent different values. If this parameter evaluates to FALSE the
* constants will be declared as case-insensitive symbols.
* @throws Exceptions\ApcException
* @throws ApcException
*
*/
function apc_load_constants(string $key, bool $case_sensitive = true): void
{
error_clear_last();
$result = \apc_load_constants($key, $case_sensitive);
if ($result === FALSE) {
throw Exceptions\ApcException::createFromPhpError();
throw ApcException::createFromPhpError();
}
}

Expand Down
18 changes: 10 additions & 8 deletions generated/apcu.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Safe;

use Safe\Exceptions\ApcuException;

/**
* apcu_cas updates an already existing integer value if the
* old parameter matches the currently stored value
Expand All @@ -10,15 +12,15 @@
* @param string $key The key of the value being updated.
* @param int $old The old value (the value currently stored).
* @param int $new The new value to update to.
* @throws Exceptions\ApcuException
* @throws ApcuException
*
*/
function apcu_cas(string $key, int $old, int $new): void
{
error_clear_last();
$result = \apcu_cas($key, $old, $new);
if ($result === FALSE) {
throw Exceptions\ApcuException::createFromPhpError();
throw ApcuException::createFromPhpError();
}
}

Expand All @@ -32,7 +34,7 @@ function apcu_cas(string $key, int $old, int $new): void
* this referenced variable.
* @return int Returns the current value of key's value on success,
*
* @throws Exceptions\ApcuException
* @throws ApcuException
*
*/
function apcu_dec(string $key, int $step = 1, bool &$success = null): int
Expand All @@ -44,7 +46,7 @@ function apcu_dec(string $key, int $step = 1, bool &$success = null): int
$result = \apcu_dec($key, $step);
}
if ($result === FALSE) {
throw Exceptions\ApcuException::createFromPhpError();
throw ApcuException::createFromPhpError();
}
return $result;
}
Expand All @@ -58,15 +60,15 @@ function apcu_dec(string $key, int $step = 1, bool &$success = null): int
* or as an array of strings for several keys,
* or as an APCUIterator object.
* @return bool|array Returns TRUE on success .
* @throws Exceptions\ApcuException
* @throws ApcuException
*
*/
function apcu_delete($key): void
{
error_clear_last();
$result = \apcu_delete($key);
if ($result === FALSE) {
throw Exceptions\ApcuException::createFromPhpError();
throw ApcuException::createFromPhpError();
}
}

Expand All @@ -80,7 +82,7 @@ function apcu_delete($key): void
* this referenced variable.
* @return int Returns the current value of key's value on success,
*
* @throws Exceptions\ApcuException
* @throws ApcuException
*
*/
function apcu_inc(string $key, int $step = 1, bool &$success = null): int
Expand All @@ -92,7 +94,7 @@ function apcu_inc(string $key, int $step = 1, bool &$success = null): int
$result = \apcu_inc($key, $step);
}
if ($result === FALSE) {
throw Exceptions\ApcuException::createFromPhpError();
throw ApcuException::createFromPhpError();
}
return $result;
}
Expand Down

0 comments on commit 965e0c7

Please sign in to comment.