/** * Constructor * * @param string $type The guessed field type * @param array $options The options for creating instances of the * guessed class * @param integer $confidence The confidence that the guessed class name * is correct */ public function __construct($type, array $options, $confidence) { parent::__construct($confidence); $this->type = $type; $this->options = $options; }
/** * Constructor * * @param string $value The guessed value * @param int $confidence The confidence that the guessed class name * is correct */ public function __construct($value, $confidence) { parent::__construct($confidence); $this->value = $value; }
/** * @param string $resolveType * @param int $confidence */ public function __construct($resolveType, $confidence = self::LOW_CONFIDENCE) { $this->type = $resolveType; parent::__construct($confidence); }
<?php //DEPENDENCIES require_once __DIR__ . "/../vendor/autoload.php"; require_once __DIR__ . "/../src/Guess.php"; //INITIALIZE COOKIE SESSION session_start(); if (empty($_SESSION['wins'])) { $_SESSION['wins'] = array(); $_SESSION['yays'] = array(); $_SESSION['nays'] = array(); $da_words = array('candy', 'yodle', 'dinosaur', 'paper', 'bottle', 'yep', 'drinking', 'tablet', 'monitor', 'candle', 'nope'); $winning_letters = str_split(array_rand(array_flip($da_words))); foreach ($winning_letters as $w) { $w = new Guess($w); $w->saveWin(); } } //INITIALIZE APPLICATION (n uhh, find out what is the up w this "debug" thang) $app = new Silex\Application(); $app['debug'] = TRUE; $app->register(new Silex\Provider\TwigServiceProvider(), array('twig.path' => __DIR__ . "/../views")); $app->get('/', function () use($app) { $golden_letters = Guess::getWins(); $guessed_letters = Guess::getYays(); $matched_letters = array(); $replacement_letter = new Guess('__'); foreach ($golden_letters as $g) { if (in_array($g, $guessed_letters)) { array_push($matched_letters, $g); } else {
/** * @param array $config * @param int $confidence */ public function __construct(array $config, $confidence = self::LOW_CONFIDENCE) { $this->config = $config; parent::__construct($confidence); }