Skip to content

File helper improvements (Deprecation)

Choose a tag to compare

@Mistralys Mistralys released this 13 Oct 19:39
· 188 commits to main since this release

Included in this release:

  • JSONFile: Made the $pretty parameter optional.
  • JSONFile: Added getData() as alias for parse().
  • JSONFile: Added setPrettyPrint() to set the option separately.
  • JSONFile: Added setTrailingNewline() to add a newline at the end of the file.
  • JSONFile: Added setEscapeSlashes() to set whether to escape slashes in the output.
  • JSONFile: Added options() to work with all options.
  • JSONFile: Added JSONOptions with the possibility to set options globally.
  • Optionable: Tweaked the handling of default values.
  • Optionable: Added setting option default values.
  • Optionable: Added getArrayAdvanced() for type-specific array handling.
  • FileFinder: Added getFiles() for a wider range of type-specific methods to access files.
  • ClassHelper: Added findClassesInFolder() to get all classes in a folder.
  • ClassHelper: requireClassExists() can now be used interchangeably for classes, interfaces, and traits.
  • ClassHelper: Added isClassInstanceOf().

Deprecations

The following FileFinder methods have been deprecated:

  • FileFinder::getAll() > FileFinder::getMatches()
  • FileFinder::getFileInfos() > FileFinder::getFiles()->typeANY()
  • FileFinder::getPHPFiles() > FileFinder::getFiles()->typePHP()
  • FileFinder::getPHPClassNames() > FileFinder::getFiles()->PHPClassNames()