コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function inspect()
 {
     $finder = new Finder();
     $foundFiles = $finder->in($this->path)->name($this->filename)->count();
     if (1 != $foundFiles) {
         return InspectionError::create($this->getName(), sprintf('The requested file "%s" in path "%s" does not exist.', $this->filename, $this->path));
     }
     return;
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function inspect()
 {
     $finder = new Finder();
     $day = $this->getValidatedDayAttribute($this->attributes['day']);
     $pattern = $this->getParsedPattern($this->attributes['pattern'], $day);
     $foundFiles = $finder->in($this->path)->name($this->filename)->contains($pattern)->count();
     if (1 != $foundFiles) {
         return InspectionError::create($this->getName(), sprintf('The requested file "%s" in path "%s" does not contains the given pattern ("%s").', $this->filename, $this->path, $pattern));
     }
     return;
 }
コード例 #3
0
 /**
  * {@inheritdoc}
  */
 public function inspect()
 {
     $finder = new Finder();
     $day = $this->getValidatedDayAttribute($this->attributes['day']);
     $startTime = $this->getValidatedStartTimeAttribute($this->attributes['startTime']);
     $endTime = $this->getValidatedEndTimeAttribute($this->attributes['endTime']);
     $foundFiles = $finder->in($this->path)->name($this->filename)->date(sprintf('>= %s %s', $day, $startTime))->date(sprintf('<= %s %s', $day, $endTime))->count();
     if (1 != $foundFiles) {
         return InspectionError::create($this->getName(), sprintf('The requested file "%s" in path "%s" does not have a valid date ("%s between %s and %s").', $this->filename, $this->path, $day, $startTime, $endTime));
     }
     return;
 }