3838class BoardImportService {
3939 private string $ system = '' ;
4040 private ?ABoardImportService $ systemInstance = null ;
41+ /** @var list<array{name: string, class: class-string, internalName: string}> */
4142 private array $ allowedSystems = [];
4243 /**
4344 * Data object created from config JSON
@@ -137,16 +138,12 @@ public function import(): void {
137138 public function validateSystem (): void {
138139 $ allowedSystems = $ this ->getAllowedImportSystems ();
139140 $ allowedSystems = array_column ($ allowedSystems , 'internalName ' );
140- if (!in_array ($ this ->getSystem (), $ allowedSystems )) {
141+ if (!in_array ($ this ->getSystem (), $ allowedSystems, true )) {
141142 throw new NotFoundException ('Invalid system: ' . $ this ->getSystem ());
142143 }
143144 }
144145
145- /**
146- * @param ?string $system
147- * @return self
148- */
149- public function setSystem ($ system ): self {
146+ public function setSystem (?string $ system ): self {
150147 if ($ system ) {
151148 $ this ->system = $ system ;
152149 }
@@ -157,11 +154,17 @@ public function getSystem(): string {
157154 return $ this ->system ;
158155 }
159156
160- public function addAllowedImportSystem ($ system ): self {
157+ /**
158+ * @param array{name: string, class: class-string, internalName: string} $system
159+ */
160+ public function addAllowedImportSystem (array $ system ): self {
161161 $ this ->allowedSystems [] = $ system ;
162162 return $ this ;
163163 }
164164
165+ /**
166+ * @return list<array{name: string, class: class-string, internalName: string}>
167+ */
165168 public function getAllowedImportSystems (): array {
166169 if (!$ this ->allowedSystems ) {
167170 $ this ->addAllowedImportSystem ([
0 commit comments