Skip to content

Commit

Permalink
replaced getBasename with getFilename
Browse files Browse the repository at this point in the history
  • Loading branch information
livingroot committed May 15, 2023
1 parent 4f6c4e2 commit 464f6f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/Command/BuildCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public function buildContent($folder, $type)
$directory = new \DirectoryIterator($folder);
foreach ($directory as $path => $info) {
/** @var \SplFileInfo $info */
$name = $info->getBasename();
$name = $info->getFilename();

// Ignore dotfiles/folders
if (substr($name, 0, 1) == '.') continue;
Expand Down Expand Up @@ -228,7 +228,7 @@ public function buildResources($context, $iterator)
$resources = array();
$parents = array();
foreach ($iterator as $fileInfo) {
if (substr($fileInfo->getBasename(), 0, 1) == '.') {
if (substr($fileInfo->getFilename(), 0, 1) == '.') {
continue;
}
/** @var \SplFileInfo $fileInfo */
Expand Down Expand Up @@ -258,7 +258,7 @@ public function buildResources($context, $iterator)
try {
$data = Gitify::fromYAML($rawData);
} catch (ParseException $Exception) {
$this->output->writeln('<error>Could not parse ' . $resource->getBasename() . ': ' . $Exception->getMessage() .'</error>');
$this->output->writeln('<error>Could not parse ' . $resource->getFilename() . ': ' . $Exception->getMessage() .'</error>');
continue;
}
if (!empty($content)) {
Expand Down Expand Up @@ -397,7 +397,7 @@ public function buildObjects($folder, $type)

foreach ($directory as $file) {
/** @var \SplFileInfo $file */
$name = $file->getBasename();
$name = $file->getFilename();

// Ignore dotfiles/folders
if (substr($name, 0, 1) == '.') continue;
Expand Down
2 changes: 1 addition & 1 deletion src/Command/RestoreCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$directory = new \DirectoryIterator($targetDirectory);
foreach ($directory as $path => $info) {
/** @var \SplFileInfo $info */
$name = $info->getBasename();
$name = $info->getFilename();
// Ignore dotfiles/folders
if (substr($name, 0, 1) === '.') {
continue;
Expand Down

0 comments on commit 464f6f5

Please sign in to comment.