Git Komut Rehberi & Terminal Asistanı
Sıfırdan Yeni Bir Depo Başlatın:
Mevcut Bir Git Deposu veya Klasörü Gönderin:
Hataları Geri Alma, İptal & Temizlik:
Son commit'i geri al (yapılan değişiklikleri korur):
git reset --soft HEAD~1
Yapılan yerel değişiklikleri iptal et (çalışma ağacını temizler):
git restore .
Takip edilmeyen gereksiz dosyaları sil:
git clean -fd
Değişiklikleri geçici sakla ve geri getir (stash):
git stash git stash pop
Dal (Branch) ve Sürüm Etiketleri:
Yeni dal aç ve geçiş yap:
git checkout -b yeni-ozellik git push -u origin yeni-ozellik
Sürüm etiketi (tag) oluştur ve gönder:
git tag -a v1.0.0 -m "Sürüm 1.0.0" git push origin --tags
feat: Release v3.0.0 - PHPStan-style analysis, configuration, baseline, and advanced WCAG rules
This commit is contained in:
+96
-1
@@ -13,11 +13,34 @@ class Config
|
||||
public function __construct(array $settings = [])
|
||||
{
|
||||
$this->settings = $settings;
|
||||
$this->loadDotenv();
|
||||
}
|
||||
|
||||
private function loadDotenv(): void
|
||||
{
|
||||
$cwd = getcwd();
|
||||
if ($cwd && file_exists($cwd . '/.env')) {
|
||||
try {
|
||||
$dotenv = \Dotenv\Dotenv::createImmutable($cwd);
|
||||
$dotenv->safeLoad();
|
||||
} catch (\Throwable $e) {
|
||||
// Ignore Dotenv errors silently
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function fromYaml(string $path): self
|
||||
{
|
||||
// Placeholder for YAML loading logic
|
||||
if (file_exists($path)) {
|
||||
try {
|
||||
$content = \Symfony\Component\Yaml\Yaml::parseFile($path);
|
||||
if (is_array($content)) {
|
||||
return new self($content);
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
// Ignore parsing errors
|
||||
}
|
||||
}
|
||||
return new self([]);
|
||||
}
|
||||
|
||||
@@ -26,6 +49,78 @@ class Config
|
||||
return $this->settings[$key] ?? $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<int, string>
|
||||
*/
|
||||
public function getPaths(): array
|
||||
{
|
||||
$paths = $this->get('paths');
|
||||
if (is_array($paths)) {
|
||||
return $paths;
|
||||
}
|
||||
if (is_string($paths)) {
|
||||
return [$paths];
|
||||
}
|
||||
return ['.']; // default to current directory
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<int, string>
|
||||
*/
|
||||
public function getExcludePaths(): array
|
||||
{
|
||||
$exclude = $this->get('exclude_paths');
|
||||
if (is_array($exclude)) {
|
||||
return $exclude;
|
||||
}
|
||||
if (is_string($exclude)) {
|
||||
return [$exclude];
|
||||
}
|
||||
return ['vendor', 'node_modules', 'tests', 'storage', '.git']; // sensible defaults
|
||||
}
|
||||
|
||||
public function getLevel(): int
|
||||
{
|
||||
$level = $this->get('level', 4);
|
||||
return is_numeric($level) ? (int)$level : 4;
|
||||
}
|
||||
|
||||
public function getBaselinePath(): ?string
|
||||
{
|
||||
$baseline = $this->get('baseline');
|
||||
return is_string($baseline) ? $baseline : null;
|
||||
}
|
||||
|
||||
public function getFormat(): string
|
||||
{
|
||||
$format = $this->get('format', 'console');
|
||||
return is_string($format) ? $format : 'console';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{include: array<int, string>, exclude: array<int, string>}
|
||||
*/
|
||||
public function getRulesConfig(): array
|
||||
{
|
||||
$rules = $this->get('rules', []);
|
||||
$include = [];
|
||||
$exclude = [];
|
||||
|
||||
if (is_array($rules)) {
|
||||
if (isset($rules['include']) && is_array($rules['include'])) {
|
||||
$include = $rules['include'];
|
||||
}
|
||||
if (isset($rules['exclude']) && is_array($rules['exclude'])) {
|
||||
$exclude = $rules['exclude'];
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
'include' => $include,
|
||||
'exclude' => $exclude
|
||||
];
|
||||
}
|
||||
|
||||
public function getGeminiApiKey(): ?string
|
||||
{
|
||||
return $this->get('gemini_api_key') ?? $_ENV['GEMINI_API_KEY'] ?? getenv('GEMINI_API_KEY') ?: null;
|
||||
|
||||
Reference in New Issue
Block a user