Exemple #1
0
 protected function getRealPath($phpFile)
 {
     if (Str::startsWith($this->path, ['phar'])) {
         $realPath = $phpFile->getPath() . '/' . $phpFile->getFilename();
     } else {
         $realPath = $phpFile->getRealPath();
     }
     return $realPath;
 }
Exemple #2
0
 /**
  * return an array of values filtered by the key starting with $startswith
  * @param $arr []
  * @param $startwith string
  * @return array
  */
 public static function filterKeyStartsWith(&$arr, $startwith)
 {
     $results = array();
     foreach ($arr as $key => $value) {
         if (Str::startsWith($key, $startwith) === true) {
             $results[$key] = $value;
         }
     }
     return $results;
 }
Exemple #3
0
 public function testStartsWithNull()
 {
     $this->assertFalse(Str::startsWith('test', null));
 }