for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace GolfLeague\Storage\Player;
use \Player as Player;
class EloquentPlayerRepository implements PlayerRepository
{
/*Return Score collections that include:
* Player Name
* Date
* Total
* Course
* Multideminsional Array of Hole Numbers and scores *
**/
public function __construct(Player $player)
$this->player = $player;
player
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
}
public function all()
return $this->player->orderBy('handicap','asc')->get();
//Find Player by Player Id
public function find($playerId)
return $this->player->find($playerId);
public function create($name, $handicap)
$this->player->name = $name;
$this->player->handicap = $handicap;
$this->player->save();
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: