Re: [PEPr] Proposal for XML::XML_FOAF
| From: | Davey | Date: | Wed, 17 Dec 2003 12:03:24 +0000 |
| Subject: | Re: [PEPr] Proposal for XML::XML_FOAF | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-24496@lists.php.net to get a copy of this message | ||
Arnaud Limbourg wrote:
CS police. Class { function { the curly brace should be in the line under ;) NULL => null.Fixed
The phpdoc comment should be just above the method they describe, there is a white line atm.There is no CS for this, AFAIK, I prefer it this way.
I don't understand why you have
970 if (in_array($property,$common) || in_array($property,${$this->agent})) {
since it is not in a string you can write $this->agent, no need for ${this->agent}, right ?
Note the two $ chars, its a variable variable. ${$this->agent} amounts to $$this->agent. but unless the var is a simple $$var, you must use the { } to show how much of the complex var is the name. Think about this:
$var = new Foo();
$var_name = 'var';
$$var_name->method;
And
$var = "Foo";
$object = new stdClass;
$object->var_name = 'var';
$$object->var_name;
How does PHP know which you want? is the ->property for the name, or are you trying to call it on the dynamic name? The use of { } tells it this.
Also, same with arrays:
$var = array(1,2,3);
$var_name = 'var';
echo $$var_name[0];
And
$var = "Foo";
$var_names = array('var','var2','var3');
echo $$var_names[0];
Are you going to get "Foo" or "F" as the output ([0] will give you first character of a string remember, but is deprecated). Hope this explains it. Of course, you may have just missed the double $$ and know all this...
General question, when the foaf specs evolves will that mean having more methods ?Because the FOAF spec will likely *remove* properties as well as add, I will *have* to break BC when this happens. So it'll be FOAF2 or whatever.
If so it might make sense to have related handling in separate classes. From quickly reading the code, $foaf->person->xxx $foaf->onlineChat->xx $foaf->codepiction->No. :)
But since i hardly know foaf it may not make any sense, if so please ignore this part of the message, jsut keep the cs police :)Done!
Arnaud. PEPr wrote:- DaveyDavey Shafik (http://pear.php.net/user/davey) proposes the new package XML::XML_FOAF. You can find more detailed information here: http://preview.pear.php.net/package-proposal-show.php?id=8. Sent by PEPr Automatic proposal system at http://pear.php.net