Skip to content

Commit 442bb58

Browse files
committed
Initial commit of skeleton gear, just an example.
Signed-off-by: Jason Lewis <jason.lewis1991@gmail.com>
1 parent 8b17074 commit 442bb58

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

gears/skeleton/bone.gear.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php namespace Feather\Gear\Skeleton;
2+
3+
/**
4+
* All gears should extend the Gear Foundation component.
5+
*/
6+
use Feather\Components\Gear\Foundation;
7+
8+
class Bone extends Foundation {
9+
10+
/**
11+
* The constructor of a gear contains the events that it listens to. Events can execute
12+
* closures or methods on the class.
13+
*
14+
* @return void
15+
*/
16+
public function __construct()
17+
{
18+
// Listen for an event and execute a callback when the event is fired by Feather.
19+
$this->listen('event', function()
20+
{
21+
// Depending on the event you may be required to return a value or null.
22+
});
23+
24+
// Listen for an event and execute a method on the class.
25+
$this->listen('event', 'method');
26+
27+
// Override existing events that are listening for the same event.
28+
$this->override('event', 'method');
29+
}
30+
31+
/**
32+
* This method will be executed when the event is fired by Feather.
33+
*
34+
* @return void
35+
*/
36+
public function method(){}
37+
38+
}

0 commit comments

Comments
 (0)