/** * Replace marker * * @return void */ private function replace() { foreach ($this->replacementArray as $_key => $_value) { if (String::isValid($_value)) { $this->replaceString($_key, $_value); } elseif (Collection::isValid($_value)) { $this->replaceArray($_key, $_value); } elseif (Object::isValid($_value)) { $this->replaceObject($_key, $_value); } } $this->cleanup(); }
/** * */ public function testIsValid() { $this->assertInternalType('bool', Collection::isValid(['a', 'b', 'c'])); $this->assertInternalType('bool', Collection::isValid('')); $this->assertInternalType('bool', Collection::isValid(NULL)); /** @noinspection PhpParamsInspection */ $this->assertInternalType('bool', Collection::isValid(new stdClass())); $this->assertTrue(Collection::isValid(['a', 'b', 'c'])); $this->assertFalse(Collection::isValid('abc')); $this->assertFalse(Collection::isValid(NULL)); /** @noinspection PhpParamsInspection */ $this->assertFalse(Collection::isValid(new stdClass())); }
/** * */ protected function prepareChars() { $this->charsToUse .= self::$chars; if ($this->useSpecialChars) { $this->charsToUse .= self::$specialChars; } if ($this->useUmlauts) { $this->charsToUse .= self::$umlauts; } if ($this->useLowerCase) { $this->charsToUse .= String::lower($this->charsToUse); } if ($this->useUpperCase) { $this->charsToUse .= String::upper($this->charsToUse); } $charArray = Collection::explode($this->charsToUse, ''); if (Collection::isValid($charArray)) { $this->charArray = array_unique($charArray); } }