public static function apply($report, $tests, array $options = array()) { $rules = new Rules(); $file = Libraries::get('li3_quality', 'path') . '/config/syntax.json'; $config = json_decode(file_get_contents($file), true) + array('name' => null, 'rules' => array(), 'options' => array()); foreach ($config['rules'] as $ruleName) { $class = Libraries::locate('rules.syntax', $ruleName); $rules->add(new $class()); } if ($config['options']) { $rules->options($config['options']); } foreach ($tests->invoke('subject') as $class) { $report->collect(__CLASS__, array($class => $rules->apply(new Testable(array('path' => Libraries::path($class)))))); } return $tests; }