# default exceptions, interfaces, etc.

- Thread: https://externals.io/message/149
- Original archive: https://news-web.php.net/php.internals/149
- Started by Sterling Hughes on 2003-03-22T21:07:40+00:00
- Messages: 6
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #149 — Sterling Hughes — 2003-03-22T21:07:40+00:00

URL: https://externals.io/message/149#149

Hi,

Attached is a patch (+ 2 files) that add a default "exception" class to
Zend 2.  I find this very useful when you just want to throw a simple
exception inside of a try {}, but you don't want to create a new
exception for each and every error.  I'll commit this tommorowish,
unless somebody objects.

-Sterling
-- 
"Whether you think you can or think you can't -- you are right." 
    - Henry Ford

---

## #156 — Sterling Hughes — 2003-03-22T23:43:15+00:00

URL: https://externals.io/message/149#156 · In reply to: #155

> Hi,
> 
> As per naming convention, I think it'd be nice if the methods were
> named as:
> 
> getmessage => get_message
> getcode => get_code
> 
> If those are corrected, +1 for this feature.
> 

I was thinking of that - I would personally prefer get_message() and
get_code() naming, but that goes against pear's naming conventions, and
I want this to integrate well with pear (as a base class.)

-Sterling

> Moriyoshi
> 
> Sterling Hughes <sterling@bumblebury.com> wrote:
> 
> > […]
-- 
"People can have the Model T in any colour -- so long as it's black." 
    - Henry Ford

---

## #155 — Moriyoshi Koizumi — 2003-03-23T00:02:40+00:00

URL: https://externals.io/message/149#155 · In reply to: #149

Hi,

As per naming convention, I think it'd be nice if the methods were
named as:

getmessage => get_message
getcode => get_code

If those are corrected, +1 for this feature.

Moriyoshi

Sterling Hughes <sterling@bumblebury.com> wrote:

> Hi,
> 
> Attached is a patch (+ 2 files) that add a default "exception" class to
> Zend 2.  I find this very useful when you just want to throw a simple
> exception inside of a try {}, but you don't want to create a new
> exception for each and every error.  I'll commit this tommorowish,
> unless somebody objects.
> 
> -Sterling
> -- 
> "Whether you think you can or think you can't -- you are right." 
>     - Henry Ford

---

## #166 — Sterling Hughes — 2003-03-23T02:22:30+00:00

URL: https://externals.io/message/149#166 · In reply to: #164

> 
> 
> > […]
> 
> It's a PHP function, not PEAR code, so it should follow the PHP naming 
> style.
> 

As I mentioned to Marcus, there are no naming conventions for OO code,
only procedural code (in PHP).  Also, compliance with PEAR is a
pragmatic solution, because presumably all their code will be inheriting
from Exception.  The largest, and the official OO library should be
in-sync with standard practices (and we have none yet regarding OO
code.)

-Sterling

> Derick
-- 
"A business that makes nothing but money is a poor kind of business." 
    - Henry Ford

---

## #164 — Derick Rethans — 2003-03-23T02:33:44+00:00

URL: https://externals.io/message/149#164 · In reply to: #156

> 
> > […]
> 
> I was thinking of that - I would personally prefer get_message() and
> get_code() naming, but that goes against pear's naming conventions, and
> I want this to integrate well with pear (as a base class.)

It's a PHP function, not PEAR code, so it should follow the PHP naming 
style.

Derick

-- 
                                        "my other box is your windows PC"
-------------------------------------------------------------------------
 Derick Rethans                                 http://derickrethans.nl/ 
 PHP Magazine - PHP Magazine for Professionals       http://php-mag.net/

---

## #167 — Jani Taskinen — 2003-03-23T04:51:20+00:00

URL: https://externals.io/message/149#167 · In reply to: #166

>
> > […]
>
>As I mentioned to Marcus, there are no naming conventions for OO code,
>only procedural code (in PHP).  Also, compliance with PEAR is a
>pragmatic solution, because presumably all their code will be inheriting
>from Exception.  The largest, and the official OO library should be
>in-sync with standard practices (and we have none yet regarding OO
>code.)

   Even if we don't have specific rules (yet) for OO stuff,
   IMO, it should follow the existing rules.
   
   --Jani
