@@ -63,7 +63,7 @@ class Worksheet
6363 /**
6464 * Invalid characters in sheet title.
6565 */
66- private static array $ invalidCharacters = ['* ' , ': ' , '/ ' , '\\' , '? ' , '[ ' , '] ' ];
66+ private const INVALID_CHARACTERS = ['* ' , ': ' , '/ ' , '\\' , '? ' , '[ ' , '] ' ];
6767
6868 /**
6969 * Parent spreadsheet.
@@ -157,13 +157,6 @@ class Worksheet
157157 */
158158 private Protection $ protection ;
159159
160- /**
161- * Collection of styles.
162- *
163- * @var Style[]
164- */
165- private array $ styles = [];
166-
167160 /**
168161 * Conditional styles. Indexed by cell coordinate, e.g. 'A1'.
169162 */
@@ -400,7 +393,7 @@ public function getCellCollection(): Cells
400393 */
401394 public static function getInvalidCharacters (): array
402395 {
403- return self ::$ invalidCharacters ;
396+ return self ::INVALID_CHARACTERS ;
404397 }
405398
406399 /**
@@ -418,7 +411,7 @@ private static function checkSheetCodeName(string $sheetCodeName): string
418411 }
419412 // Some of the printable ASCII characters are invalid: * : / \ ? [ ] and first and last characters cannot be a "'"
420413 if (
421- (str_replace (self ::$ invalidCharacters , '' , $ sheetCodeName ) !== $ sheetCodeName )
414+ (str_replace (self ::INVALID_CHARACTERS , '' , $ sheetCodeName ) !== $ sheetCodeName )
422415 || (Shared \StringHelper::substring ($ sheetCodeName , -1 , 1 ) == '\'' )
423416 || (Shared \StringHelper::substring ($ sheetCodeName , 0 , 1 ) == '\'' )
424417 ) {
@@ -443,7 +436,7 @@ private static function checkSheetCodeName(string $sheetCodeName): string
443436 private static function checkSheetTitle (string $ sheetTitle ): string
444437 {
445438 // Some of the printable ASCII characters are invalid: * : / \ ? [ ]
446- if (str_replace (self ::$ invalidCharacters , '' , $ sheetTitle ) !== $ sheetTitle ) {
439+ if (str_replace (self ::INVALID_CHARACTERS , '' , $ sheetTitle ) !== $ sheetTitle ) {
447440 throw new Exception ('Invalid character found in sheet title ' );
448441 }
449442
@@ -1393,16 +1386,6 @@ public function getColumnStyle(string $column): ?Style
13931386 );
13941387 }
13951388
1396- /**
1397- * Get styles.
1398- *
1399- * @return Style[]
1400- */
1401- public function getStyles (): array
1402- {
1403- return $ this ->styles ;
1404- }
1405-
14061389 /**
14071390 * Get style for cell.
14081391 *
0 commit comments