Comments (4)
Ebook::isValid
fixed my issue! Great, thanks for the quick response!
from php-ebook.
👌🏽 Everything looks great thank you!
from php-ebook.
Thanks for this report!
It's a very good idea!
ePUB check
It's possible to check ePUB with method isBadFile()
after reading.
$ebook = Ebook::read(EPUB_BAD_FILE);
if ($ebook->isBadFile()) {
continue
}
But it could be a good idea to add a static method to pre-check file! About the name, maybe isValid
is more expressive than check
? I will add isValid(string $path)
static method in next release!
Archive
Do you want an exception directly in getArchive
?
public function getArchive(): ?BaseArchive
{
if (! $this->archive) {
throw new \Exception("{$this->path} can't be read as archive.");
}
return $this->archive;
}
Or you want to add it to error_log without exception?
Nullable operator
It's curious because getArchive()
is nullable, are you sure about this?
typhint it as not nullable
Because in Ebook::class
public function getArchive(): ?BaseArchive
{
// ...
}
You can use nullable operator to safely use archive:
$ebook->getArchive()?->filter();
from php-ebook.
Thanks for your contributions!
Everything works now on your side?
from php-ebook.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-ebook.