Skip to content

Commit 55d3d9b

Browse files
committed
version 1.0.0
1 parent 75e22a5 commit 55d3d9b

File tree

4 files changed

+42
-34
lines changed

4 files changed

+42
-34
lines changed

Container.php

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?php
22
/**
3-
* @package SugiPHP
4-
* @subpackage Container
5-
* @author Plamen Popov <[email protected]>
6-
* @license http://opensource.org/licenses/mit-license.php (MIT License)
3+
* SugiPHP Container Class
4+
*
5+
* @package SugiPHP.Container
6+
* @author Plamen Popov <[email protected]>
7+
* @license http://opensource.org/licenses/mit-license.php (MIT License)
78
*/
89

910
namespace SugiPHP\Container;
@@ -61,7 +62,8 @@ public function set($id, $value)
6162
/**
6263
* Fetches previously defined parameter or an object.
6364
*
64-
* @param string $id
65+
* @param string $id
66+
*
6567
* @return mixed value, object or NULL if the parameter was not set
6668
*/
6769
public function get($id)
@@ -121,7 +123,8 @@ public function factory($idOrClosure)
121123
/**
122124
* Returns a raw definition. Used when a closure is set and you want to get the closure not the result of it.
123125
*
124-
* @param string $idOrClosure
126+
* @param string $idOrClosure
127+
*
125128
* @return mixed Returns whatever it is stored in the key. NULL if nothing is stored.
126129
*/
127130
public function raw($idOrClosure)
@@ -142,19 +145,20 @@ public function raw($idOrClosure)
142145
/**
143146
* Checks parameter or object is defined.
144147
*
145-
* @param string $id
148+
* @param string $id
149+
*
146150
* @return boolean
147151
*/
148152
public function has($id)
149153
{
150154
return array_key_exists($id, $this->definitions);
151155
}
152156

153-
/**
154-
* Unsets a parameter or an object.
155-
*
156-
* @param string $id
157-
*/
157+
/**
158+
* Unsets a parameter or an object.
159+
*
160+
* @param string $id
161+
*/
158162
public function delete($id)
159163
{
160164
if (!empty($this->locks[$id])) {
@@ -177,11 +181,9 @@ public function lock($id)
177181
$this->locks[$id] = true;
178182
}
179183

180-
/*
181-
* Methods for \ArrayAccess
182-
*/
183-
184184
/**
185+
* Method is needed to implement \ArrayAccess.
186+
*
185187
* @see set() method
186188
*/
187189
public function offsetSet($id, $value)
@@ -190,6 +192,8 @@ public function offsetSet($id, $value)
190192
}
191193

192194
/**
195+
* Method is needed to implement \ArrayAccess.
196+
*
193197
* @see get() method
194198
*/
195199
public function offsetGet($id)
@@ -198,18 +202,22 @@ public function offsetGet($id)
198202
}
199203

200204
/**
205+
* Method is needed to implement \ArrayAccess.
206+
*
201207
* @see has() method
202208
*/
203-
public function offsetExists($id)
204-
{
205-
return $this->has($id);
206-
}
209+
public function offsetExists($id)
210+
{
211+
return $this->has($id);
212+
}
207213

208214
/**
215+
* Method is needed to implement \ArrayAccess.
216+
*
209217
* @see delete() method
210218
*/
211-
public function offsetUnset($id)
212-
{
213-
$this->delete($id);
214-
}
219+
public function offsetUnset($id)
220+
{
221+
$this->delete($id);
222+
}
215223
}

Exception.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?php
22
/**
3-
* @package SugiPHP
4-
* @subpackage Container
5-
* @author Plamen Popov <[email protected]>
6-
* @license http://opensource.org/licenses/mit-license.php (MIT License)
3+
* SugiPHP Container Exception
4+
*
5+
* @package SugiPHP.Container
6+
* @author Plamen Popov <[email protected]>
7+
* @license http://opensource.org/licenses/mit-license.php (MIT License)
78
*/
89

910
namespace SugiPHP\Container;

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@
1818
"SugiPHP\\Container\\": ""
1919
}
2020
},
21-
"minimum-stability": "dev"
2221
}

tests/ContainerTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22
/**
3-
* @package SugiPHP
4-
* @subpackage Container
5-
* @category tests
6-
* @author Plamen Popov <[email protected]>
7-
* @license http://opensource.org/licenses/mit-license.php (MIT License)
3+
* Tests for SugiPHP Container Class
4+
*
5+
* @package SugiPHP.Container
6+
* @author Plamen Popov <[email protected]>
7+
* @license http://opensource.org/licenses/mit-license.php (MIT License)
88
*/
99

1010
namespace SugiPHP\Container;

0 commit comments

Comments
 (0)