for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace GolfLeague\Storage\HoleScore;
use \Holescore as Holescore;
use \Player as Player;
class EloquentHoleScoreRepository implements HoleScoreRepository
{
/*Return Score collections that include:
* Player Name
* Date
* Total
* Course
* Multideminsional Array of Hole Numbers and scores
**/
public function __construct(Holescore $holescore)
$this->holescore = $holescore;
holescore
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->holescore->all();
public function find($id)
return Holescore::find($id);
public function create($input)
$this->holescore->create($input);
public function update($id, $score)
$holescore = $this->find($id);
$holescore->score = $score;
$holescore->save();
public function getByRound($roundId)
return $this->holescore->where('round_id', '=', $roundId)->orderBy('id', 'ASC')->get();
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: