original_string: protected function getMessagesFromSourcePath($path, $namespace)
      {
          $messages = [];
          if (! $this->file->exists($path)) {
              throw new \Exception("${path} doesn't exists!");
          }
          foreach ($this->file->allFiles($path) as $file) {
              $pathName = $file->getRelativePathName();
              if ($this->file->extension($pathName) !== 'php') {
                  continue;
              }
              $key = substr($pathName, 0, -4);
              $key = str_replace('\\', '.', $key);
              $key = str_replace('/', '.', $key);
  
              $array = explode('.', $key, 2);
              $keyWithNamespace = $array[0].'.'.$namespace.'::'.$array[1];
              $messages[$keyWithNamespace] = include "${path}/${pathName}";
          }
  
          return $messages;
      }
code: protected function getMessagesFromSourcePath($path, $namespace)
      {
          $messages = [];
          if (! $this->file->exists($path)) {
              throw new \Exception("${path} doesn't exists!");
          }
          foreach ($this->file->allFiles($path) as $file) {
              $pathName = $file->getRelativePathName();
              if ($this->file->extension($pathName) !== 'php') {
                  continue;
              }
              $key = substr($pathName, 0, -4);
              $key = str_replace('\\', '.', $key);
              $key = str_replace('/', '.', $key);
  
              $array = explode('.', $key, 2);
              $keyWithNamespace = $array[0].'.'.$namespace.'::'.$array[1];
              $messages[$keyWithNamespace] = include "${path}/${pathName}";
          }
  
          return $messages;
      }
code_tokens: protected function getMessagesFromSourcePath ( $ path , $ namespace ) { $ messages = [ ] ; if ( ! $ this -> file -> exists ( $ path ) ) { throw new \ Exception ( "${path} doesn't exists!" ) ; } foreach ( $ this -> file -> allFiles ( $ path ) as $ file ) { $ pathName = $ file -> getRelativePathName ( ) ; if ( $ this -> file -> extension ( $ pathName ) !== 'php' ) { continue ; } $ key = substr ( $ pathName , 0 , - 4 ) ; $ key = str_replace ( '\\' , '.' , $ key ) ; $ key = str_replace ( '/' , '.' , $ key ) ; $ array = explode ( '.' , $ key , 2 ) ; $ keyWithNamespace = $ array [ 0 ] . '.' . $ namespace . '::' . $ array [ 1 ] ; $ messages [ $ keyWithNamespace ] = include "${path}/${pathName}" ; } return $ messages ; }
docstring: Return language messages for a path.
  @param $path
  @return array
  @throws \Exception
docstring_tokens: Return language messages for a path .