/** * {@inheritdoc} */ public function startsWith($substring, $caseSensitive = true) { return (bool) parent::startsWith($substring, $caseSensitive); }
/** * Get the required packages. * * @return array */ private function getPackages() { $file = getcwd() . '/composer.json'; if (!file_exists($file)) { return []; } $json = json_decode(file_get_contents($file), true); $packages = []; if (isset($json['require'])) { $packages = array_merge($packages, $json['require']); } if (isset($json['require-dev'])) { $packages = array_merge($packages, $json['require-dev']); } if (count($packages) <= 0) { return []; } $array = []; foreach ($packages as $name => $version) { $string = new Stringy($name); if ($string->startsWith('php') || $string->startsWith('ext')) { continue; } $array[$name] = $version; } return $array; }