Skip to content

Commit de7fe9d

Browse files
committed
docblocks
1 parent 37cfe6d commit de7fe9d

File tree

15 files changed

+635
-92
lines changed

15 files changed

+635
-92
lines changed

src/PHPixie/Framework/Assets.php

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,55 @@
22

33
namespace PHPixie\Framework;
44

5+
use PHPixie\Filesystem\Locators\Locator;
6+
use PHPixie\Filesystem\Root;
7+
8+
/**
9+
* Assets registry
10+
*/
511
class Assets
612
{
713
/**
814
* @type Components
915
*/
1016
protected $components;
17+
18+
/**
19+
* @var array
20+
*/
1121
protected $instances = array();
12-
22+
23+
/**
24+
* Constructor
25+
* @param Components $components
26+
*/
1327
public function __construct($components)
1428
{
1529
$this->components = $components;
1630
}
17-
31+
32+
/**
33+
* Assets root directory
34+
* @return Root
35+
*/
36+
public function frameworkAssetsRoot()
37+
{
38+
return $this->instance('frameworkAssetsRoot');
39+
}
40+
41+
/**
42+
* Filesystem locator for templates
43+
* @return Locator
44+
*/
1845
public function frameworkTemplateLocator()
1946
{
2047
return $this->instance('frameworkTemplateLocator');
2148
}
22-
49+
50+
/**
51+
* @param string $name
52+
* @return mixed
53+
*/
2354
protected function instance($name)
2455
{
2556
if(!array_key_exists($name, $this->instances)) {
@@ -29,24 +60,29 @@ protected function instance($name)
2960

3061
return $this->instances[$name];
3162
}
32-
33-
public function frameworkAssetsRoot()
34-
{
35-
return $this->instance('frameworkAssetsRoot');
36-
}
37-
63+
64+
/**
65+
* @return Root
66+
*/
3867
protected function buildFrameworkAssetsRoot()
3968
{
4069
$directory = realpath(__DIR__.'/../../../assets');
4170
return $this->buildFilesystemRoot($directory);
4271
}
43-
72+
73+
/**
74+
* @param string $directory
75+
* @return Root
76+
*/
4477
protected function buildFilesystemRoot($directory)
4578
{
4679
$filesystem = $this->components->filesystem();
4780
return $filesystem->root($directory);
4881
}
49-
82+
83+
/**
84+
* @return Locator
85+
*/
5086
protected function buildFrameworkTemplateLocator()
5187
{
5288
$slice = $this->components->slice();

src/PHPixie/Framework/Builder.php

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,18 @@
22

33
namespace PHPixie\Framework;
44

5+
/**
6+
* Base framework factory
7+
*/
58
abstract class Builder
69
{
10+
/**
11+
* @var array
12+
*/
713
protected $instances = array();
814

915
/**
16+
* Assets registry
1017
* @return Assets
1118
*/
1219
public function assets()
@@ -15,6 +22,7 @@ public function assets()
1522
}
1623

1724
/**
25+
* Components factory
1826
* @return Components
1927
*/
2028
public function components()
@@ -23,6 +31,7 @@ public function components()
2331
}
2432

2533
/**
34+
* Context container (e.g. for HTTP context)
2635
* @return Context
2736
*/
2837
public function context()
@@ -31,6 +40,7 @@ public function context()
3140
}
3241

3342
/**
43+
* Extensions registry
3444
* @return Extensions
3545
*/
3646
public function extensions()
@@ -39,6 +49,7 @@ public function extensions()
3949
}
4050

4151
/**
52+
* HTTP handler
4253
* @return HTTP
4354
*/
4455
public function http()
@@ -47,13 +58,18 @@ public function http()
4758
}
4859

4960
/**
61+
* Processors factory
5062
* @return Processors
5163
*/
5264
public function processors()
5365
{
5466
return $this->instance('processors');
5567
}
56-
68+
69+
/**
70+
* @param string $name
71+
* @return mixed
72+
*/
5773
protected function instance($name)
5874
{
5975
if(!array_key_exists($name, $this->instances)) {
@@ -63,38 +79,60 @@ protected function instance($name)
6379

6480
return $this->instances[$name];
6581
}
66-
82+
83+
/**
84+
* @return Assets
85+
*/
6786
protected function buildAssets()
6887
{
6988
return new Assets(
7089
$this->components()
7190
);
7291
}
73-
92+
93+
/**
94+
* @return Components
95+
*/
7496
protected function buildComponents()
7597
{
7698
return new Components($this);
7799
}
78-
100+
101+
/**
102+
* @return Context
103+
*/
79104
protected function buildContext()
80105
{
81106
return new Context($this);
82107
}
83-
108+
109+
/**
110+
* @return Extensions
111+
*/
84112
protected function buildExtensions()
85113
{
86114
return new Extensions($this);
87115
}
88-
116+
117+
/**
118+
* @return HTTP
119+
*/
89120
protected function buildHttp()
90121
{
91122
return new HTTP($this);
92123
}
93-
124+
125+
/**
126+
* @return Processors
127+
*/
94128
protected function buildProcessors()
95129
{
96130
return new Processors($this);
97131
}
98-
132+
133+
/**
134+
* Framework Configuration
135+
* @return Configuration
136+
*/
99137
abstract public function configuration();
100138
}

0 commit comments

Comments
 (0)