Skip to content

Commit e3fd3b6

Browse files
committed
Update comments
1 parent f4e7c62 commit e3fd3b6

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/Container/ObjectBuilder.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,17 @@ public function __construct(Container $container)
7070
*
7171
* We will look for the class in the container
7272
* If it is not found, we will try to instantiate it via reflection and obtaining dependencies via the container
73-
* We will save the instance in the container
7473
*
75-
* @param string $classname Fully qualified class name
76-
* @param bool $useContainer (true) Pull obj from container if available / store obj in container after build
74+
* if $save is true, we will save the instance in the container
75+
*
76+
* @param string $classname Fully qualified class name
77+
* @param bool $save (true) store built object in container after build
7778
*
7879
* @return object
7980
*
8081
* @throws RuntimeException
8182
*/
82-
public function build($classname, $useContainer = true)
83+
public function build($classname, $save = true)
8384
{
8485
if ($this->container->has($classname)) {
8586
return $this->container->get($classname);
@@ -90,7 +91,7 @@ public function build($classname, $useContainer = true)
9091
? $this->resolveConstructorArgs($refConstructor)
9192
: [];
9293
$return = $refClass->newInstanceArgs($paramValues);
93-
if ($useContainer) {
94+
if ($save) {
9495
$this->container->offsetSet($classname, $return);
9596
}
9697
return $return;

src/PubSub/ValueStore.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
* Note:
2525
* - The Serializable interface - since PHP 5.1. Deprecated in php 8.1
2626
* - __serialize and __unserialize magic methods : since PHP 7.4
27+
* - if __serialize is present, it will be used instead of Serializable::serialize
28+
* - objects serialized with __serialize can not be unserialized
2729
*
2830
* @template TKey of array-key
2931
* @template TValue of mixed

tests/Debug/Utility/SerializeLogTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ public static function importProvider()
8686
);
8787
}
8888
if (PHP_VERSION_ID < 70400) {
89+
// objects serialized with __serialize can not be unserialized in php < 7.4
90+
// v2.3 did not use __serialize, so can still test that
8991
return \array_intersect_key($tests, \array_flip(['2.3']));
9092
}
9193

0 commit comments

Comments
 (0)