/** * Detects and sets "option" type arguments. * @param type $argument The argument string. * @return boolean */ private function detectOptions($argument) { if (substr($argument, 0, 2) === '--') { $name = substr($argument, 2); $value = ''; if (strpos($name, '=')) { list($name, $value) = explode('=', $argument, 2); } $this->options->put(ltrim($name, '-'), trim($value, '"')); return true; } return false; }
/** * Register a new command handler. * @param string $command The command name * @param mixed $handler The command handler (see ClassMethodHandler) */ public function add($command, $handler) { $this->routes->put($command, $handler); }
/** * Requires that the password/string is not found in the collection. * @param array The array of passwords/strings to check against. * @return \Ballen\Plexity\Plexity */ public function notIn(array $array) { $this->rules->put(self::RULE_NOT_IN, $array); return $this; }
public function testPutItemOnToCollection() { $collection = new Collection(); $collection->put('test', 'A test string'); $this->assertArrayHasKey('test', $collection->all()->toArray()); }