mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-04-27 07:33:57 +00:00
PSR-2 and single quotes
This commit is contained in:
parent
444569e4d1
commit
6febd852ff
@ -482,11 +482,14 @@ abstract class MyAbstractClass implements InterfaceOne
|
||||
|
||||
class MyConcreteClass extends MyAbstractClass implements InterfaceTwo
|
||||
{
|
||||
public function doSomething(){
|
||||
public function doSomething()
|
||||
{
|
||||
echo $x;
|
||||
}
|
||||
public function doSomethingElse(){
|
||||
echo "doSomethingElse";
|
||||
|
||||
public function doSomethingElse()
|
||||
{
|
||||
echo 'doSomethingElse';
|
||||
}
|
||||
}
|
||||
|
||||
@ -494,11 +497,14 @@ class MyConcreteClass extends MyAbstractClass implements InterfaceTwo
|
||||
// Classes can implement more than one interface
|
||||
class SomeOtherClass implements InterfaceOne, InterfaceTwo
|
||||
{
|
||||
public function doSomething(){
|
||||
echo "doSomething";
|
||||
public function doSomething()
|
||||
{
|
||||
echo 'doSomething';
|
||||
}
|
||||
public function doSomethingElse(){
|
||||
echo "doSomethingElse";
|
||||
|
||||
public function doSomethingElse()
|
||||
{
|
||||
echo 'doSomethingElse';
|
||||
}
|
||||
}
|
||||
|
||||
@ -509,10 +515,11 @@ class SomeOtherClass implements InterfaceOne, InterfaceTwo
|
||||
|
||||
//Traits are available since PHP 5.4.0 and are declared using the trait keyword.
|
||||
|
||||
trait MyTrait {
|
||||
trait MyTrait
|
||||
{
|
||||
public function myTraitMethod()
|
||||
{
|
||||
print "I have MyTrait";
|
||||
print 'I have MyTrait';
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user