/** * * @param string $scope scope of log * @param string $format format of output */ public function __construct($scope = '', $file = null, $format = null) { $this->scope = $scope; $this->parseFormat($format); $this->file = $file; if (!Strings::isEmpty($this->file)) { $this->fileHandler = new File($this->file . '_' . date('Y-m-d') . '.log'); $this->fileHandler->open('a'); } }
protected function checkConstraints($target) { if (Strings::isEmpty($this->value)) { throw new AnnotationException("Observer value cannot be empty.\n{$target->__toString()}"); } }
/** * @param array $deployment * @return void */ private function scanModels($modules, $moduleName) { foreach ($modules as $module) { if (array_key_exists('models', $module)) { foreach ($module['models'] as $modelName => $modelPath) { $modelClass = $modelName; if (!Strings::isEmpty($modelName)) { $modelClass = str_replace('module\\', '', $modelClass); } $this->models[] = $modelClass; $this->log->console("Model: \t " . $modelClass); } } } }