Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
X Lib
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
XLibs
X Lib
Commits
f563339c
Commit
f563339c
authored
Oct 25, 2016
by
Alex Ne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
правка кодов ошибок. 0 - не ошибка, это сообщение, 1 - это уже неизвестная ошибка
parent
bf7963ac
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
23 deletions
+14
-23
EItem.php
ETrace/EItem.php
+2
-2
Error.php
ETrace/Error.php
+6
-11
Fatal.php
ETrace/Fatal.php
+5
-9
Notification.php
ETrace/Notification.php
+1
-1
No files found.
ETrace/EItem.php
View file @
f563339c
...
@@ -38,7 +38,7 @@ class EItem extends \Exception {
...
@@ -38,7 +38,7 @@ class EItem extends \Exception {
/**
/**
* @param enum $type paranoid | trace | system | fatal | error | notification
* @param enum $type paranoid | trace | system | fatal | error | notification
* @param string $message
* @param string $message
* @param int $code [=
0
]
* @param int $code [=
1
]
* @param string $file [= false]
* @param string $file [= false]
* @param int $line [= false]
* @param int $line [= false]
* @param array $context [= []]
* @param array $context [= []]
...
@@ -46,7 +46,7 @@ class EItem extends \Exception {
...
@@ -46,7 +46,7 @@ class EItem extends \Exception {
/**
/**
* @return mixed
* @return mixed
*/
*/
public
function
__construct
(
$type
,
$message
,
$code
=
0
,
$file
=
false
,
$line
=
false
,
$context
=
[])
{
public
function
__construct
(
$type
,
$message
,
$code
=
1
,
$file
=
false
,
$line
=
false
,
$context
=
[])
{
parent
::
__construct
(
$message
,
intval
(
$code
));
parent
::
__construct
(
$message
,
intval
(
$code
));
if
(
!
(
$file
===
false
))
{
if
(
!
(
$file
===
false
))
{
$this
->
file
=
$file
;
$this
->
file
=
$file
;
...
...
ETrace/Error.php
View file @
f563339c
<?php
<?php
namespace
X\ETrace
;
namespace
X\ETrace
;
class
Error
extends
EItem
class
Error
extends
EItem
{
{
/**
/**
* @var mixed
* @var mixed
*/
*/
...
@@ -16,32 +15,28 @@ class Error extends EItem
...
@@ -16,32 +15,28 @@ class Error extends EItem
* @param int $line [= false]
* @param int $line [= false]
* @param array $context [= []]
* @param array $context [= []]
*/
*/
public
function
__construct
(
$message
,
$severity
=
0
,
$file
=
false
,
$line
=
false
,
$context
=
[])
public
function
__construct
(
$message
,
$severity
=
0
,
$file
=
false
,
$line
=
false
,
$context
=
[])
{
{
parent
::
__construct
(
"error"
,
$message
,
1
,
$file
,
$line
,
$context
);
parent
::
__construct
(
"error"
,
$message
,
0
,
$file
,
$line
,
$context
);
$this
->
severity
=
$severity
;
$this
->
severity
=
$severity
;
}
}
/**
/**
* @return mixed
* @return mixed
*/
*/
public
function
getSeverity
()
public
function
getSeverity
()
{
{
return
$this
->
severity
;
return
$this
->
severity
;
}
}
/**
/**
* @return mixed
* @return mixed
*/
*/
public
function
Trace
()
public
function
Trace
()
{
{
$trace
=
parent
::
Trace
();
$trace
=
parent
::
Trace
();
array_shift
(
$trace
);
array_shift
(
$trace
);
return
$trace
;
return
$trace
;
}
}
public
function
Model
()
public
function
Model
()
{
{
return
array_merge
([
"severity"
=>
$this
->
severity
],
parent
::
Model
());
return
array_merge
([
"severity"
=>
$this
->
severity
],
parent
::
Model
());
}
}
}
}
...
...
ETrace/Fatal.php
View file @
f563339c
<?php
<?php
namespace
X\ETrace
;
namespace
X\ETrace
;
class
Fatal
extends
EItem
class
Fatal
extends
EItem
{
{
/**
/**
* @var mixed
* @var mixed
*/
*/
...
@@ -17,25 +16,22 @@ class Fatal extends EItem
...
@@ -17,25 +16,22 @@ class Fatal extends EItem
* @param false $line
* @param false $line
* @param array $context
* @param array $context
*/
*/
public
function
__construct
(
$message
,
$severity
=
0
,
$file
=
false
,
$line
=
false
)
public
function
__construct
(
$message
,
$severity
=
0
,
$file
=
false
,
$line
=
false
)
{
{
parent
::
__construct
(
"fatal"
,
$message
,
1
,
$file
,
$line
,
[]);
parent
::
__construct
(
"fatal"
,
$message
,
0
,
$file
,
$line
,
[]);
$this
->
severity
=
$severity
;
$this
->
severity
=
$severity
;
}
}
/**
/**
* @return mixed
* @return mixed
*/
*/
public
function
getSeverity
()
public
function
getSeverity
()
{
{
return
$this
->
severity
;
return
$this
->
severity
;
}
}
/**
/**
* @return mixed
* @return mixed
*/
*/
public
function
Trace
()
public
function
Trace
()
{
{
$trace
=
parent
::
Trace
();
$trace
=
parent
::
Trace
();
array_shift
(
$trace
);
array_shift
(
$trace
);
return
$trace
;
return
$trace
;
...
...
ETrace/Notification.php
View file @
f563339c
...
@@ -8,7 +8,7 @@ class Notification extends EItem {
...
@@ -8,7 +8,7 @@ class Notification extends EItem {
* @param array $context
* @param array $context
*/
*/
public
function
__construct
(
$message
,
$context
=
[])
{
public
function
__construct
(
$message
,
$context
=
[])
{
parent
::
__construct
(
"notification"
,
$message
,
1
,
false
,
false
,
$context
);
parent
::
__construct
(
"notification"
,
$message
,
0
,
false
,
false
,
$context
);
}
}
}
}
?>
?>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment