/**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     if (!$this->confirmToProceed("Deleting all compiled expressions!")) {
         return;
     }
     $result = Jmes::purgeCompiled();
     if ($result['success']) {
         $this->output->success(sprintf("Successfully removed %d %s", count($result['success']), 1 === count($result['success']) ? 'file' : 'files'));
         $this->output->newLine();
     }
     if ($result['failure']) {
         $this->output->warning(sprintf("Failed to remove %d %s:\n%s", count($result['failure']), 1 === count($result['failure']) ? 'file' : 'files', implode("\n", $result['failure'])));
         $this->output->newLine();
     }
 }
Esempio n. 2
0
 /**
  * @param string $expression
  * @param mixed  $data
  *
  * @return mixed|null
  */
 function jmes($expression, $data)
 {
     return Jmes::search($expression, $data);
 }