Skip to content

Commit

Permalink
Fixes internal casting when find(null)
Browse files Browse the repository at this point in the history
  • Loading branch information
daftspunk committed Dec 14, 2021
1 parent 97cd0e4 commit ed69c4e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Halcyon/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -1323,17 +1323,19 @@ public function newCollection(array $models = [])
}

/**
* Returns the base file name and extension. Applies a default extension, if none found.
* getFileNameParts returns the base file name and extension.
* Applies a default extension, if none found.
*/
public function getFileNameParts($fileName = null)
{
if ($fileName === null) {
$fileName = $this->fileName;
}

if (!strlen($extension = pathinfo($fileName, PATHINFO_EXTENSION))) {
$extension = pathinfo($fileName, PATHINFO_EXTENSION);
if (!strlen($extension)) {
$extension = $this->defaultExtension;
$baseFile = $fileName;
$baseFile = (string) $fileName;
}
else {
$pos = strrpos($fileName, '.');
Expand All @@ -1346,7 +1348,7 @@ public function getFileNameParts($fileName = null)
/**
* Get the datasource for the model.
*
* @return \October\Rain\Halcyon\DatasourceInterface
* @return \October\Rain\Halcyon\Datasource\DatasourceInterface
*/
public function getDatasource()
{
Expand Down

0 comments on commit ed69c4e

Please sign in to comment.