2020namespace FastForward \DevTools \Project ;
2121
2222/**
23- * Describes the documentation, testing, and wiki surfaces exposed by the current repository.
23+ * Captures which documentation, testing, and wiki surfaces are available for the current repository.
2424 */
2525final readonly class ProjectCapabilities
2626{
2727 /**
28+ * Creates a repository capability snapshot for reporting and documentation commands.
29+ *
2830 * @param list<string> $apiDirectories project-relative directories that contain autoloaded PHP API source
2931 * @param string|null $defaultPackageName the default package name derived from Composer namespaces when available
3032 * @param bool $hasGuideDirectory whether the configured guide directory exists
@@ -42,87 +44,87 @@ public function __construct(
4244 ) {}
4345
4446 /**
45- * @return list<string>
47+ * Returns the project-relative directories that expose autoloaded PHP API source.
4648 */
4749 public function getApiDirectories (): array
4850 {
4951 return $ this ->apiDirectories ;
5052 }
5153
5254 /**
53- * @return string|null
55+ * Returns the default API package name when one can be derived from Composer namespaces.
5456 */
5557 public function getDefaultPackageName (): ?string
5658 {
5759 return $ this ->defaultPackageName ;
5860 }
5961
6062 /**
61- * @return bool
63+ * Detects whether the configured guide directory exists.
6264 */
6365 public function hasGuideDirectory (): bool
6466 {
6567 return $ this ->hasGuideDirectory ;
6668 }
6769
6870 /**
69- * @return bool
71+ * Detects whether the configured tests directory exists.
7072 */
7173 public function hasTestsPath (): bool
7274 {
7375 return $ this ->hasTestsPath ;
7476 }
7577
7678 /**
77- * @return bool
79+ * Detects whether the configured wiki target exists.
7880 */
7981 public function hasWikiTarget (): bool
8082 {
8183 return $ this ->hasWikiTarget ;
8284 }
8385
8486 /**
85- * @return bool
87+ * Detects whether the repository exposes PHP source files outside generated and vendor areas.
8688 */
8789 public function hasPhpSourceFiles (): bool
8890 {
8991 return $ this ->hasPhpSourceFiles ;
9092 }
9193
9294 /**
93- * @return bool
95+ * Detects whether the repository exposes autoloaded PHP API source.
9496 */
9597 public function canGenerateApiDocumentation (): bool
9698 {
9799 return [] !== $ this ->apiDirectories ;
98100 }
99101
100102 /**
101- * @return bool
103+ * Detects whether the repository can generate guides, API documentation, or both.
102104 */
103105 public function canGenerateDocs (): bool
104106 {
105107 return $ this ->hasGuideDirectory || $ this ->canGenerateApiDocumentation ();
106108 }
107109
108110 /**
109- * @return bool
111+ * Detects whether metrics generation has PHP source or test inputs to analyse.
110112 */
111113 public function canGenerateMetrics (): bool
112114 {
113115 return $ this ->hasTestsPath || $ this ->hasPhpSourceFiles ;
114116 }
115117
116118 /**
117- * @return bool
119+ * Detects whether wiki generation can render API documentation into the configured wiki target.
118120 */
119121 public function canGenerateWiki (): bool
120122 {
121123 return $ this ->hasWikiTarget && $ this ->canGenerateApiDocumentation ();
122124 }
123125
124126 /**
125- * @return bool
127+ * Detects whether the repository has enough PHP surface to justify running tests.
126128 */
127129 public function canRunTests (): bool
128130 {
0 commit comments