-
-
Notifications
You must be signed in to change notification settings - Fork 490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation Class Instantiation #1801
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,53 @@ | ||||||
<documentation title="Class Instantiation"> | ||||||
<standard> | ||||||
<![CDATA[ | ||||||
Instantiation of an object should be done with parenthesis. | ||||||
]]> | ||||||
</standard> | ||||||
<code_comparison> | ||||||
<code title="Valid: with parenthesis."> | ||||||
<![CDATA[ | ||||||
$a = new Foobar<em>()</em>; | ||||||
]]> | ||||||
</code> | ||||||
<code title="Invalid: without parenthesis."> | ||||||
<![CDATA[ | ||||||
$a = new Foobar; | ||||||
]]> | ||||||
</code> | ||||||
</code_comparison> | ||||||
<standard> | ||||||
<![CDATA[ | ||||||
Don't use spaces between object name and open parenthesis when instantiating new object. | ||||||
]]> | ||||||
</standard> | ||||||
<code_comparison> | ||||||
<code title="Valid: no spaces between object name and parenthesis."> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
<![CDATA[ | ||||||
$a = new Foobar(); | ||||||
]]> | ||||||
</code> | ||||||
<code title="Invalid: spaces between object name and parenthesis."> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
<![CDATA[ | ||||||
$a = new Foobar<em> </em>(); | ||||||
]]> | ||||||
</code> | ||||||
</code_comparison> | ||||||
<standard> | ||||||
<![CDATA[ | ||||||
Object instantiation by reference is not supported by PHP anymore. | ||||||
FORTE-WP marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
]]> | ||||||
</standard> | ||||||
<code_comparison> | ||||||
<code title="Valid: object instantiation without reference."> | ||||||
<![CDATA[ | ||||||
$a = new Foobar(); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
]]> | ||||||
</code> | ||||||
<code title="Invalid: object instantiation by reference."> | ||||||
<![CDATA[ | ||||||
$a = <em>&</em> new Foobar(); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
]]> | ||||||
</code> | ||||||
</code_comparison> | ||||||
</documentation> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.