Cleaned up for inspection (coding style, PHPDoc)
This commit is contained in:
1 parent
68d6154a5e
commit
edb6941eb7
7 files changed
+117
-36
No files matched your search
+21
-11
@@ -2,9 +2,28 @@
|
||||
|
||||
namespace Rarst\Laps;
|
||||
|
||||
/**
|
||||
* Base class for bulk event providers
|
||||
*/
|
||||
abstract class Laps_Events {
|
||||
|
||||
/**
|
||||
* Retrieve array of event data
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get() {
|
||||
|
||||
if ( $this->is_applicable() ) {
|
||||
return $this->get_events();
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Is event pack relevant to current runtime
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function is_applicable() {
|
||||
@@ -13,17 +32,8 @@ abstract class Laps_Events {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function get() {
|
||||
|
||||
if( $this->is_applicable() )
|
||||
return $this->get_events();
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Inherit with internal events compiling and return
|
||||
*
|
||||
* @return array()
|
||||
*/
|
||||
abstract protected function get_events();
|
||||
|
||||
Reference in new issue
Block a user