/** * magic method, called when there's an attempt to get a property * that doesn't actually exist * * if $propertyName is a dot.notation.support path, we'll attempt to * retrieve the property from the data bag's children * * @param string $propertyName * name of the property being read * @return mixed * * @throws E4xx_NoSuchProperty */ public function __get($propertyName) { // is the user trying to use dot.notation? if (IsDotNotationPath::checkString($propertyName)) { return FilterDotNotationPath::fromObject($this, $propertyName); } // if we get here, then we have no idea what you are trying to get throw new E4xx_NoSuchProperty($this, $propertyName); }
/** * @covers ::fromObject * @expectedException GanbaroDigital\DataContainers\Exceptions\E4xx_UnsupportedType * @dataProvider provideNonAssignableContainers */ public function testThrowsExceptionWhenFromObjectCalledStaticallyWithNonAssignable($container) { // ---------------------------------------------------------------- // setup your test // ---------------------------------------------------------------- // perform the change FilterDotNotationPath::fromObject($container, "one"); }