/** * Redefine Constructor to internalize the creation of the choice list. */ public function __construct() { $choices = array(self::TYPE_IMPROVE_CODE => 'I want someone to improve this code.', self::TYPE_IMPROVE_PERFORMANCE => 'I want someone to make this code faster.', self::TYPE_CODING_HORROR => 'This is a sample of Coding Horror.', self::TYPE_GET_FEEDBACK => 'I want feedback on this code.', self::TYPE_CHALLENGE => 'This code is bulletproof, I dare people to make it better.'); $this->reasons = array(self::TYPE_IMPROVE_CODE => 'Make this code better', self::TYPE_IMPROVE_PERFORMANCE => 'Make this code faster', self::TYPE_CODING_HORROR => 'Coding Horror, be scared', self::TYPE_GET_FEEDBACK => 'Give me feedback', self::TYPE_CHALLENGE => 'I dare you to improve this'); $this->details = array(self::TYPE_IMPROVE_CODE => 'How can this code be improved? Readability, performance, architecture, all aspects.', self::TYPE_IMPROVE_PERFORMANCE => 'This code needs to fly, looking good does not matter, it just needs to be fast, how can it be improved?', self::TYPE_CODING_HORROR => 'We see things that should never be done or repeated, these are good examples, teach people how to fix them.', self::TYPE_GET_FEEDBACK => 'What\'s good or bad about this code? People trying to get a general idea of what their code looks like.', self::TYPE_CHALLENGE => 'I think this code is awesome, I challenge you to prove otherwise.'); parent::__construct($choices); }
/** * Returns the remaining locales sorted by language name * * @return array */ public function getRemainingViews() { $remainingViews = parent::getRemainingViews(); usort($remainingViews, function (ChoiceView $choiceView1, ChoiceView $choiceView2) { return \Collator::create(null)->compare($choiceView1->label, $choiceView2->label); }); return $remainingViews; }
/** * @param string */ public function __construct($className, $labelPath, array $preferredChoices = array()) { if (!is_string($className)) { throw new \InvalidArgumentException('Class name was not a string'); } $this->className = $className; parent::__construct($this->getItems($labelPath), $preferredChoices); }
/** * @param ModelManagerInterface $modelManager * @param string $class * @param null $property * @param null $query * @param array $choices */ public function __construct(ModelManagerInterface $modelManager, $class, $property = null, $query = null, $choices = array()) { $this->modelManager = $modelManager; $this->class = $class; $this->query = $query; $this->identifier = $this->modelManager->getIdentifierFieldNames($this->class); // The property option defines, which property (path) is used for // displaying entities as strings if ($property) { $this->propertyPath = new PropertyPath($property); } parent::__construct($this->load($choices)); }
public function getChoicesForValues(array $values) { if (!$this->ajax) { return parent::getChoicesForValues($values); } return $values; }
/** * Redefine Constructor to internalize the creation of the choice list. */ public function __construct() { $choices = array("c_cpp" => "C/C++", "clojure" => "Clojure", "coffee" => "CoffeeScript", "coldfusion" => "ColdFusion", "csharp" => "C#", "css" => "CSS", "groovy" => "Groovy", "haxe" => "haXe", "html" => "HTML", "java" => "Java", "javascript" => "JavaScript", "json" => "JSON", "latex" => "LaTeX", "lua" => "Lua", "markdown" => "Markdown", "ocaml" => "OCaml", "perl" => "Perl", "pgsql" => "pgSQL", "php" => "PHP", "powershell" => "Powershell", "python" => "Python", "scala" => "Scala", "scss" => "SCSS", "ruby" => "Ruby", "sql" => "SQL", "svg" => "SVG", "text" => "Text", "xquery" => "XQuery", "textile" => "Textile", "xml" => "XML", "sh" => "SH"); parent::__construct($choices); }